Ignore:
Timestamp:
10/02/12 13:39:16 (8 years ago)
Author:
mnagni
Message:

New ea_model library.
No more use the django.forms. Now uses JSON and Dojo(javascript)
DB creation files are now executed as standard python function (before was used a system execution call)
Added an html example to play/work offline with DOJO

Location:
mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/examples
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/examples/aquifer.py

    r8087 r8088  
     1 
     2 
     3 
    14 
    25 
     
    1922 
    2023''' 
    21 Created on 06-Feb-2012 15:59:43 
     24Created on 10-Feb-2012 12:03:15 
    2225 
    2326@author: mnagni 
     
    4043        super(Aquifer, self).__init__() 
    4144 
    42  
    43  
    4445    def __key(self): 
    4546        return (self.content) 
    4647 
    47     def __eq__(x, y): 
     48    def __eq__(self, y): 
    4849        ''' 
    4950        Cannot compare classes which do not define a "__key" attribute  
    5051        ''' 
    51         if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
    52             return x.__key() == y.__key() 
    53         return id(x) == id(y) 
     52        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return self.__key() == y.__key() 
     54        return id(self) == id(y) 
    5455 
    5556    def __hash__(self): 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/examples/pallet.py

    r8087 r8088  
     1 
     2 
     3 
    14 
    25 
     
    1922 
    2023''' 
    21 Created on 06-Feb-2012 15:59:44 
     24Created on 10-Feb-2012 12:03:05 
    2225 
    2326@author: mnagni 
     
    4043        super(Pallet, self).__init__() 
    4144 
    42  
    43  
    4445    def __key(self): 
    4546        return (self.mass) 
    4647 
    47     def __eq__(x, y): 
     48    def __eq__(self, y): 
    4849        ''' 
    4950        Cannot compare classes which do not define a "__key" attribute  
    5051        ''' 
    51         if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
    52             return x.__key() == y.__key() 
    53         return id(x) == id(y) 
     52        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return self.__key() == y.__key() 
     54        return id(self) == id(y) 
    5455 
    5556    def __hash__(self): 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/examples/waterbody.py

    r8087 r8088  
     1 
     2 
     3 
    14 
    25 
     
    1922 
    2023''' 
    21 Created on 06-Feb-2012 15:59:42 
     24Created on 10-Feb-2012 12:03:15 
    2225 
    2326@author: mnagni 
     
    4043        super(WaterBody, self).__init__() 
    4144 
    42  
    43  
    4445    def __key(self): 
    4546        return (self.salinity) 
    4647 
    47     def __eq__(x, y): 
     48    def __eq__(self, y): 
    4849        ''' 
    4950        Cannot compare classes which do not define a "__key" attribute  
    5051        ''' 
    51         if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
    52             return x.__key() == y.__key() 
    53         return id(x) == id(y) 
     52        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return self.__key() == y.__key() 
     54        return id(self) == id(y) 
    5455 
    5556    def __hash__(self): 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/examples/well.py

    r8087 r8088  
     1 
     2 
     3 
    14 
    25 
     
    1922 
    2023''' 
    21 Created on 06-Feb-2012 15:59:45 
     24Created on 10-Feb-2012 12:03:07 
    2225 
    2326@author: mnagni 
     
    4043        super(Well, self).__init__() 
    4144 
    42  
    43  
    4445    def __key(self): 
    4546        return (self.sampledFeature) 
    4647 
    47     def __eq__(x, y): 
     48    def __eq__(self, y): 
    4849        ''' 
    4950        Cannot compare classes which do not define a "__key" attribute  
    5051        ''' 
    51         if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
    52             return x.__key() == y.__key() 
    53         return id(x) == id(y) 
     52        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return self.__key() == y.__key() 
     54        return id(self) == id(y) 
    5455 
    5556    def __hash__(self): 
Note: See TracChangeset for help on using the changeset viewer.