Last month I started to do some serious updating of the code and the
first thing I did was upgrading web2py. Everything has been working
great so far, but two days ago I noticed something is wrong. I been
pulling my hair out trying to find out why the application is not
working. An hour ago i remembered that I indeed did an upgrade.
Old version is 1.65.4 and new version is the newest one.
Error message is:
File "gluon/sql.py", line 1428, in __allocate
raise Exception, "undefined record"
In paralell I´m still using the old version of the application so I
took the whole old application and copied it to an new directory. Made
a copy of the database och got the application to work. I tested that
it is working and then I applied to the new version Web2py on it (just
unzipped it and copied it on the old version). Application stopped
working.
Any ideas where to continue looking for the problem?
Kenneth
Traceback (most recent call last):
File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
File "/data/domains/live-kal.nudata.fi/applications/init/views/district/campaign.html", line 187, in <module>
{{=A(XML('+ '), T('Add new personal reward'), XML(' »'), _href=URL(r=request,c='district',f='edit_reward', args=[district.id, campaign.id]))}}
File "gluon/globals.py", line 105, in write
self.body.write(xmlescape(data))
File "gluon/html.py", line 99, in xmlescape
return data.xml()
File "gluon/sql.py", line 1433, in __getattr__
self.__allocate()
File "gluon/sql.py", line 1428, in __allocate
raise Exception, "undefined record"
Exception: undefined record
--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to web2py+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
On Apr 3, 8:49 pm, Kenneth Lundström <kenneth.t.lundst...@gmail.com>
wrote:
> Traceback (most recent call last):
> File "gluon/restricted.py", line 173, in restricted
> exec ccode in environment
> File "/data/domains/live-kal.nudata.fi/applications/init/views/district/campaign.html",
> line 187, in <module>
> {{=A(XML('+ '), T('Add new personal reward'), XML(' »'),
> _href=URL(r=request,c='district',f='edit_reward', args=[district.id,
> campaign.id]))}}
> File "gluon/globals.py", line 105, in write
> self.body.write(xmlescape(data))
> File "gluon/html.py", line 99, in xmlescape
> return data.xml()
> File "gluon/sql.py", line 1433, in __getattr__
> self.__allocate()
> File "gluon/sql.py", line 1428, in __allocate
> raise Exception, "undefined record"
> Exception: undefined record
>
> > web2py+un...@googlegroups.com<web2py%2Bunsu...@googlegroups.com>
in auth.login()
captcha = self.settings.login_captcha or self.settings.captcha
this's had a bad effect for web applications having the login form in
the index page
This made the captcha appear in that form , the thing that had a bad
effect on the style
so what I suggest is that
you can have something like
self.settings.login_captcha_enabled = False
...................
..................
captcha = self.settings.login_captcha or self.settings.captcha if
self.settings.login_captcha_enabled else None
By doing so, every body is happy
*********
Another thing is that I found in
def del_membership(self, group_id, user_id=None):
"""
revokes membership from group_id to user_id
if user_id==None than user_id is that of current logged in
user
"""
group_id = group_id or self.id_group(role)
------------------> [role is not defined]
Did you mean :
def del_membership (self, group_id=None, user_id=None, role=None) ?
The crud.update() forms doesn't display the 'record deleted message'
flash message in case of deleting records
instead it displays 'record updated'
in function update of the Crud class I suggest adding :
if form.accepts(request.post_vars, _session, formname=_formname,
onvalidation=onvalidation,
keepvalues=self.settings.keepvalues):
if form.vars.get('delete_this_record', False):
message = self.messages.record_deleted
Massimo
last night I sent you a mail about my problem with the new version,
did you get it? Just wanted to check if you got it.
Kenneth
in fact it is not working either in case of updating record or
deleting it using crud.update()