auth.wiki usage

653 views
Skip to first unread message

guruyaya

unread,
Sep 21, 2012, 8:44:13 PM9/21/12
to web...@googlegroups.com
I'm trying to figure out how to use the built in auth.wiki feature. 
I read the markmin syntax allows expending the syntax using the "extra" tag. Is there a way to implement it in auth.wiki? where should the de of the extra functionality be?

Is there a guide containing all options for this feature?

Thanks in advance
Yair 

Bill Thayer

unread,
Oct 12, 2012, 4:48:11 PM10/12/12
to web...@googlegroups.com
I'm just starting down the same road so I hope you found success or at least some resources.

So far I've had to manually add the tables found in tools.py to Oracle.

From here it looks like I might need:



from gluon.tools import Auth, Crud, Service, PluginManager, prettydate, Wiki
auth
= Auth(db)
crud
, service, plugins = Crud(db), Service(), PluginManager()
wiki
= Wiki(auth=auth, render='html')
or perhaps I'll put it after

auth
.define_tables(username=True, migrate=False)

I'll keep you posted.

-Bill

Bill Thayer

unread,
Oct 12, 2012, 5:47:10 PM10/12/12
to web...@googlegroups.com
I applied the patch to gluon tools (basically just give the Wiki.__init__(...,render=None,...) a default value of 'markmin' instead of None to remove the first error. Now I need to add an upload field to wiki_media but this does not work:



media
=db.tables(db.wiki_media)
media
.fields.append(Field('filedata', 'blob'))
media
.filedata.represent = lambda value,row: \
    A
('get it', _href=URL('download', args=value))
db
.wiki_media.filename.uploadfield='filedata'





Alan Etkin

unread,
Oct 12, 2012, 6:08:18 PM10/12/12
to web...@googlegroups.com
¿What error do you get?

To force the wiki class to define the tables before serving the wiki pages (so you can customize them) you must add something like this to the model

auth.wiki(resolve=False)

Bill Thayer

unread,
Oct 13, 2012, 11:21:17 PM10/13/12
to web...@googlegroups.com
Hello Allen,

my code looks like:
from gluon import DAL
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate, Wiki
auth
= Auth(db)
crud
, service, plugins = Crud(db), Service(), PluginManager()
## create all tables needed by auth if not custom tables
auth
.define_tables(username=True, migrate=False)
auth
.wiki(resolve=False)
.
.
.


media
=db.wiki_media
media
.fields.append(Field('filedata', 'blob'))

media
.filedata.represent = lambda value,row: \
    A
('get it', _href=URL('download', args=value))
db
.wiki_media.filename.uploadfield='filedata'
And produces the error:
Traceback (most recent call last):
 
File "C:\web2py\gluon\restricted.py", line 209, in restricted
   
exec ccode in environment
 
File "C:/web2py/applications/TAMOTO/models/db.py", line 103, in <module>
   
media.filedata.represent = lambda value,row: \
 
File "C:\web2py\gluon\dal.py", line 7626, in __getitem__
   
return ogetattr(self, str(key))
AttributeError: 'Table' object has no attribute 'filedata'
So I think I'm close. Just not aware of how to add that field yet.

-Bill

Alan Etkin

unread,
Oct 14, 2012, 9:49:08 AM10/14/12
to web...@googlegroups.com
AttributeError: 'Table' object has no attribute 'filedata'
So I think I'm close. Just not aware of how to add that field yet.


I didn't expect you wanted to add a field to the table after calling .define_table. AFAIK that is not possible. However, you could still use virtual fields, which can be added after auth.wiki(...), although you would need to link the the wiki record id to an auxiliar table (i.e. wiki_filedata).

As an enhancement to the wiki built-in feature, auth.wiki() could support extra fields as Auth does with auth_ tables.

# before auth.wiki()
auth
.settings.extra_fields["wiki_page"] = [Field("filedata", "blob"),]

It would be easy to patch tools.py to accept that input

Alan Etkin

unread,
Oct 14, 2012, 10:43:03 AM10/14/12
to web...@googlegroups.com
I didn't expect you wanted to add a field to the table after calling .,,
 
I opened an issue in the project page

http://code.google.com/p/web2py/issues/detail?id=1087

Bill Thayer

unread,
Oct 14, 2012, 1:17:57 PM10/14/12
to web...@googlegroups.com
Thank you. I voted for it.

Bill Thayer

unread,
Oct 14, 2012, 3:23:40 PM10/14/12
to
I tried your patch but the tables were not defined. Is my db.py code correct? The commented out code causes an error<type 'exceptions.AttributeError'>('DAL' object has no attribute 'wiki_media') but when commented out the appadmin displays all the tables except the wiki_ tables.

from gluon import DAL
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate, Wiki
auth
= Auth(db)
crud
, service, plugins = Crud(db), Service(), PluginManager()
## create all tables needed by auth if not custom tables

auth
.settings.extra_fields['auth_user']= [
 
Field('business_unit', length=15),
 
Field('default_charge_number', length=15),
 
Field('location', length=15),
 
Field('phone', length=12)]
auth
.settings.extra_fields["wiki_media"] = [Field("filedata", "blob"),]
auth
.define_tables(username=True, migrate=False)
#
# db.wiki_media.filename.uploadfield='filedata'
# db.wiki_page.filedata.represent = lambda value,row: \
   
# A('get it', _href=URL('download', args=value))


Alan Etkin

unread,
Oct 14, 2012, 5:06:09 PM10/14/12
to web...@googlegroups.com
El domingo, 14 de octubre de 2012 15:56:05 UTC-3, Bill Thayer escribió:
I tried your patch but the tables were not defined. Is my db.py code correct? The commented out code causes an error<type 'exceptions.AttributeError'>('DAL' object has no attribute 'wiki_media') but when commented out the appadmin displays all the tables except the wiki_ tables.

I think this command is missing:

# after  auth.settings.extra_fields ...
auth.wiki(resolve=False)

Without that line, the tables will not be available within the controller or the model

Bill Thayer

unread,
Oct 14, 2012, 7:06:45 PM10/14/12
to
Cool! The wiki_ tables are now visible in the app admin pages! [EDIT-My app does still produce the AttributeError posted in response below]

However, the login page will not login any users, I can not register a new user and cannot create or edit users from app admin although the auth_ tables are all visible. In fact I just tried to create a record for a completely different table and it would not create it.

I think my db connection is OK since I did fix 2 web2py errors by creating 2 missing columns in SQL Developer and corrected ora errors 'Table does not have attribute 'WIKI_PAGE'.'HTML' & 'WIKI_MEDIA'.'IS_ACTIVE'. Those columns were missing when I manually created the Oracle wiki_ tables.

Thank you for your help. My spirits are getting better now. Just need to figure out why my auth_tables are accessible.

Regards,
Bill

Bill Thayer

unread,
Oct 14, 2012, 6:56:12 PM10/14/12
to web...@googlegroups.com
Hmmm. These lines do not work so I'm unsure where to insert them.


db
.wiki_media.filename.uploadfield='filedata'
db
.wiki_page.filedata.represent = lambda value,row: \

    A
('get it', _href=URL('download', args=value))
Here's the error as usual.
Traceback (most recent call last):
 
File "C:\web2py\gluon\restricted.py", line 209, in restricted
   
exec ccode in
environment
 
File "C:/web2py/applications/TAMOTO/models/db.py", line 68, in <module>
   
db.wiki_page.filedata.represent = lambda value,row: \

 
File "C:\web2py\gluon\dal.py", line 7626, in __getitem__
   
return ogetattr(self, str(key))
AttributeError: 'Table' object has no attribute 'filedata'
The code now looks like:
 db = DAL(settings.database_uri, check_reserved=['oracle'], migrate_enabled=False, fake_migrate_all=True)
    session
.secure()
    session
.connect(request, response, db)
.
.
.

from gluon import DAL
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate, Wiki
auth
= Auth(db)
crud
, service, plugins = Crud(db), Service(), PluginManager()
## create all tables needed by auth if not custom tables

auth
.settings.extra_fields['auth_user']= [
 
Field('business_unit', length=15),
 
Field('default_charge_number', length=15),
 
Field('location', length=15),
 
Field('phone', length=12)]

auth
.settings.extra_fields["wiki_media"] = [Field("filedata", "blob"),]


auth
.wiki(resolve=False)
db
.wiki_media.filename.uploadfield='filedata'
db
.wiki_page.filedata.represent = lambda value,row: \

    A
('get it', _href=URL('download', args=value))


auth
.define_tables(username=True, migrate=False, fake_migrate=True)
.
.
.

Alan Etkin

unread,
Oct 14, 2012, 7:07:33 PM10/14/12
to web...@googlegroups.com
> Hmmm. These lines do not work so I'm unsure where to insert them.

I wonder if you shouldn't call .define_tables() before calling auth.wiki(), there could be need of configuring auth tables before creating the wiki tables.

Bill Thayer

unread,
Oct 14, 2012, 7:45:25 PM10/14/12
to web...@googlegroups.com
#code now looks like this, put the represent= inside the
# call to extra_fileds
.
.
.
auth
.settings.extra_fields["wiki_media"] = [
   
Field("filedata", "blob",
           represent
= lambda value,row: \
    A
('get it', _href=URL('download', args=value))),]


auth
.define_tables(username=True, migrate=False, fake_migrate=True)
auth
.wiki(resolve=False)
db
.wiki_media.filename.uploadfield='filedata'
Made 2 changes but don't know which one fixed the AtributeError. Hard to tell if the filedata blob field is working because
i order to test it I need to log in but my ability to log in or create a user is still not working.

Alan Etkin

unread,
Oct 14, 2012, 7:59:09 PM10/14/12
to web...@googlegroups.com
> Made 2 changes but don't know which one fixed the AtributeError. Hard to tell if the filedata blob field is working because

I doubt it has something to do with the changes in the patch to tools.py. I have created a scaffolding app with the default Sqlite connection that extends the wiki_page table with extra fields, list the wiki tables in appadmin and does auth_user crud without issues.

What is the output if you submit an auth_user create form? Does web2py return any error traceback or anything?

Bill Thayer

unread,
Oct 14, 2012, 8:59:18 PM10/14/12
to web...@googlegroups.com
the index displays the login page but after logging in returns the login page without logging in the user (user is in db)
editing the user from auth_user edit user page returns the edit user page without committing the changes.
registering a new user or adding one from auth_user simply returns the same page without creating the user.


I thought I would try using the sqllite db like you did. The error said that auth user tables were not created so I cleared my session information, editited

auth.define_tables(username=True, migrate=True) #set migrate=True

 and re-started the server...ooops....not good.

Traceback (most recent call last):
 
File "C:\web2py\gluon\restricted.py", line 209, in restricted
   
exec ccode in
environment
 
File "C:/web2py/applications/TAMOTO/models/db.py", line 70, in <module>
   
auth.wiki(resolve=False)
 
File "C:\web2py\gluon\tools.py", line 3192, in wiki
    env
=env)
 
