lazy tables & auth_event

59 views
Skip to first unread message

Louis Amon

unread,
Jan 11, 2015, 4:54:26 PM1/11/15
to web...@googlegroups.com
Hello,

I'm trying to optimize the performance of my website by using lazy tables.

When I do so, every feature linked with Auth breaks with the following error msg :
ProgrammingError: ('ERROR', '42703', 'column "created_on" of relation "auth_event" does not exist')

I think it is due to the logging of auth events: the lazy_tables feature should understand that this action requires the load of "auth_event" table but somehow it doesn't.


Any idea how I can solve this issue ?

Paolo Valleri

unread,
Jan 12, 2015, 3:27:15 AM1/12/15
to web...@googlegroups.com
Hi,
by default auth_event doesn't have a created_on column.
Can you provide some code to reproduce the issue?

Paolo

Louis Amon

unread,
Jan 12, 2015, 4:34:45 AM1/12/15
to web...@googlegroups.com
Indeed you are right

Thanks to your hint, I found my issue lies in the improper use of « _common_fields ».

I wanted to use it to add a few fields to all my tables except the ones generated by Auth, so I had a code like this :

auth.define_tables()
db._common_fields.append(my_fields)

I thought the sequence order would make it so that the common fields aren’t added to Auth tables but in the end my field « created_on » did get added to « auth_event » which cause this whole issue.


My solution was to remove the « _common_fields » statement and add manually the fields using table inheritance.
An alternative solution would be to disable logging in Auth : "auth.settings.logging_enabled = False »


Thank you Paolo!

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/5maEHqLqehs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages