[web2py] Cannot resolve reference

2018-06-21 Thread yogeshwar khalkar
Hi,

I am getting 
 'Cannot resolve reference company_process in 
board_meeting definition'
error when using circular reference..

Table structure

db.define_table('board_meeting',
Field('agenda', 'json'),
Field('process',db.process),
Field('event','reference company_process'),
Field('serial', length=100),
Field('address','string'),
Field('description','text'),
Field('resolution','json'),
format = '%(serial)s')

db.define_table("company_process",
Field('process',db.process),
Field('company',db.company),
Field('board_meeting',db.board_meeting),
Field('egm',db.board_meeting),
Field('steps','integer'),
Field('filling_document','json'),
auth.signature,
format='%(process)s')

I am using web2py 2.16.1

Please help me to solve this.

Thanks.

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


[web2py] Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-18 Thread icodk
In general I can have a reference in table *child* to table *parent  
*disregarding 
the definition order. 
However, If I read from  table *child* (that reference table *parent*)  in 
menu.py, I get a Cannot resolve reference error 
Any idea how to solve it ?

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


[web2py] Cannot resolve reference error

2014-09-09 Thread José Eloy
Hi!

I'm developing an web2py application that use an external SQL Server 
database. I can connect to the SQL Server database using  migrate=False in 
those tables I need to access. In addition I create my own tables from 
web2py (also they connect to SQL Server). My troubles begin when one of my 
tables (created with web2py) intents to connect with the external database. 
When I try to connect I get the "cannot resolve reference" error.

Below I show the significant code of my application:

In db.py:
db = DAL('mssql://connection to SQL Server database created with web2py') 
db2= DAL('mssql://connection to External SQL Server database')

# Table personal_personal is external (was not created with web2py, it's 
not complete, only show the most important)

db2.define_table('personal_personal',
 Field('foto_personal', 'blob', notnull=False),
 Field('firma_personal', 'blob', notnull=False),
 Field('id_personal', 'id', requires=IS_NOT_IN_DB(db2, 
'personal_personal.id_personal'), unique=True, notnull=True), #Primary key, 
not auto-increment
 Field('id_categoria', db2.personal_catalogo_categoria, 
requires = IS_IN_DB(db2, db2.personal_catalogo_categoria.id_categoria, 
'%(id_categoria)s'), notnull=True),
 Field('id_areataller', db2.mtto_areataller, requires = 
IS_IN_DB(db2, db2.mtto_areataller.id_areataller, '%(id_areataller)s'), 
notnull=False),
 Field('id_area', 'reference general_area.id_area', 
requires = IS_IN_DB(db2, db2.general_area.id_area, '%(id_area)s - 
%(nombre)s'), notnull=True),
 Field('id_depto', 'reference 
general_departamentos.id_depto', requires = IS_IN_DB(db2, 
db2.general_departamentos.id_depto, '%(id_depto)s - %(descripcion)s'), 
notnull=False),
 Field('cant_hijos', 'integer', notnull=False),
 Field('status_foto', 'integer', notnull=False),
 Field('status_firma', 'integer', notnull=False),
 Field('porcent_ret_descuent', 'integer', notnull=False),
 
Migrate=False)

Below personal_personal is defined the following table:

db.define_table('unidades',
Field('nombre', requires=IS_NOT_EMPTY()),
Field('descripcion'),
Field('tipo_unidad', db.tipo_unidades),
Field('operador', 'reference 
db2.personal_personal.id_personal', requires = IS_IN_DB(db2, 
db2.personal_personal.id_personal, '%(nombre)s')),
format='%(operador)s'
)

The 'operador' field reference the table personal_personal.

In a controller I have the following code:

def nueva_unidad():
form=SQLFORM(db.unidades, submit_button="Aceptar")
if form.accepts(request.vars, session):
redirect(URL(r=request, f='nueva_unidad'))
response.flash = 'Se ha creado una nueva unidad'

return dict( form=form)

When I call this function is when I get the error: 
 'Cannot resolve reference 
db2.personal_personal.id_personal in unidades definition'


How can I to correct this error? Any Idea?

Thanks in advanced.

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.