File "C:\web2py\gluon\tools.py", line 4597, in __init__
    args
.append(field)
UnboundLocalError: local variable 'args' referenced before assignment

Alan Etkin

unread,
Oct 15, 2012, 6:38:11 AM10/15/12
to web...@googlegroups.com
the index displays the login page but after logging in returns the login page without logging in the user (user is in db)
 
This is strange. Perhaps Massimo will have to revert the change until we find what is causing the error. Some observations:

-I tested the changes with Ubuntu GNU/Linux with rocket server, not under Windows
-In your tools.py module, the error is detected at line 4597. In my system (updated from trunk), that instruction is at line 4637
-The error message has no sense to me, since in the patch, the local variable is actually refered after assignment, not before.

Bill Thayer

unread,
Oct 15, 2012, 5:06:59 PM10/15/12
to
Thought I'd start over with a brand new application & get the wiki working but I am running into difficulty before I even get to the wiki part.
I created a brand new app and started by moving my 0.py file into models then edited db.py like so:


if not request.env.web2py_runtime_gae:
   
## if NOT running on Google App Engine use SQLite or other DB
    db
= DAL(settings.database_uri, check_reserved=['oracle'])    
   
## store sessions and tickets there
    session
.connect(request, response, db=db, migrate='db.web2py_session_tamoto')
else:
.
.
.



