which web2py version?
On Monday, 4 March 2013 06:46:21 UTC-6, Dmitry Mosin wrote:
>
> Hello friends!
>
>
> When I try something like this
>
> -----------------------------------------------------------------------------------------------------------------------
>
> db.define_table('m_dsc_cards_copy',
> Field('cardid','string',length=20,notnull=True,unique=True),
> migrate=False,
> fake_migrate=True,
> primarykey=['cardid']
> )
>
> db.define_table('m_dsc_clients',
> Field('cn','string'),
> Field('cardid','reference m_dsc_cards_copy.cardid',
> widget = SQLFORM.widgets.autocomplete(request,
> db.m_dsc_cards_copy, id_field=db.m_dsc_cards_copy.cardid, limitby=(0,20),
> min_length=2, keyword='_autocomplete_cardid'),
> ondelete="no action"),
> primarykey=['cn']
> )
>
>
>
> I've got an exception,
>
> -----------------------------------------------------------------------------------------------------------------------
>
> <type 'exceptions.AttributeError'> 'Table' object has no attribute
> 'tablename'
>
> Frames
> File /var/www/py/web2py/gluon/restricted.py in restricted at line 212
> File /var/www/py/web2py/applications/discount/models/db.py in <module>
> at line 57
> File /var/www/py/web2py/gluon/sqlhtml.py in __init__ at line 624
> File /var/www/py/web2py/gluon/dal.py in __getitem__ at line 8256
>
> Function argument list
> (self=<Table m_dsc_cards_copy (cardid)>, key='tablename')
>
>
> Code listing
>
> 8251.
> 8252.
> 8253.
> 8254.
> 8255.
> 8256.
>
> 8257.
> 8258.
> 8259.
> 8260.
>
> return rows[0]
> return None
> elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key,
> Key):
> return self._db(self._id == key).select(limitby=(0,1)).first()
> elif key:
> return ogetattr(self, str(key))
>
>
> def __call__(self, key=DEFAULT, **kwargs):
> for_update = kwargs.get('_for_update',False)
> if '_for_update' in kwargs: del kwargs['_for_update']
>
>
>
>
>
>
> How can I resolve that?
>
>
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.