~robbyoconnor/sahana-eden/surveytool

« back to all changes in this revision

Viewing changes to models/01_crud.py

  • Committer: Robert O'Connor
  • Date: 2010-09-29 13:36:11 UTC
  • mfrom: (840.1.453 eden)
  • Revision ID: robby.oconnor@gmail.com-20100929133611-r13rs4q65v1r1ed7
merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1788
1788
                if "deleted" in db[table] and deployment_settings.get_security_archive_not_delete():
1789
1789
                    if onvalidation:
1790
1790
                        onvalidation(row)
1791
 
                    # Avoid collisions of values in unique fields between deleted records and
1792
 
                    # later new records => better to solve this in shn_create by utilising
1793
 
                    # s3xrc.original() to find the original record with that keys and re-use
1794
 
                    # it instead of creating a new one.
1795
1791
                    deleted = dict(deleted=True)
1796
 
                    #for f in table.fields:
1797
 
                        #if f not in ("id", "uuid") and table[f].unique:
1798
 
                            #if table[f].notnull and str(table[f].type) in ("string", "text"):
1799
 
                                #newvalue = "_" + row[f]
1800
 
                                #deleted.update({f:newvalue})
1801
 
                            #elif not table[f].notnull:
1802
 
                                #deleted.update({f:None})
1803
 
                            #else:
1804
 
                                ## notnull and not string => cannot be removed
1805
 
                                #pass
1806
1792
                    db(db[table].id == row.id).update(**deleted)
1807
1793
                    if onaccept:
1808
1794
                        onaccept(row)
1867
1853
        else:
1868
1854
            lat = config.lat
1869
1855
            lon = config.lon
1870
 
        layername = Tstr("Location")
 
1856
        layername = T("Location")
1871
1857
        popup_label = ""
1872
1858
        filter = Storage(tablename = tablename,
1873
1859
                         id = r.id