Massimo,

I am using Postgres. In my application I have these tables:

db.define_table('provincie',
    SQLField('provincie',label='Provincie *
',length=18,default='',notnull=True,unique=True),
    migrate=False)

db.provincie.provincie.requires=[IS_LENGTH(18,error_message=T('length
exceeds 18')),IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'provincie.provincie',error_message=T('provincie already in
database'))]


db.define_table('gemeente',
    SQLField('gemeente',label='Gemeente *
',length=30,default='',notnull=True,unique=True),
    SQLField('provincie',db.provincie,label='Provincie *
',default='',notnull=True,ondelete='RESTRICT'),
    migrate=False)

db.gemeente.gemeente.requires=[IS_LENGTH(30,error_message=T('length
exceeds 30')),IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'gemeente.gemeente',error_message=T('gemeente already in
database'))]
db.gemeente.provincie.requires=IS_IN_DB(db,db.provincie.id,'%
(provincie)s')


When I update record 1 in the province table, check the 'check to
delete' box and submit the page, an error ticket is issued:

Traceback (most recent call last):
  ....
  File "/Library/Python/2.5/site-packages/web2pyfitwise/gluon/sql.py",
line 722, in <lambda>
    self._execute = lambda *a, **b: self._cursor.execute(*a,**b)
IntegrityError: update or delete on table "provincie" violates foreign
key constraint "gemeente_provincie_fkey" on table "gemeente"
DETAIL:  Key (id)=(1) is still referenced from table "gemeente".


Isn't displaying a warning message just a matter of 'translating' this
error ticket into a response.message or response.flash 'thing'?



Kind regards,

Annet.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to