5 version state module. Return database version, database connecting strings and application build version
8 from django.db
import connection
12 def getWebSrvPrefix():
13 return str(version_gen.web_srv_prefix)
15 def getVersionString():
16 """version string, for displaying in client"""
17 return str(version_gen.major) +
"." + str(version_gen.minor) +
"." + str(version_gen.compilation)
21 return version_gen.DB_NAME
25 return version_gen.DB_USER
28 """database password"""
29 return version_gen.DB_PASSWORD
31 def _versionFromRow(row):
32 """helping function - parse row to return the correct version"""
35 ver = str(row[0].split(
',')[0])
40 def getDBVersionString():
41 """database version"""
42 cursor = connection.cursor()
43 cursor.execute(
"select version();")
44 row = cursor.fetchone()
45 return _versionFromRow(row)