Friends,

   In my app running in GAE I'm receiving a error message when display/
create CRUD Create form.

In db.py:

db.define_table('conta_corrente',
    Field('conta_corrente_pai','reference conta_corrente',
label=T('Conta Corrente Pai')),
    Field('descricao','string', length=255, default='',
requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db,
'conta_corrente.descricao')], unique=True, label=T('Descrição')),
    Field('tipo','string', length=15, default='Débito',
requires=IS_IN_SET(['Deb', 'Cred']), label=T('Débito/Crédito')),
    Field('totalizadora','string', length=15, default='Não',
requires=IS_IN_SET(['Sim', 'Não']), label=T('Conta Totalizadora')),
    Field('saldo','double', default='0.00',
requires=[LOCALIZE_FLOAT(T('.')),IS_FLOAT_IN_RANGE(0,100000)],
label=T('Saldo Atual da Conta')))
conta_corrente_labels={'conta_corrente.id':T('Código'),'conta_corrente.conta_corrente_pai':T('Conta
Corrente
Pai'),'conta_corrente.descricao':T('Descrição'),'conta_corrente.tipo':T('Tipo'),'conta_corrente.totalizadora':T('Conta
Totalizadora'),'conta_corrente.saldo':T('Saldo Atual da Conta')}

db.define_table('contas_receber',
    Field('data_lancamento','date', default=now, requires=IS_DATE('%d/
%m/%Y'), label=T('Data Lançamento')),
   # Think that here is my problem....
    Field('conta_corrente_id', db.conta_corrente,
requires=IS_IN_DB(db(db.conta_corrente.tipo=='Cred'),
'conta_corrente.id', 'conta_corrente.descricao'), label=T('Conta
Corrente')),
    Field('cliente_id', db.cliente, requires=IS_NULL_OR(IS_IN_DB(db,
'cliente.id', 'cliente.alcunha')), label=T('Cliente')),
    Field('atendimento_id', db.atendimento,
requires=IS_NULL_OR(IS_IN_DB(db, 'atendimento.id', 'atendimento.id')),
label=T('Atendimento')),
    Field('atendente_id', db.atendente,
requires=IS_NULL_OR(IS_IN_DB(db, 'atendente.id',
'atendente.alcunha')), label=T('Atendente')),
    Field('vale_id', db.vale, requires=IS_NULL_OR(IS_IN_DB(db,
'vale.id', 'vale.id')), label=T('Vale')),
    Field('condicao_pagamento_id', db.condicao_pagamento,
requires=IS_IN_DB(db, 'condicao_pagamento.id',
'condicao_pagamento.descricao'), label=T('Condição de Pagamento')),
    Field('forma_pagamento_id', db.forma_pagamento,
requires=IS_IN_DB(db, 'forma_pagamento.id', 'forma_pagamento.nome'),
label=T('Forma de Pagamento')),
    Field('detalhe_forma_pagamento','text', requires=IS_NOT_EMPTY(),
widget=advanced_editor, label=T('Detalhe da Forma de Pagamento')),
    Field('qtde_parcelas','integer', default=0, label=T('Qtde
Parcelas')),
    Field('parcela_numero','integer', default=0, label=T('Parcela
Número')),
    Field('valor','double', default='0.00',
requires=[LOCALIZE_FLOAT(T('.')),IS_FLOAT_IN_RANGE(0,100000)],
label=T('Valor')),
    Field('data_vencimento','date', default=now, requires=IS_DATE('%d/
%m/%Y'), label=T('Data Vencimento')),
    Field('data_recebimento','date', requires=IS_NULL_OR(IS_DATE('%d/
%m/%Y')), label=T('Data Recebimento')),
    Field('observacoes','text', requires=IS_NOT_EMPTY(),
widget=advanced_editor, label=T('Observações')))

In controller:
def contas_receber_lista():
    return dict(rows = crud.select(db.contas_receber, _id='list'),
create_link = A('Novo Registro', _href=URL(r=request, f =
'contas_receber_create'), _id="create_link"))

def contas_receber():
    return dict(form=crud.update(db.contas_receber, request.args[0],
next=URL(r = request,f = 'contas_receber_lista')))

def contas_receber_create():
    return dict(form=crud.create(db.contas_receber, next=URL(r =
request,f = 'contas_receber_lista'), message=T("Registro Inserido com
Sucesso !")))

In the GAE Log viewer:
#

   1.
      05-05 09:19AM 52.963 /init/rotinas/contas_receber_create 500
1830ms 346cpu_ms 133api_cpu_ms 0kb Mozilla/5.0 (X11; U; Linux i686; en-
US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/
3.6.3,gzip(gfe)
      See details

      200.203.88.194 - - [05/May/2010:09:19:54 -0700] "GET /init/
rotinas/contas_receber_create HTTP/1.1" 500 394 "http://estetica-
plus.appspot.com/init/rotinas/contas_receber_lista" "Mozilla/5.0 (X11;
U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid)
Firefox/3.6.3,gzip(gfe)" "estetica-plus.appspot.com"

   2.
      E 05-05 09:19AM 54.787

      In FILE: /base/data/home/apps/estetica-plus/1.341725491987144384/
applications/init/controllers/rotinas.py

      Traceback (most recent call last):
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/restricted.py", line 178, in restricted
          exec ccode in environment
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
applications/init/controllers/rotinas.py:contas_receber_create", line
134, in <module>
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/globals.py", line 96, in <lambda>
          self._caller = lambda f: f()
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
applications/init/controllers/rotinas.py:contas_receber_create", line
132, in contas_receber_create
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/tools.py", line 2491, in create
          deletable=False,
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/tools.py", line 2412, in update
          formstyle=self.settings.formstyle
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/sqlhtml.py", line 686, in __init__
          inp = self.widgets.options.widget(field, default)
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/sqlhtml.py", line 187, in widget
          options = requires[0].options()
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/validators.py", line 2227, in _options
          options = self.other.options()
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/validators.py", line 385, in options
          self.build_set()
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/validators.py", line 377, in build_set
          self.dbset.select(self.dbset._db[self.ktable].ALL, **dd)
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/contrib/gql.py", line 676, in select
          (items, tablename, fields) = self._select(*fields,
**attributes)
        File "/base/data/home/apps/estetica-plus/1.341725491987144384/
gluon/contrib/gql.py", line 662, in _select
          items = items.order(order)
        File "/base/python_runtime/python_lib/versions/1/google/
appengine/ext/db/__init__.py", line 2047, in order
          raise PropertyError('Invalid property name \'%s\'' %
property)
      PropertyError: Invalid property name ''

How to solve this error ?

Reply via email to