Going into, design and clicking on "database administration"

Bug #344665 reported by jeffield
6
Affects Status Importance Assigned to Milestone
web2py-wiki
Incomplete
Undecided
Unassigned

Bug Description

Going into, design and clicking on "database administration"
  generates a error. ( I am trying to track it down now.)
  Error traceback
  Traceback (most recent call last):
  File "/home/jds/web2py.1.58/gluon/restricted.py", line 98, in
restricted
    exec ccode in environment
  File "/home/jds/web2py.1.58/applications/web2py_wiki/views/
appadmin.html", line 146, in <module>
  AttributeError: 'str' object has no attribute 'tag'
  -- snip --
  for tag in db(db.tag.id>0).select(orderby=db.tag.name):
    response.write('\n',escape=False)
    response.write(LI(A(tag.name,_href=URL
(r=request,f='pages_by_tag',args=tag.id))))
    response.write('\n',escape=False)
    pass

------------------------------------------------------------------------------------------
> Check your sql.log - did the database get made?
yep, got the log.
and also did
$ sqlite3 storage.db
.tables
verified that all of the tables are there.
--------------------------------------------------------
auth_event auth_permission document
auth_group auth_user page
auth_membership comment tag
----------------------------------------------------------
From looking @ the code. I was thinking the same
thing... maybe the tables were not there or correct.
I can "select * from <db>", in all of the tables using
the sqlite interface directly.

>>probably some catch if there is no db's or no connections would be helpful...

there is a catch in the appadmin.html view for "no databases"

Note: If I take out line 15 - 23 of web2py_wiki/views/appadmin.html
the page will load.

Revision history for this message
yarko (yarkot) wrote :

Can anyone else reproduce this?

WIth a new wiki, and a new web2py I do not see this.

Let's determine where this problem is. Debug and trace - something is not set, let's determine why.

Changed in web2py-wiki:
status: New → Incomplete
Revision history for this message
Andre (andre-vandervlies) wrote :

Yes I can, web2py 1.61.4, latest wiki...

Traceback (most recent call last):
  File "/home/andre/Src/web2py-1.61.4/gluon/restricted.py", line 98, in restricted
    exec ccode in environment
  File "/home/andre/Src/web2py-1.61.4/applications/wiki/views/appadmin.html", line 146, in <module>
AttributeError: 'str' object has no attribute 'tag'

Revision history for this message
Andre (andre-vandervlies) wrote :

I believe this is wrong:
    db.Field('tags', 'text'), db.py, line 44

Shouldn't that be something like:
    db.Field('tags', db.tag),

Revision history for this message
Andre (andre-vandervlies) wrote :

Removed this block in layout.html (lines 72-77):

{{for tag in db(db.tag.id>0).select(orderby=db.tag.name):}}
{{=LI(A(tag.name,_href=URL(r=request,f='pages_by_tag',args=tag.id)))}}
{{pass}}
{{if auth.has_membership(auth.id_group('developer')):}}
{{=LI(A('[manage tags]',_href=URL(r=request,f='tags')))}}
{{pass}}

Can do "database administration" now....

Revision history for this message
Massimo (mdipierro) wrote : Re: [Bug 344665] Re: Going into, design and clicking on "database administration"

No that is correct because tags as stored as strings not as one to
many references.

On Apr 26, 2009, at 3:59 AM, Andre wrote:

> I believe this is wrong:
> db.Field('tags', 'text'), db.py, line 44
>
> Shouldn't that be something like:
> db.Field('tags', db.tag),
>
> --
> Going into, design and clicking on "database administration"
> https://bugs.launchpad.net/bugs/344665
> You received this bug notification because you are the registrant for
> web2py-wiki.
>
> Status in web2py_-wiki: Incomplete
>
> Bug description:
> Going into, design and clicking on "database administration"
> generates a error. ( I am trying to track it down now.)
> Error traceback
> Traceback (most recent call last):
> File "/home/jds/web2py.1.58/gluon/restricted.py", line 98, in
> restricted
> exec ccode in environment
> File "/home/jds/web2py.1.58/applications/web2py_wiki/views/
> appadmin.html", line 146, in <module>
> AttributeError: 'str' object has no attribute 'tag'
> -- snip --
> for tag in db(db.tag.id>0).select(orderby=db.tag.name):
> response.write('\n',escape=False)
> response.write(LI(A(tag.name,_href=URL
> (r=request,f='pages_by_tag',args=tag.id))))
> response.write('\n',escape=False)
> pass
>
> ------------------------------------------------------------------------------------------
>> Check your sql.log - did the database get made?
> yep, got the log.
> and also did
> $ sqlite3 storage.db
> .tables
> verified that all of the tables are there.
> --------------------------------------------------------
> auth_event auth_permission document
> auth_group auth_user page
> auth_membership comment tag
> ----------------------------------------------------------
>> From looking @ the code. I was thinking the same
> thing... maybe the tables were not there or correct.
> I can "select * from <db>", in all of the tables using
> the sqlite interface directly.
>
>>> probably some catch if there is no db's or no connections would be
>>> helpful...
>
> there is a catch in the appadmin.html view for "no databases"
>
> Note: If I take out line 15 - 23 of web2py_wiki/views/appadmin.html
> the page will load.

Revision history for this message
Andre (andre-vandervlies) wrote :

Hmmm.....
Removing this block:
  {{for tag in db(db.tag.id>0).select(orderby=db.tag.name):}}
    {{=LI(A(tag.name,_href=URL(r=request,f='pages_by_tag',args=tag.id)))}}
  {{pass}}
enables "database administration" but removes
the 'Tag list' from the wiki....

The db(...).select(...) construct seems to be unkown in this scope...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.