Please advise.
------------------------------------
Error traceback
Traceback (most recent call last):
File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
File "/home/web2py/applications/test/models/db.py", line 12, in
<module>
SQLField('network',type=cidr))
File "gluon/sql.py", line 1249, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
File "gluon/sql.py", line 1600, in _create
(field.type, field.name)
SyntaxError: Field: unknown field type: string for network
In file: /home/web2py/applications/test/models/db.py
from gluon.dal import SQLCustomType
inet = SQLCustomType ( type='string', native='inet')
cidr = SQLCustomType ( type='string', native='cidr')
macaddr = SQLCustomType ( type='string', native='macaddr')
db = DAL('postgres://web2py:web...@localhost/test1', pool_size=10)
db.define_table('firewall',
SQLField('network',type=cidr))
On Dec 25, 9:15 pm, mdipierro <[email protected]> wrote:
> yes this is definitively possible. I would try
>
> inet = SQLCustomType
> (
> type
> ='string',
> native
> ='inet'))
>
> db.define_table
> (
>
> 'example',
> Field('value',
> type=inet)
> )
>
> Massimo
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.