## create all tables needed by auth if not custom tables

auth
.define_tables(username=True, signature=False, migrate=False)



Of course I get an Oracle Error:

Traceback (most recent call last):

 
File "C:\web2py_src_2.1.1\web2py\gluon\restricted.py", line 209, in restricted
 
exec ccode in environment
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/models/db.py", line 16, in <module>
 session
.connect(request, response, db=db, migrate='db.web2py_session_tamoto')
 
File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 581, in connect
 migrate
=table_migrate,
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7092, in define_table
 table
= self.lazy_define_table(tablename,*fields,**args)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7124, in lazy_define_table
 polymodel
=polymodel)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 920, in create_table
 
self.create_sequence_and_triggers(query,table)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2865, in create_sequence_and_triggers
 
self.execute(query)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2856, in execute
 
return self.log_execute(command, args)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1687, in log_execute
 ret
= self.cursor.execute(*a, **b)
DatabaseError: ORA-00955: name is already used by an existing object


Thought I might give writing a patch a try so I tried catching and ignoring the exception in the OracleAdaptor but it does not work.

After setting migrate_enabled to False:
 db = DAL(settings.database_uri, check_reserved=['oracle'], migrate_enabled=False)


I get this error:
Traceback (most recent call last):

 
File "C:\web2py_src_2.1.1\web2py\gluon\main.py", line 541, in wsgibase
 session
