Ignore:
Timestamp:
10/07/12 15:15:27 (8 years ago)
Author:
mnagni
Message:

Complete - # 22489: CEDA Observation Collection - phenomenonTime
 http://team.ceda.ac.uk/trac/ceda/ticket/22489
Complete - # 22518: The description is broken
 http://team.ceda.ac.uk/trac/ceda/ticket/22518
Complete - # 22488: CEDA Observation Collection - Geographical Extent
 http://team.ceda.ac.uk/trac/ceda/ticket/22488

Now the Moles3EPB explicitly call the "synchronise" method in the SQLAlchemy mapped classes to assure the persistence of the data
Uses the CedaMolesModel? v 0.1.5 which correct a major problem in synchronise the instances with database

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/epb.py

    r8445 r8460  
    3434from sqlalchemy.sql.expression import text 
    3535from MolesManager.forms.date import methodsWithDecorator 
     36from sqlalchemy.orm.util import identity_key 
    3637 
    3738class EPB(object): 
     
    158159 
    159160    @classmethod 
     161    def persistInstance(cls, instance, session): 
     162        """ 
     163            Adds a new migration object. 
     164            @param migrationObj: the migration object to add 
     165            @param session: an sqlalchemy Session object. If None (default) the method creates 
     166            @return an updated, session independant, object instance reflecting the new persisted object  
     167        """         
     168        session.add(instance) 
     169        session.commit() 
     170        id_key = identity_key(instance=instance) 
     171        instance = EPB.search(id_key[0], id_key[1], session) 
     172        #instance = ret 
     173 
     174    @classmethod 
    160175    def executeNative(self, sqlNative, session): 
    161176        return session.execute(text(sqlNative))      
Note: See TracChangeset for help on using the changeset viewer.