h! all,

Suppose i have this code in a app module:

---
from gluon import *

m_fields = list()

fld_name = Field('name', 'string')
fld_categ = Field('categ_id', 'reference categories')

m_fields.append(fld_name)
m_fields.append(fld_categ)

def define_table():
    if not hasattr(db, 'my_model'):
        db.define_table('my_model', *m_fields)
        db.commit()
---

the function define_table() of this module es called from db.py so
that the table get defined, but i'm getting on error:

<type 'exceptions.ValueError'> SELECT categories.name, categories.id
FROM categories WHERE (categories.id IS NOT NULL) ORDER BY
categories.name, categories.id;

My question is: having my fields define at module level have anything
to do with this error ?

-- 
Msc. Yoel Benítez Fonseca
Especialista en TI
http://redevil.cubava.cu/
Tel.: (53 32)284701

-- 
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