._try_store_in_db(request, response)
 
File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 670, in _try_store_in_db
 record_id
= table.insert(**dd)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7812, in insert
 
return ret
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1160, in insert
 
raise e
IntegrityError: ORA-01400: cannot insert NULL into ("UWAVEDAT"."WEB2PY_SESSION_TAMOTO"."ID")



villas

unread,
Oct 15, 2012, 5:21:24 PM10/15/12
to web...@googlegroups.com
Hi Bill

My experience is that it isn't a good idea to do experimental development on a tricky DB.  It is too easy to bite off more than you can  chew. 

You will save heaps of time by prototyping your app on Sqlite first.  Only when your data schema becomes more stable should you move over to your DB. 

In this way you can more easily differentiate between your own coding errors and any DB adaptor errors etc and this will make it quicker to learn too.

Just 2 cts, D

Massimo Di Pierro

unread,
Oct 15, 2012, 5:30:16 PM10/15/12
to web...@googlegroups.com
I am using sqlite and I tried sessions in db (again) and I cannot reproduce this problem.


On Monday, 15 October 2012 16:03:45 UTC-5, Bill Thayer wrote:
Thought I'd start over with a brand new application & get the wiki working but I am running into difficulty before I even get to the wiki part.
I created a brand new app and started by moving my 0.py file into models then edited db.py like so:


if not request.env.web2py_runtime_gae:
   
## if NOT running on Google App Engine use SQLite or other DB
    db
= DAL(settings.database_uri, check_reserved=['oracle'])    
   
## store sessions and tickets there
    session
.connect(request, response, db=db, migrate='db.web2py_session_tamoto')
else:
.
.
.


## create all tables needed by auth if not custom tables

auth
.define_tables(username=True, signature=False, migrate=False)



Of course I get an Oracle Error:
Traceback (most recent call last):

 
File "C:\web2py_src_2.1.1\web2py\gluon\restricted.py", line 209, in restricted
 
exec ccode in environment
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/models/db.py", line 16, in <module>

 session
.connect(request, response, db=db, migrate='db.web2py_session_tamoto')
 
File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 581, in connect
 migrate
=table_migrate,
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7092, in define_table
 table
= self.lazy_define_table(tablename,*fields,**args)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7124, in lazy_define_table
 polymodel
=polymodel)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 920, in create_table
 
self.create_sequence_and_triggers(query,table)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2865, in create_sequence_and_triggers
 
self.execute(query)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2856, in execute
 
return self.log_execute(command, args)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1687, in log_execute
 ret
= self.cursor.execute(*a, **b)
DatabaseError: ORA-00955: name is already used by an existing object


