Hi, about two moth ago I couldn't access the Database administration for
some reason I can not find this topic anymore. Well the problem was that I
had defined a variable in the left and in the right sidebar. (only one
sidebar was turned on) the default controler didn't care but the appadmin
controler didn't liked that at all. Yesterday I had the same problem again
(couldn't access the Database Administation). This time for some weird
reason the appadmin didn't like this in my sidebar:
{{imglist=db().select(db.Images.ALL, orderby=~db.Images.Submitted, limitby=(
0,6))}}
where the default controler works without a problem. Since the error
messages are not in the least bit helpfull (error somewhere in restricted
database object is no string...) I thought I post it here again. I solved
it with moving that line to the contolers(appadmin and default)
The first time it took quite some time to solve it. And Massimo Di Pierro
asked for my application to have a look at it. At least in my opinion this
is a problem with the framework itself.
I'm running the latest stable version of web2py
(Transcript from my mail account of the topic I started last time)
Hi,
I got a big problem I can't use the databaseadministration of my website
anymore. I cecked previous versions and two versions ago it works without a
problem. The funny thing is the db.py files are exactly the same I changed
nothing in the database mainly in views but I would hate to work from my
old version and change it all over again to find the error.
Thats the error message:
Traceback (most recent call last):
File "F:\Website\web2py\gluon\restricted.py", line 212, in restricted
exec ccode in environment
File "F:/Website/web2py/applications/1101/views/appadmin.html"
<http://127.0.0.1:8000/admin/default/edit/1101/views/appadmin.html>, line 450,
in <module>
AttributeError: 'str' object has no attribute 'Article'
Arows=db(db.Article).select(orderby=~db.Article.Submitted, limitby=(0,3))
but I didn't change anything in appadmin ristricted or the database. And
the line in question is ordering something by a date not a str. Is there
any quick fix?
Massimo Di Pierro
11/19/12
to web2py
Somewhere you are redefining db to be a string. Try print db at the top od
your controller.
BlueShadow
If I do that I get the following: <DAL uri="sqlite://storage.sqlite"> in
the ...
11/28/12
Massimo Di Pierro
11/28/12
to web2py
As i said before... somewhere in one of your model files you re-define the
variable db as a string.
On Wednesday, 28 November 2012 05:32:30 UTC-6, BlueShadow wrote:
> If I do that I get the following:
> <DAL uri="sqlite://storage.sqlite">
> in the console.
> and I can open all other sites which are in the default controler. and
> those use the Article table quite frequently.
--
BlueShadow
well I just checked your theorie using kdiff to compare the model and the
con...
11/28/12
Massimo Di Pierro
11/29/12
to web2py
create a model called zzz.py (so it gets executed last) and in it put:
print db, type(db)
now call your appadmin or any action. What does it print?
--
Massimo DiPierro
11/30/12
to me
Can you send me your entire app (w2p)? Confidentially of course.
--