diff Generic/durusdatabase.py @ 7:0359329a1c26

Navigation buttons. Version of the data structure.
author Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
date Thu, 11 Nov 2010 23:22:35 +0100
parents 6502bfdaa84d
children
line wrap: on
line diff
--- a/Generic/durusdatabase.py	Sat Nov 06 22:33:32 2010 +0100
+++ b/Generic/durusdatabase.py	Thu Nov 11 23:22:35 2010 +0100
@@ -27,7 +27,7 @@
 from durus.connection import Connection
 # pyArq Presupuestos Modules
 from Generic import utils
-
+from Generic import globalVars
 class DurusFile(object):
     def __init__(self, file, new):
         self.__file = file
@@ -41,10 +41,16 @@
         self.__connection.get_storage().close()
 
     def getBudget(self):
-        return self.__root["budget"]
+        if self.__root.has_key("baseversion") and \
+           globalVars.baseversion == self.__root["baseversion"]:
+            return self.__root["budget"]
+        else:
+            print _("Incorrent Base version")
+            return None
 
     def setBudget(self, budget):
         self.__root["budget"] = budget
+        self.__root["baseversion"] = globalVars.baseversion
         self.__connection.commit()
 
 class Read(object):