Hi All, 

I have very basic dtabasae where in one table i have IPs which are used in 
second table:

db.define_table('ipaddress',
   Field('ip', unique=True, length=200,requires=IS_NOT_EMPTY()),
   Field('subnet', length=200, requires=IS_NOT_EMPTY() ),
   Field('status', length=200, default="Free", 
requires=IS_IN_SET(['Free','Used'])),
   format = '%(ip)s')

db.define_table('server',
   Field('servername', length=200),
   Field('port', length=200, requires=IS_NOT_EMPTY()),
   Field('ipaddress', unique=True, length=200, 
requires=IS_IN_DB(db(db.ipaddress.status=='Free'),db.ipaddress.ip, 
'%(ip)s')),
  

The problem i'm having is that with grid i can delete and add new values to 
"server" table and i added function which update status of IP for USED or 
FREE after insert/delete. 
Problem is with Update function as when i try to update server name i need 
to chose IP again and i can't chose same IP as it is marked in ipaddress 
table as USED hence it's not displayed in dropdown menu.
How can i display all IPs that are marked as FREE in ipaddress table AND 
IPs that where currently assign to the record i'm updateing in table 
server? 

Regards.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to