[web2py] session[id]

2013-01-02 Thread Annet
My application is completely node ID driven. I have the following router function: def router(): if not len(request.args): redirect(URL('addressbook','index')) else: id=int(request.args(0)) account=db(db.nodeAccount.nodeID==id).select(db.nodeAccount.ALL).first()

Re: [web2py] Re: `auth.login_bare` doesn't work with Unicode?

2013-01-02 Thread Alec Taylor
Okay, thanks. How do I authenticate the remote user? Is there a slice on this? Also, OAuth2 server for web2py? On Wed, Jan 2, 2013 at 7:05 AM, Niphlod wrote: > seems a bug with python > > http://bugs.python.org/issue5285 > > > > > > On Tuesday, January 1, 2013 7:53:56 PM UTC+1, Alec Taylor wr

[web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Quick question - is this do able i.e. some tables - e.g. db = DAL('sqlite://storage.sqlite), other tables - db1 = DAL('mysql://root: ) etc, within the same application/controller/function? If so, will write up an issue we're having. TIA --

Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Alec Taylor
Yep, that's possible. Feature trivial to utilise in web2py; difficult or unimplemented with other frameworks. On Wed, Jan 2, 2013 at 8:56 PM, Simon Ashley wrote: > Quick question - is this do able i.e. some tables - e.g. db = > DAL('sqlite://storage.sqlite), other tables - db1 = DAL('mysql

[web2py] Re: Sessions lost when several servers running on diff ports

2013-01-02 Thread Chris
On Thursday, October 22, 2009 3:34:03 AM UTC-4, SergeyPo wrote: > Yes I was running two different applications, and that's what wondered > me - why different apps (actually two different python web2py > processes) affected each other. The issue may be the (internal) application name you are u

Re: [web2py] Re: `auth.login_bare` doesn't work with Unicode?

2013-01-02 Thread Niphlod
I'd say you need to convert the password to string (i.e. must not be an unicode string) as for oauth2 servers for web2py, I'm not aware of the existence of a supported app/library. --

[web2py] manipulated args in URLs

2013-01-02 Thread Annet
In my node driven application every menu item has the node ID as an argument. I am struggling with URL manipulation. Say I have a calendar controller with functions: openinghours, eventList, timetable and courseTable. User with ID 1 has access to all functions user 2 has access to openinghours

[web2py] Re: auth.wiki menugroups not working

2013-01-02 Thread Andrew W
Trunk. However, just figured it out. >From an earlier post, I added the following to models so that the wiki tables were displayed in the Database Administration; auth.wiki(resolve=False) In my controller I added return auth.wiki(render='markmin', menugroups = ['wiki-editor','wiki-author']). Th

Re: [web2py] Re: `auth.login_bare` doesn't work with Unicode?

2013-01-02 Thread Alec Taylor
On Wed, Jan 2, 2013 at 9:30 PM, Niphlod wrote: > I'd say you need to convert the password to string (i.e. must not be an > unicode string) > > as for oauth2 servers for web2py, I'm not aware of the existence of a > supported app/library. > Will write a thread on it with the dev list later tonigh

[web2py] `@request.restful()` giving errors

2013-01-02 Thread Alec Taylor
I have this simple controller: @request.restful()def fevent(): def GET(*args, **kwargs): print 'hello' print 'args =', args print 'kwargs =', kwargs return dict(foo='foo') But it doesn't work, not even locally. Nothing except link to its ticket appears in my c

Re: [web2py] import numpy and scipy slows function return

2013-01-02 Thread lucas
ok, so you got me thinking about import in the way of models, modules, and controllers. where does packages fit into that scheme? anyway, reading sort of confused me more. what is the defined functionality of a model, module, controller, and package in the python scheme of things? do you ha

Re: [web2py] How to restrict choices in an OPTIONS widget based on values in that row or the default value

2013-01-02 Thread Vinicius Assef
Ajax will help you. You need to load countries HTML OPTION's when continent changes. On Wed, Jan 2, 2013 at 3:26 AM, Calvin wrote: > Say I have a look-up tables as follows: > > db.define_table('continent', >Field('name') > ) > > > db.define_table('country', >Field('name'), >Field('

Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Ok then, should this work? (Version 2.3.2 (2012-12-17 15:03:30) stable, source, nightly build, from 12/31) *Connection* db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) db1 = DAL('mysql://root:www@localhost:3306/xxx', migrate=True, fake_migrate= False, check_reserved=['commo

[web2py] Re: `@request.restful()` giving errors

2013-01-02 Thread DenesL
Hi Alec, you are missing the return at the end of the function (additional to the one in the GET), e.g. return locals() at the very end. Denes On Wednesday, January 2, 2013 6:28:29 AM UTC-5, Alec Taylor wrote: > > I have this simple controller: > > @request.restful()def fevent(): > def GE

[web2py] Re: parse_as_rest queries

2013-01-02 Thread DenesL
^bump^ --

[web2py] Unique Constraint not working for : Field(type='upload', unique=True)

2013-01-02 Thread François Delpierre
Hi, The unique constraint is not working in the following Field definition. Field('f_xlsfile', type='upload', notnull=True, requires=[ IS_UPLOAD_FILENAME(extension='^xlsx?$', error_message='Please post .xls or .xlsx Excel files only.'),

Re: [web2py] Re: `@request.restful()` giving errors

2013-01-02 Thread Alec Taylor
Ahh, silly me. This is why I shouldn't code so late (early)! Thanks On Thu, Jan 3, 2013 at 1:13 AM, DenesL wrote: > Hi Alec, > > you are missing the return at the end of the function (additional to the > one in the GET), e.g. > > return locals() > > at the very end. > > Denes > > > On Wednesda

[web2py] Re: replacing plugin_wiki with auth.wiki

2013-01-02 Thread Alan Etkin
On Wednesday, January 2, 2013 1:44:39 AM UTC-3, Adi wrote: > > Thanks Alan for your help. > > Have two more questions related to this: > > Maybe in the view you can do something like: {{=DIV(MARKMIN(mm), _id="videoframe"))}} An then use CSS for adding the size to the content div#videoframe{

Re: [web2py] Unique Constraint not working for : Field(type='upload', unique=True)

2013-01-02 Thread Mariano Reingart
Hi François: Could you send us an example of two records where the unique constraint is not working with upload fields? What are you expecting? IIRC, there are some parameters for Field so you can handle the file name uniqueness, but generally that is not a good idea as other users could be uplo

[web2py] nothing happens after custom form submission

2013-01-02 Thread ajith c t
This is my form and controller function. My problem is nothing happens (redirection) after the register button is clicked. def myregister(): "select all roles greater than 1. root is always 1 " print "in myregister" form = auth.register(next='index') print f

[web2py] Re: session[id]

2013-01-02 Thread Massimo Di Pierro
It is not clear to me what you are storing in session. This: id=int(request.args(0)) account=db(db.nodeAccount.nodeID==id).select(db.nodeAccount.ALL).first() ... session[id] looks like a security vulnerability to me. Every user can access any record of the table and add to the c

[web2py] Re: parse_as_rest queries

2013-01-02 Thread Massimo Di Pierro
I think this can be implemented. Will try later today. On Monday, 31 December 2012 11:30:34 UTC-6, DenesL wrote: > > +1 for an extended syntax instead of routes. > > Blog post about http://blog.2partsmagic.com/restful-uri-design/ which > discusses some schemes (about halfway down, with the title

[web2py] Re: auth.wiki menugroups not working

2013-01-02 Thread Alan Etkin
El miércoles, 2 de enero de 2013 07:38:04 UTC-3, Andrew W escribió: > Trunk. > However, just figured it out. > From an earlier post, I added the following to models so that the wiki > tables were displayed in the Database Administration; > auth.wiki(resolve=False) > >> This is probably because au

[web2py] How to install a layout plugin from web2py.com/layouts

2013-01-02 Thread sasogeek
I've seen a couple of layouts from web2py.com/layouts i want to try out but i don't know how to install them, i click on the get link and it downloads a .w2p file which i'm not sure what to do with... :/ help... --

Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Alec Taylor
On Wed, Jan 2, 2013 at 10:53 PM, Simon Ashley wrote: > Ok then, should this work? > (Version 2.3.2 (2012-12-17 15:03:30) stable, source, nightly build, from > 12/31) > > *Connection* > db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) > db1 = DAL('mysql://root:www@localhost:3

Re: [web2py] How to install a layout plugin from web2py.com/layouts

2013-01-02 Thread Vinicius Assef
See this: http://web2py.com/books/default/chapter/29/12#Layout-plugins On Wed, Jan 2, 2013 at 3:01 PM, sasogeek wrote: > I've seen a couple of layouts from web2py.com/layouts i want to try out but > i don't know how to install them, i click on the get link and it downloads a > .w2p file which i'

Re: [web2py] How to install a layout plugin from web2py.com/layouts

2013-01-02 Thread sasogeek
thanks :) On Wednesday, 2 January 2013 17:50:43 UTC, viniciusban wrote: > > See this: http://web2py.com/books/default/chapter/29/12#Layout-plugins > > > On Wed, Jan 2, 2013 at 3:01 PM, sasogeek > > wrote: > > I've seen a couple of layouts from web2py.com/layouts i want to try out > but > > i

[web2py] Re: selecting items in a database table based on keywords in another database table

2013-01-02 Thread DenesL
If you don't want duplicates then change rows = rows & rr to rows = rows | rr Denes On Wednesday, January 2, 2013 12:31:15 AM UTC-5, sasogeek wrote: > > It's working... somewhat, but how do i remove duplicates? --

[web2py] Re: replacing plugin_wiki with auth.wiki

2013-01-02 Thread Adi
Thanks Alan again, but it seems to me that height of iframe can be controlled only when creating it in protolinks_simple(). Changing width worked fine. Would we be able to extend protolinks_simple to accept the width and height as parameters to control the size of iframe? I don't know the bigg

[web2py] Re: registration field not accessible from appadmin to edit

2013-01-02 Thread Alan Etkin
> I can see it as a field listed under db.auth_user but when the >record is selected, that is not a field that shows up in the appadmin form. >What do I need to fix or look at so that this becomes an editable field? Somewhere the field is being set as writable=False. I'd try explicitly changing

[web2py] Re: web2py and redis queue

2013-01-02 Thread Niphlod
tried with python-rq before and as much as I like it (if you can bear the limitations) I can't get any function that is defined in models to be executed. Guess it's something related to web2py's execution environment.. if you're going to use mail.send then it's ok, but what if you must enq

[web2py] Searching in the database

2013-01-02 Thread Wonton
Hello, I have a problem looking for rows in my database. I have a method like this: def getBoughtItems(): for item in self.allItems: _itemId = item['itemId'] rowsItems = self.db(self.db.tableItems.itemId==_itemId) if rowsItems.count() > 0:

[web2py] Re: Unique Constraint not working for : Field(type='upload', unique=True)

2013-01-02 Thread DenesL
Hi Francois, if I understand correctly you want to avoid duplicated file names. In this case unique=True is useless because web2py renames the file with a random UUID, and the renamed filename is stored in the field. But in the following example I created a validator that checks the uploading f

[web2py] routes_in not responding

2013-01-02 Thread pumplerod
for an api that is accessing my site I need to have a crossdomain.xml file at the root level so I created a redirect for it in routes.py but it doesn't seem to work. Do I have the syntax correct? This is my routes.py file... (if I go to http://myUrl/dispatch/static/crossdomain.xml everything

[web2py] Re: Solution for ORA-00932: inconsistent datatypes: expected - got CLOB

2013-01-02 Thread Bill Thayer
Another case: format=lambda row: '{} {}'.format(row.thickness, row.material) will throws the Oracle Error. format='%(thickness)s %(material)s', will not throw the error --

[web2py] Re: registration field not accessible from appadmin to edit

2013-01-02 Thread greaneym
Thank you, Alan, your solution does make the field editable by appadmin. But I found that I was having some other problems with the appadmin that I had copied from the welcome app. So I copied the appadmin.py from a different app and when I did a diff, it was very different, and this other co

Re: [web2py] Re: web2py and redis queue

2013-01-02 Thread Bruno Rocha
yes, but for me it is not a problem since all my functions lives in modules. But, I have one solution for this problem, I created a plugin_rq.py which is a module and it has a class Queue and the enqueue method which works good for functions defined in models. Also I am implementing the monitorin

Re: [web2py] Multiple connections/ databases with same app

2013-01-02 Thread Simon Ashley
Sorry Alec, I saw that just as posted it and tried to delete it. It came through again afterwards. This wasn't the issue, just an example returning the same error. Solved it ... was in the query=db() statements, which should have been changed to query=db1() etc. Thanks for your reply.

[web2py] scgihandler with LOGGING broken?

2013-01-02 Thread sunny
Hi, I get the following error when I try to run scgihandler with LOGGING enabled. Is this a known problem? Ciao, Sven neo:/var/www/web2py# python scgihandler.py Traceback (most recent call last): File "/var/www/web2py/scgihandler.py", line 75, in SCGIServer(application, port=4000).enable

[web2py] Re: Searching in the database

2013-01-02 Thread Wonton
Sorry for answering myself, but I think I've found the solution after a long search. My problem was use "and" instead of "&" in the query conditions. With the &, everything goes well now. On Wednesday, January 2, 2013 9:57:51 PM UTC+1, Wonton wrote: > > Hello, > > I have a problem looking for ro

[web2py] insert image from filesystem into database on GAE

2013-01-02 Thread Bas Ti
Hello, I have the following problem: db.auth_user.insert( ... image = open('./sebastian.jpg', 'rb') does work locally using a mysql database. But if I run it on GAE the image does not exist on the server

[web2py] csv import crashes on GAE

2013-01-02 Thread Bas Ti
importing a csv on GAE (including image blobs) fails on GAE: Traceback (most recent call last): File "/base/data/home/apps/s~cambeoserver/1.364313602794800132/gluon/restricted.py", line 212, in restricted exec ccode in environment File "/base/data/home/apps/s~cambeoserver/1.364313602794

[web2py] Re: insert image from filesystem into database on GAE

2013-01-02 Thread Massimo Di Pierro
Not sure I understand. Is the file ./sebastian.jpg there on GAE or not? On Wednesday, 2 January 2013 18:16:38 UTC-6, Bas Ti wrote: > > Hello, > I have the following problem: > > db.auth_user.insert( > ... > image = open('./sebastian.jpg',

[web2py] Re: csv import crashes on GAE

2013-01-02 Thread Massimo Di Pierro
I think you have a buggy appadmin.py (perhaps from a previous trunk version). Copy a new appadmin.py and appadmin.html from the latest welcome to the app that gives you the problem. On Wednesday, 2 January 2013 18:58:22 UTC-6, Bas Ti wrote: > > importing a csv on GAE (including image blobs) fail

[web2py] Re: csv import crashes on GAE

2013-01-02 Thread Bas Ti
thank you, that worked :) --

Re: [web2py] Interesting - Brython (python to javascript)

2013-01-02 Thread Bruno Rocha
Looks like PyJaCo works much better, even supporting classes. http://pyjaco.org/demo --