Thought I might give writing a patch a try so I tried catching and ignoring the exception in the OracleAdaptor but it does not work.

After setting migrate_enabled to False:
 db = DAL(settings.database_uri, check_reserved=['oracle'], migrate_enabled=False)


I get this error:
Traceback (most recent call last):

Bill Thayer

unread,
Oct 15, 2012, 6:21:26 PM10/15/12
to web...@googlegroups.com
Hi villas,

Yes I agree and did do that. My development is at  point where my tables are defined. If I go much farther into development without deploying to the test server than it is too difficult to narrow down errors so i want to focus on the basic functionality up front. With all of the errors I have I really need to nail down the migration in small steps at a time.

To simplify my final design I'd really like to use the built in wiki. I'd also like to store my file objects in the database and not in the server. So my goal is to add a blob field to the auth.wiki(). So a small incremental approach is best for me while I fight through all of the challenges.

Thanks,
Bill

Bill Thayer

unread,
Oct 15, 2012, 6:28:33 PM10/15/12
to web...@googlegroups.com
Hi Massimo.

Yes the problem is not with the sqlite. I just confirmed that it does work and the session table is in the databases folder.

My Oracle db already has the auth tables and web2py_session table defined. I suspect there is a null value for the user field since no one would be logged in when the app comes up. Somehow that is OK with SQL lite.

Here are the session variables:
Variables
 session
<Storage {'auth': None, '_user_agent': {'os': {'...ser': {'version': '15.0.1', 'name': 'Firefox'}}}>
 request
<Storage {'function': 'index', 'body': <cStringI...lications\\TAMOTO\\', 'post_vars': <Storage {}>}>
 session._try_store_in_db <bound method Session._try_store_in_db of <Stora...er'
: {'version': '15.0.1', 'name': 'Firefox'}}}>>
 response
<Storage {'body': <cStringIO.StringO object at 0...a> at 0x03FE8F30>, 'view': 'default/index.html'}>


As I mentioned earlier. This is a brand new application. No tables other than auth_ and web2py_session_ defined here yet.

-Bill

Bill Thayer

unread,
Oct 15, 2012, 7:25:00 PM10/15/12
to web...@googlegroups.com
After checking SQL developer and discovering the Triggers were not made for web2py_storage_tamoto table I recalled this post:
https://groups.google.com/d/msg/web2py/r7qMRK2Eir0/D91Ine9NMzkJ
from earlier today. That error occured at line 2865 in dal.py so the triggers never got created.

So using SQL Developer I created the trigger. Edited my connecction string to connect to Oracle and.....

...SUCCESS!!!

The session was added to the database table.

No on to the wiki stuff I hope.

Bill Thayer

unread,
Oct 16, 2012, 12:23:28 PM10/16/12
to web...@googlegroups.com
Note for future searchers & people as foolish as I am to try and use Oracle for web site backend.

This happened to me after I finally got the auth.wiki installed in my application and the application connected to Oracle. I had to manually create the wiki_page, wiki_media, and wiki_tab tables in SQLDEveloper and not web2py. My first attempt at creating a wiki page produced this error:
Traceback (most recent call last):

 
File "C:\web2py_src_2.1.1\web2py\gluon\restricted.py", line 209, in restricted
   
exec ccode in
environment
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/controllers/default.py", line 240, in <module>
 
File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 187, in <lambda>
   
self._caller = lambda f: f()
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/controllers/default.py", line 20, in index
   
return auth.wiki()
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 3227, in wiki
   
return self._wiki.read(slug)['content'] if slug else self._wiki()
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 4697, in __call__
   
return self.edit(request.args(1) or 'index')
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 4791, in edit
    formstyle
='table2cols',showid=False).process()
 
File "C:\web2py_src_2.1.1\web2py\gluon\html.py", line 2135, in process
   
self.validate(**kwargs)
 
File "C:\web2py_src_2.1.1\web2py\gluon\html.py", line 2075, in validate
   
if self.accepts(**kwargs):
 
File "C:\web2py_src_2.1.1\web2py\gluon\sqlhtml.py", line 1441, in accepts
   
