Uploading another version to trunk. Please give it another try

On Jun 9, 1:49 am, Fran <francisb...@googlemail.com> wrote:
> On Jun 9, 1:53 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > please try revision 892
>
> Seems to fix that problem, but creates a new one:
>
> I have a table which has a parent-child hierarchy, so has a reference
> to itself:
>
> db.define_table(gis_location,
>                 db.Field('parent', 'reference gis_location'))   # This
> form of hierarchy may not work on all Databases
>
> File "C:/Bin/web2py/applications/sahana/models/03_gis.py", line 418,
> in <module>
>     db.Field('parent', 'reference gis_location'))   # This form of
> hierarchy may not work on all Databases
>   File "C:\Bin\web2py\gluon\sql.py", line 955, in define_table
>     t = self[tablename] = SQLTable(self, tablename, *fields)
>   File "C:\Bin\web2py\gluon\sql.py", line 1147, in __init__
>     raise SyntaxError, 'SQLTable: table does not exist'
> SyntaxError: SQLTable: table does not exist
>
> Many thanks,
> Fran.
>
> > Massimo
> > On Jun 8, 4:46 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > This would also break form_factory. Sorry.
> > > I know how to fix it and will do so tonight.
> > > Massimo
> > > On Jun 8, 3:02 pm, Fran <francisb...@googlemail.com> wrote:
> > > > In my model, I define a pair of reusable fields:
> > > > authorstamp = SQLTable(None, 'authorstamp',
> > > >             db.Field('created_by', db.auth_user,
> > > >                           writable=False,
> > > >                           default=session.auth.user.id if
> > > > auth.is_logged_in() else 0),
> > > >             db.Field('modified_by', db.auth_user,
> > > >                           writable=False,
> > > >                           default=session.auth.user.id if
> > > > auth.is_logged_in() else 0,
> > > >                           update=session.auth.user.id if
> > > > auth.is_logged_in() else 0)
> > > >             )
> > > > With revision 877, this breaks:
> > > > Traceback (most recent call last):
> > > >   File "C:\Bin\web2py\gluon\restricted.py", line 107, in restricted
> > > >     exec ccode in environment
> > > >   File "C:/Bin/web2py/applications/sahana/models/00_db.py", line 80,
> > > > in <module>
> > > >     update=session.auth.user.id if auth.is_logged_in() else 0)
> > > >   File "C:\Bin\web2py\gluon\sql.py", line 1142, in __init__
> > > >     if not referenced in self._db:
> > > > TypeError: argument of type 'NoneType' is not iterable
> > > > The speedups look good, but I can't see why this now breaks the 
> > > > app:http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/877
> > > > I can't also find another way of getting the same functionality :/
> > > > The reusable field is defined after 'auth' is instantiated.
> > > > Thanks,
> > > > F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to