self.vars.id = self.table.insert(**fields)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7808, in insert
    ret
=  self._db._adapter.insert(self,self._listify(fields))

 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1160, in insert
   
raise e
DatabaseError: ORA-04098: trigger 'UWAVEDAT.WIKI_PAGE_TRIGGER' is invalid and failed re-validation


This was caused because although I created the trigger, the trigger did not have the sequence. Oracle does not have authoincrement so you need to create a sequence.


   CREATE SEQUENCE  
"SCHEMANAME"."WIKI_PAGE_SEQUENCE"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 2001 CACHE 2000 ORDER  NOCYCLE ;



Then create your trigger:


CREATE OR REPLACE TRIGGER
"SCHEMANAME"."WIKI_PAGE_TRIGGER" BEFORE
  INSERT ON wiki_page FOR EACH ROW
BEGIN
  SELECT wiki_page_sequence
.nextval INTO :NEW.id FROM DUAL;
END;
/
ALTER TRIGGER
"SCHEMANAME"."WIKI_PAGE_TRIGGER" ENABLE;





I did not have this issue with tables created by web2py.

Regards,
Bill

Massimo Di Pierro

unread,
Oct 16, 2012, 1:20:30 PM10/16/12
to web...@googlegroups.com
On Tuesday, 16 October 2012 11:23:29 UTC-5, Bill Thayer wrote:
Note for future searchers & people as foolish as I am to try and use Oracle for web site backend.
....

I did not have this issue with tables created by web2py.

so why did you create the wiki tables manually? I am missing something.

Bill Thayer

unread,
Oct 16, 2012, 4:43:39 PM10/16/12
to web...@googlegroups.com
About 6 days ago I posted my "saga" of failed attempts to get plugin_wiki to work with oracle and to add the blob field. You told me to put return auth.wiki() in my controller and use the built in auth wiki but I needed a bit more information and Oracle was still complaining.

Alan told me to add auth.wiki(resolve=False) to my db.py file. Which eventually worked. But by that time the tables were created.

Looks like it's working as expected, even storing and retrieving the data with a blob field. So far so good except when I click on the search link for the wiki (/default/index/_search) I did get this error that I haven't yet dug into very deeply but here it is:

Traceback (most recent call last):
 
File "C:\web2py_src_2.1.1\web2py\gluon\restricted.py", line 209, in restricted
 
exec ccode in environment
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/controllers/default.py", line 240, in <module>
 
File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 187, in <lambda>
 
self._caller = lambda f: f()
 
File "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/controllers/default.py", line 20, in index
 
return auth.wiki()
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 3227, in wiki
 
return self._wiki.read(slug)['content'] if slug else self._wiki()

 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 4705, in __call__
 
return self.search()
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 4990, in search
 content
.append(self.cloud()['content'])
 
File "C:\web2py_src_2.1.1\web2py\gluon\tools.py", line 5001, in cloud
 
orderby = ~count, limitby=(0,20))
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 8790, in select
 
return adapter.select(self.query,fields,attributes)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1615, in select
 
return self._select_aux(sql,fields,attributes)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1580, in _select_aux
 
self.execute(sql)

 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2856, in execute
 
return self.log_execute(command, args)
 
File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1687, in log_execute
 ret
= self.cursor.execute(*a, **b)
DatabaseError: ORA-00904: "WIKI_TAG"."WIKI_PAGE": invalid identifier

Alan Etkin

unread,
Oct 18, 2012, 9:32:10 AM10/18/12
to web...@googlegroups.com
DatabaseError: ORA-00904: "WIKI_TAG"."WIKI_PAGE": invalid identifier


I found the connection error to be related to conflicts with field names, at least for some web Oracle related threads. The problem is that the names of the error output are table names instead.

Bill Thayer

unread,
Oct 18, 2012, 11:38:46 AM10/18/12
to web...@googlegroups.com

Oooooh. 

So that's why a reference field should not be named the same as the table it's referencing. In this case I didn't make the name but generally I do that all the time. Didn't realize that it makes error messages clearer. Duh.

-Bill
Reply all
Reply to author
Forward
0 new messages