[web2py:16831] Re: Authentication Problem !
Your example works great for me and I get the flash (bad login or perfect). Send me the whole app (perhaps something else is messing this up) but let me know in detail what the problem is. Perhaps you expect something different than I do. massimo On Feb 23, 8:15 pm, Yannick wrote: > Thanks Massimo, I appreciate your help but i think maybe i don't > understand or there is something I'm doing wrong... Here is my code > please let me know where I'm wrong because i did set > "auth.messages.invalid_login" > > auth.settings.on_failed_authorization=URL(r=request,f='error') > auth.settings.login_url=URL(r=request,f='login') > auth.messages.invalid_login= 'Bad Login' > auth.messages.logged_in = 'Perfect' > > def login(): > return dict(form=auth.login(next="profile")) > > @auth.requires_login() > def profile(): > return dict() > > You said i should set "session.flash" before redirect... Where should > I set it since the redirect is done implicitly inside tools.py... > I really want to understand how to make this work without touching > anything in the tools.py code.. > > Thanks for your attention ! > > Yannick P. > > On Feb 23, 1:34 am, mdipierro wrote: > > > Just set these: > > > auth.messages.invalid_login > > auth.messages.logged_in > > > Massimo > > > On Feb 22, 9:05 pm, Yannick wrote: > > > > Thanks Massimo and Yarko, > > > Theproblemhere is the redirect is done implicitly using the > > > decorator pattern... It is done inside the method "requires_login()" > > > of tools.py. I guess one solution should have been to put the > > > session.flash message inside the "requires_login()" BUT I'm not allow > > > to do so... > > > Do you see what i mean ? > > > > thanks ! > > > > On Feb 22, 8:21 pm, Yarko Tymciurak wrote: > > > > > yes, and set session flash in your controller (not your view); > > > > > On Feb 22, 3:32 pm, mdipierro wrote: > > > > > > I am not sure I fully understand so I give you two answers. > > > > > > A) Before redirection you should set > > > > > > session.flash="message" > > > > > > instead of > > > > > > response.flash="message" > > > > > > The former is copied in the latter automatically before redirection. > > > > > > B) The messages generated by the auth method all set session.flash > > > > > before redirection. The messages are customizable. You can find a list > > > > > in gluon.tools.py > > > > > > Massimo > > > > > > On Feb 22, 2:52 pm, Yannick wrote: > > > > > > > Oh Thanks Massimo I completely forgot about the > > > > > > "auth.settings.login_url...". > > > > > > Here my new code: > > > > > > > auth.settings.login_url=URL(r=request,f='login') > > > > > > > def login(): > > > > > > return dict(form=auth.login(next="profile")) > > > > > > > @auth.requires_login() > > > > > > def profile(): > > > > > > return dict(Welcome="Welcome") > > > > > > > How can I retrieve the response.flash() message in this case to let > > > > > > the user know that the login failed since here i recreate a new > > > > > > request and i guest the rsponse is lost... Do you have any > > > > > > forwarding > > > > > > mechanism ? > > > > > > > In the login.html file i have this: > > > > > > {{if response.flash:}}{{=response.flash}}{{pass}} > > > > > > > I guess I don't retrieve the response.flash anymore because it is > > > > > > the > > > > > > new request. > > > > > > > Do you have any idea how to print the flash message when the login > > > > > > failed based on my code? or is there any other solution more > > > > > > efficient ? > > > > > > > Thanks for your help ! > > > > > > > On Feb 22, 3:07 pm, mdipierro wrote: > > > > > > > > In your code > > > > > > > > @auth.requires_login() > > > > > > > def profile(): > > > > > > > if not auth.is_logged_in(): > > > > > > > return dict(form=auth.login(next="login")) > > > > > > > else: > > > > > > > return dict(msg="Welcome") > > > > > > > > because of > > > > > > > > @auth.requires_login() > > > > > > > > auth.is_logged_in() is always true > > > > > > > > The validator, is user is not logged in, redirects to > > > > > > > > auth.settings.login_url > > > > > > > > you can set it > > > > > > > > auth.settings.login_url=URL(r=request,f='login') > > > > > > > > Hope this answers the question. > > > > > > > > Massimo > > > > > > > > On Feb 22, 12:04 pm, Yannick wrote: > > > > > > > > > Hello mate, > > > > > > > > Here is what I have in my controller: > > > > > > > > > def login(): > > > > > > > > formlog = auth.login(next="profile") > > > > > > > > return dict(form=formlog) > > > > > > > > > @auth.requires_login(): > > > > > > > > def profile(): > > > > > > > > if not auth.is_logged_in(): > > > > > > > > return dict(form=auth.login(next="login")) > > > > > > > > else: > > > > > > > > return dict(msg="Welcome") > > > > > > > > > I have twoproblemhere: > > > > > > > > - First; here basically I'm just trying to login and if the > > > > > > > > login > > > > > > > > failed th
[web2py:16830] Re: web2py on gae - errors & questions
import datetime; now=datetime.date.today() should be import datetime; now=datetime.datetime.today() or simply now=request.now since SQLField('created_time', 'datetime', default=now) is datetime, not date. Massimo On Feb 23, 11:07 pm, Joseph Jude wrote: > Massimo, > have the below as the db.py in GAE and at the time of startup the > error throws up > > db.py > === > try: > from gluon.contrib.gql import * # if running on Google App Engine > except: > db = SQLDB('sqlite://storage.db') # if not, use SQLite or other > DB > else: > db = GQLDB() # connect to Google BigTable > session.connect(request, response, db=db) # and store sessions > there > > import datetime; now=datetime.date.today() > > db.define_table('cases', > SQLField('title'), > SQLField('created_time', 'datetime', default=now) > ) > > db.cases.insert(title='testing', created_time=now) > > ===end of db.py== > error: > > str(obj)[11:].strip().split(':')[:3]] > ValueError: invalid literal for int() with base 10: '' > > I'm using web2py: Version 1.56.2 (2009-02-08 21:49:34) > on GAE: release: "1.1.9" / timestamp: 1232676672 / api_versions: ['1'] > on kubuntu > > thanks, > Joseph > > On Feb 23, 9:05 pm, mdipierro wrote: > > > Can you tell me how to reproduce it? > > > On Feb 23, 9:50 am, Robin B wrote: > > > > It looks like a problem converting datetimes to/from strings? > > > > Robin > > > > On Feb 23, 9:21 am, mdipierro wrote: > > > > > Robin, > > > > > what is the bug? > > > > > Massimo > > > > > On Feb 23, 9:04 am, Robin B wrote: > > > > > > Looks like the type coercion code was last modified in r725. > > > > > >http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=... > > > > > > If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ > > > > > patched. > > > > > > Robin > > > > > > On Feb 23, 8:08 am, Joseph Jude wrote: > > > > > > > Okay with little bit of search, I found that, > > > > > > -In GAE, one can't select a single field; so I selected all fields > > > > > > (db.priority.ALL) and the error 1 vanished. > > > > > > -In GAE, datetime field throws up error. I removed datetime fields, > > > > > > and I didn't get any error. Once I introduce the datetime field in > > > > > > db > > > > > > model, the error is back. It is not only with null value; even when > > > > > > I > > > > > > try to insert a value, I get the same error. > > > > > > > Any help? > > > > > > > Thank you, > > > > > > Joseph > > > > > > > On Feb 23, 3:34 pm, Cephire wrote: > > > > > > > > All, > > > > > > > I'm trying out with web2py. It worked okay in the local web2py > > > > > > > server; > > > > > > > however when I tried with GAE (again local), I get few errors. > > > > > > > Please > > > > > > > help in resolving this. Thank you. > > > > > > > > Models > > > > > > > > > > > > > > > db.define_table('status', SQLField('name')) > > > > > > > > db.define_table('priority', SQLField('name')) > > > > > > > > db.define_table('cases', > > > > > > > SQLField('title'), > > > > > > > SQLField('description', 'text', length=256), > > > > > > > SQLField('status', db.status), > > > > > > > SQLField('priority', db.priority), > > > > > > > SQLField('created_by', db.auth_user), > > > > > > > SQLField('created_time', 'datetime', default=now), > > > > > > > SQLField('last_modified_by', db.auth_user), > > > > > > > SQLField('last_modified_time', 'datetime', default=now) > > > > > > > ) > > > > > > > > db.cases.priority.requires=IS_IN_DB(db, > > > > > > > 'priority.id','priority.name') > > > > > > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > > > > > > db.cases.title.requires=[IS_NOT_EMPTY()] > > > > > > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > > > > > > controller > > > > > > > == > > > > > > > @auth.requires_login() > > > > > > > def create(): > > > > > > > priority_values=[] > > > > > > > for pr in db().select(db.priority.name): > > > > > > > priority_values.append(pr['name']) > > > > > > > > status_values=[] > > > > > > > for st in db().select(db.status.name): > > > > > > > status_values.append(st['name']) > > > > > > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > > > > > > requires=IS_NOT_EMPTY())), > > > > > > > TR("Status:", status_values[0]), > > > > > > > TR("Priority:", > > > > > > > SELECT(priority_values,_name='priority', > > > > > > > requires=IS_IN_SET(priority_values))), > > > > > > > TR("Description:", > > > > > > > TEXTAREA(_name='description')), > > > > > > > TR("Created By:", auth.user.email), > > > > > > > TR("",INPUT(_type="submit", _value="Create")) > > > > > > > )) > > > > > > > if form.accepts(request.vars, session): > > > > > > > #insert into the record > > > > > > >
[web2py:16829] Re: Can hardcron work without being triggered by a request?
On Feb23, 0:19am, Iceberg wrote: > On Feb22, 8:37pm, AchipA wrote: > > I think I know what's causing the issue, try the following as your > > web2py.py instead of the original one: > > > #!/usr/bin/python > > # -*- coding: utf-8 -*- > > > import os > > import sys > > > path = os.path.dirname(os.path.abspath(__file__)) > > if not path in sys.path: > > sys.path.append(path) > > os.chdir(path) > > > import gluon.import_all > > from gluon.widget import start > > > # Starts cron daemon > > cron = gluon.contrib.cron.hardcron() > > cron.start() > > > # Start Web2py ! > > start() > > Hi Achipa, when comparing your patch with the web2py.py of v1.56.3, I > noticed the current web2py.py is as below: > > from gluon.contrib.cron import hardcron > # Starts cron daemon > cron = hardcron() > cron.start() > > I don't really understand why they are different. Must be a very > tricky issue??? :-/ But if you insist, OK, I don't have a python 2.5 > machine at hand, will check this next week. On the other hand, since > you are quite confident, maybe Massimo can include it into the coming > soon 1.56.4 :-) Kindly Massimo already combined Achipa's patch into web2py 1.56.4 (at least I saw that code in its source distribution package), so I test its windows distribution package just now, and found that it is still a softcron rather than a hardcron, sad but true. :-( Any other suggestions, Achipa? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16828] Re: web2py on gae - errors & questions
Massimo, have the below as the db.py in GAE and at the time of startup the error throws up db.py === try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there import datetime; now=datetime.date.today() db.define_table('cases', SQLField('title'), SQLField('created_time', 'datetime', default=now) ) db.cases.insert(title='testing', created_time=now) ===end of db.py== error: str(obj)[11:].strip().split(':')[:3]] ValueError: invalid literal for int() with base 10: '' I'm using web2py: Version 1.56.2 (2009-02-08 21:49:34) on GAE: release: "1.1.9" / timestamp: 1232676672 / api_versions: ['1'] on kubuntu thanks, Joseph On Feb 23, 9:05 pm, mdipierro wrote: > Can you tell me how to reproduce it? > > On Feb 23, 9:50 am, Robin B wrote: > > > It looks like a problem converting datetimes to/from strings? > > > Robin > > > On Feb 23, 9:21 am, mdipierro wrote: > > > > Robin, > > > > what is the bug? > > > > Massimo > > > > On Feb 23, 9:04 am, Robin B wrote: > > > > > Looks like the type coercion code was last modified in r725. > > > > >http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=... > > > > > If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ > > > > patched. > > > > > Robin > > > > > On Feb 23, 8:08 am, Joseph Jude wrote: > > > > > > Okay with little bit of search, I found that, > > > > > -In GAE, one can't select a single field; so I selected all fields > > > > > (db.priority.ALL) and the error 1 vanished. > > > > > -In GAE, datetime field throws up error. I removed datetime fields, > > > > > and I didn't get any error. Once I introduce the datetime field in db > > > > > model, the error is back. It is not only with null value; even when I > > > > > try to insert a value, I get the same error. > > > > > > Any help? > > > > > > Thank you, > > > > > Joseph > > > > > > On Feb 23, 3:34 pm, Cephire wrote: > > > > > > > All, > > > > > > I'm trying out with web2py. It worked okay in the local web2py > > > > > > server; > > > > > > however when I tried with GAE (again local), I get few errors. > > > > > > Please > > > > > > help in resolving this. Thank you. > > > > > > > Models > > > > > > > > > > > > > db.define_table('status', SQLField('name')) > > > > > > > db.define_table('priority', SQLField('name')) > > > > > > > db.define_table('cases', > > > > > > SQLField('title'), > > > > > > SQLField('description', 'text', length=256), > > > > > > SQLField('status', db.status), > > > > > > SQLField('priority', db.priority), > > > > > > SQLField('created_by', db.auth_user), > > > > > > SQLField('created_time', 'datetime', default=now), > > > > > > SQLField('last_modified_by', db.auth_user), > > > > > > SQLField('last_modified_time', 'datetime', default=now) > > > > > > ) > > > > > > > db.cases.priority.requires=IS_IN_DB(db, > > > > > > 'priority.id','priority.name') > > > > > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > > > > > db.cases.title.requires=[IS_NOT_EMPTY()] > > > > > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > > > > > controller > > > > > > == > > > > > > @auth.requires_login() > > > > > > def create(): > > > > > > priority_values=[] > > > > > > for pr in db().select(db.priority.name): > > > > > > priority_values.append(pr['name']) > > > > > > > status_values=[] > > > > > > for st in db().select(db.status.name): > > > > > > status_values.append(st['name']) > > > > > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > > > > > requires=IS_NOT_EMPTY())), > > > > > > TR("Status:", status_values[0]), > > > > > > TR("Priority:", > > > > > > SELECT(priority_values,_name='priority', > > > > > > requires=IS_IN_SET(priority_values))), > > > > > > TR("Description:", > > > > > > TEXTAREA(_name='description')), > > > > > > TR("Created By:", auth.user.email), > > > > > > TR("",INPUT(_type="submit", _value="Create")) > > > > > > )) > > > > > > if form.accepts(request.vars, session): > > > > > > #insert into the record > > > > > > #dict index starts with 0; record id starts with 1 > > > > > > db.cases.insert(title=form.vars.title, status=1, > > > > > > priority=priority_values.index(form.vars.priority)+1, > > > > > > description=form.vars.description,created_by=auth.user.id, > > > > > > last_modified_by=auth.user.id) > > > > > > redirect(URL(r=request, f='index')) > > > > > > return dict(form=form) > > > > > > > Error 1: > > > > > > SyntaxError: SQLSet: no tables selected > > > > > > at line > > > >
[web2py:16827] Re: Tools-based email authentication is case sensitive
I verified the approach works on my test bed but I did not put it on the public version yet. My concern is this: As soon as I convert everyone's address in the auth_user table to lower case, they will complain that it fails when they enter their email address in mixed case, i.e. "it's broken again!" I'll go ahead and implement this solution, but a better one would be to save the address mixed case but compare it as lower case during authentication. On Feb 23, 2:29 pm, mdipierro wrote: > Did you convert current emails in lower case? > > db(auth.settigns.table_user.id>0).update > (email=auth.settings.table_user.email.lower()) > db.commit() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16826] minor typos in the docs
Hi Massimo, Here are a few typos I picked up today. page: http://mdp.cti.depaul.edu/examples/default/examples bottom of example 23: esacpe -> escape --- bottom of example 24: BEUTIFY -> BEAUTIFY --- example 29 after the code printout section: obejcts -> objects --- broken link: just before example 29, first line in the "database examples" section. The link to the DAL documentation is broken, it is: http://mdp.cti.depaul.edu/examples/default/orm it should be: http://mdp.cti.depaul.edu/examples/default/dal --- page: http://mdp.cti.depaul.edu/examples/default/dal in the "On Migrations" section: accessibled -> accessible Hope those make up for the false bug report of earlier! Cheers, JC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16825] Re: web2py 1.56.4 posted
I should do it. for now you can find some info in the README file in the source distribution. 1.56.4 is mainly bug fixes related to tools.py Massimo On Feb 23, 9:36 pm, NguyendHEX wrote: > If possible, please create a release notes page the web2py's website. > I could not find it online. > > Thks, > > Nguyen > > On Feb 23, 11:07 pm, mdipierro wrote: > > > Many bug fixes in tools in tools and typos in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16824] Re: web2py 1.56.4 posted
If possible, please create a release notes page the web2py's website. I could not find it online. Thks, Nguyen On Feb 23, 11:07 pm, mdipierro wrote: > Many bug fixes in tools in tools and typos in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16823] Re: Textarea on SQLFORM
If you make a view for your form this will help you control it. If you use FORM(...) instead of SQLFORM() this will not generate tables. See http://mdp.cti.depaul.edu/examples/static/cookbook.pdf Then you will need to name the fields in your form, and update the data record - since you have one field, this is not too bad. On Mon, Feb 23, 2009 at 5:36 PM, murray3 wrote: > > thanks Yarko for that, it works, I was approaching this from the view, > not the controller. > one more thing I am stuck with, how do I modify the SQLFORM formatting > to only have > a textarea - i.e. no table, no labels, just textarea and submit? > chris > > On Feb 23, 5:03 am, Yarko Tymciurak wrote: > > ugh...never write email before dinner: > > > > On Sun, Feb 22, 2009 at 8:54 PM, Yarko Tymciurak > wrote: > > > > > Something like this works - but you may not want to define your own > > > > you may _want_ to define your own template > > > > > > > > > template: > > > > > in models/db.py: > > > db.define_table('comment', > > >SQLField( 'comment','text', length=256 )) > > > > > then in controllers/default.py: > > > > > def myform(): > > >form=SQLFORM(db.comment, _style='width:100%') # this gets > > > inserted in the > >if form.accepts(request.vars, session): > > >response.flash='form accepted' > > >elif form.errors: > > >response.flash='form has errors' > > >return dict(form=form) > > > > > Regards, > > > Yarko > > > > > On Feb 22, 5:50 pm, murray3 wrote: > > > > I have been enjoying the flexibiity of web2py, and my app idea is > > > > progressing > > > > well, it is something I have been contemplating for a long time and I > > > > will release it > > > > when I get it to a suitable stage as to take it further it needs to > be > > > > open source. > > > > > > So with that in mind, I would like to solve my most irritating issue > > > > with which I am obviously > > > > missing something even trying the code offered up in these > > > > discussions! > > > > > > I want a sqlform with just a textarea and submit button but I want > the > > > > textarea to be > > > > style="width: 100%;" easy, but unfortunatley my attempts are not > > > > updating the db. > > > > > > Any help most appreciated . > > > > chrism > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16822] Re: Authentication Problem !
Thanks Massimo, I appreciate your help but i think maybe i don't understand or there is something I'm doing wrong... Here is my code please let me know where I'm wrong because i did set "auth.messages.invalid_login" auth.settings.on_failed_authorization=URL(r=request,f='error') auth.settings.login_url=URL(r=request,f='login') auth.messages.invalid_login= 'Bad Login' auth.messages.logged_in = 'Perfect' def login(): return dict(form=auth.login(next="profile")) @auth.requires_login() def profile(): return dict() You said i should set "session.flash" before redirect... Where should I set it since the redirect is done implicitly inside tools.py... I really want to understand how to make this work without touching anything in the tools.py code.. Thanks for your attention ! Yannick P. On Feb 23, 1:34 am, mdipierro wrote: > Just set these: > > auth.messages.invalid_login > auth.messages.logged_in > > Massimo > > On Feb 22, 9:05 pm, Yannick wrote: > > > Thanks Massimo and Yarko, > > Theproblemhere is the redirect is done implicitly using the > > decorator pattern... It is done inside the method "requires_login()" > > of tools.py. I guess one solution should have been to put the > > session.flash message inside the "requires_login()" BUT I'm not allow > > to do so... > > Do you see what i mean ? > > > thanks ! > > > On Feb 22, 8:21 pm, Yarko Tymciurak wrote: > > > > yes, and set session flash in your controller (not your view); > > > > On Feb 22, 3:32 pm, mdipierro wrote: > > > > > I am not sure I fully understand so I give you two answers. > > > > > A) Before redirection you should set > > > > > session.flash="message" > > > > > instead of > > > > > response.flash="message" > > > > > The former is copied in the latter automatically before redirection. > > > > > B) The messages generated by the auth method all set session.flash > > > > before redirection. The messages are customizable. You can find a list > > > > in gluon.tools.py > > > > > Massimo > > > > > On Feb 22, 2:52 pm, Yannick wrote: > > > > > > Oh Thanks Massimo I completely forgot about the > > > > > "auth.settings.login_url...". > > > > > Here my new code: > > > > > > auth.settings.login_url=URL(r=request,f='login') > > > > > > def login(): > > > > > return dict(form=auth.login(next="profile")) > > > > > > @auth.requires_login() > > > > > def profile(): > > > > > return dict(Welcome="Welcome") > > > > > > How can I retrieve the response.flash() message in this case to let > > > > > the user know that the login failed since here i recreate a new > > > > > request and i guest the rsponse is lost... Do you have any forwarding > > > > > mechanism ? > > > > > > In the login.html file i have this: > > > > > {{if response.flash:}}{{=response.flash}}{{pass}} > > > > > > I guess I don't retrieve the response.flash anymore because it is the > > > > > new request. > > > > > > Do you have any idea how to print the flash message when the login > > > > > failed based on my code? or is there any other solution more > > > > > efficient ? > > > > > > Thanks for your help ! > > > > > > On Feb 22, 3:07 pm, mdipierro wrote: > > > > > > > In your code > > > > > > > @auth.requires_login() > > > > > > def profile(): > > > > > > if not auth.is_logged_in(): > > > > > > return dict(form=auth.login(next="login")) > > > > > > else: > > > > > > return dict(msg="Welcome") > > > > > > > because of > > > > > > > @auth.requires_login() > > > > > > > auth.is_logged_in() is always true > > > > > > > The validator, is user is not logged in, redirects to > > > > > > > auth.settings.login_url > > > > > > > you can set it > > > > > > > auth.settings.login_url=URL(r=request,f='login') > > > > > > > Hope this answers the question. > > > > > > > Massimo > > > > > > > On Feb 22, 12:04 pm, Yannick wrote: > > > > > > > > Hello mate, > > > > > > > Here is what I have in my controller: > > > > > > > > def login(): > > > > > > > formlog = auth.login(next="profile") > > > > > > > return dict(form=formlog) > > > > > > > > @auth.requires_login(): > > > > > > > def profile(): > > > > > > > if not auth.is_logged_in(): > > > > > > > return dict(form=auth.login(next="login")) > > > > > > > else: > > > > > > > return dict(msg="Welcome") > > > > > > > > I have twoproblemhere: > > > > > > > - First; here basically I'm just trying to login and if the login > > > > > > > failed the page is redirect to the login page with a feedback > > > > > > > message... when the login Authentication pass I can successfully > > > > > > > access the Profile page with noproblemBUT when the login > > > > > > > Authentication failed I'm redirect to this link > > > > > > > "http://127.0.0.1:8000/ > > > > > > > App../default/user/login" with a message "invalid function". I > > > > > > > understand the message because i don't have any action named > > > > > > > "User" > > > > > > > define on my controller. I'm wondering why i
[web2py:16821] Re: Ubuntu Apache server setup problem
Achipa, they can usefull, yet not in official repositories. So many applications/packages began in a separate site or repository (we can arrange this) while get attetion of a official developer or the developer (you) is acredited by a official developer, and gradually, became a official developer. 2009/2/22 AchipA > > Do we have anybody who is a registered Debian developer on this list ? > I have some scripts which generate deb packages for ubuntu and debian, > but I don't think they are worth much unless they get into the > official repositories. > > mdipierro wrote: > > Welcome. > > > > your Apache is not running web2py. > > > > You need to setup mod_proxy (easy) or mod_wsgi (difficult but better > > for production). > > > > I suggest you download > > > > http://mdp.cti.depaul.edu/examples/static/web2py_manual_cut.pdf > > > > for deployment instructions. Let us know if you have problems and we > > will help. > > > > Massimo > > > > On Feb 22, 10:09 am, cadrentes wrote: > > > Linux user: 2 yrs > > > Web2py user: 2 days > > > > > > I don't know how to phrase this problem. I'm trying to set up a > > > server. I get thishttp://65.49.60.137/when following the > > > instructions in the guide instead of the html. > > > > > > Any ideas? > > > -- Atenciosamente -- = Alexandre Miguel de Andrade Souza Hipercenter.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16820] Re: Textarea on SQLFORM
thanks Yarko for that, it works, I was approaching this from the view, not the controller. one more thing I am stuck with, how do I modify the SQLFORM formatting to only have a textarea - i.e. no table, no labels, just textarea and submit? chris On Feb 23, 5:03 am, Yarko Tymciurak wrote: > ugh...never write email before dinner: > > On Sun, Feb 22, 2009 at 8:54 PM, Yarko Tymciurak wrote: > > > Something like this works - but you may not want to define your own > > you may _want_ to define your own template > > > > > template: > > > in models/db.py: > > db.define_table('comment', > > SQLField( 'comment','text', length=256 )) > > > then in controllers/default.py: > > > def myform(): > > form=SQLFORM(db.comment, _style='width:100%') # this gets > > inserted in the > if form.accepts(request.vars, session): > > response.flash='form accepted' > > elif form.errors: > > response.flash='form has errors' > > return dict(form=form) > > > Regards, > > Yarko > > > On Feb 22, 5:50 pm, murray3 wrote: > > > I have been enjoying the flexibiity of web2py, and my app idea is > > > progressing > > > well, it is something I have been contemplating for a long time and I > > > will release it > > > when I get it to a suitable stage as to take it further it needs to be > > > open source. > > > > So with that in mind, I would like to solve my most irritating issue > > > with which I am obviously > > > missing something even trying the code offered up in these > > > discussions! > > > > I want a sqlform with just a textarea and submit button but I want the > > > textarea to be > > > style="width: 100%;" easy, but unfortunatley my attempts are not > > > updating the db. > > > > Any help most appreciated . > > > chrism > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16819] Re: bug in DAL with boolean field type
Ahh I see. My apologies for the false bug report. JC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16818] Re: bug in DAL with boolean field type
That's what web2py does. T or F as opposed to 1 and 0. You can argue both ways but not all database backend support boolean and when they do they may have odd behaviour (like NULL value not allowed). This a feature not a bug. ;-) Massimo On Feb 23, 3:47 pm, Jose C wrote: > Hi Massimo, > > Setting a field to Boolean type in the model actually creates a CHAR > (1) field in the backend database (instead of BOOLEAN). This occurs > in sqlite as well as postgresql - ver:745 of source. > > JC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16817] Re: Tools-based email authentication is case sensitive
Did you convert current emails in lower case? db(auth.settigns.table_user.id>0).update (email=auth.settings.table_user.email.lower()) db.commit() On Feb 23, 3:37 pm, Joe Barnhart wrote: > Just an update here. I have implemented your solution on my testbed > but have not rolled it into the public version yet. In four days I > have had four users contact me because "the logon doesn't work". In > each case, they had a capital letter somewhere in their email > address. > > For my fix, I think I would rather let people enter addresses in any > case but do the login comparison in a case-insenstitive manner. I did > not see UPPER() and LOWER() mentioned in the web2py manual as SQL > functions available on columns for queries. I'll look up the source > code and see if they're in there. > > -- Joe B. > > On Feb 19, 8:47 pm, mdipierro wrote: > > > It is intended but can be changed. > > > You can do > > > db(auth.settigns.table_user.id>0).update > > (email=auth.settings.table_user.email.lower()) > > > to make all current emails lower case and > > > auth.settings.table_user.email.requires=[IS_LOWER(),IS_EMAIL > > (),IS_NOT_IN_DB(db,auth.settings.table_user.email)] > > > to make sure all new ones are converted lower case upon validation. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16816] Re: Trailing slash in ajax search
I cannot say without looking at the rest of the code. On Feb 23, 1:18 pm, Jim wrote: > I'm using the AJAX search example from the manual. > > def add_message(): > response.title="Add Message" > return dict(form=FORM(INPUT(_id='keyword', > _onkeyup="ajax('add_issue_find', > ['keyword'],'target');")), > target_div=DIV(_id='target')) > > If I call this as "/add_message" it works fine. > > If I call it as as "/add_message/", I get the page repeated at the > search box. > > - > Logo > | search [ ] > | > | Logo > || search [ ] > > I've tried testing for empty argument and setting keyword = '' but > that doesn't help. > > I'm obviously new to programming, python and web2py so sorry if > there's an obvious fix. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16815] bug in DAL with boolean field type
Hi Massimo, Setting a field to Boolean type in the model actually creates a CHAR (1) field in the backend database (instead of BOOLEAN). This occurs in sqlite as well as postgresql - ver:745 of source. JC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16814] Re: Tools-based email authentication is case sensitive
Just an update here. I have implemented your solution on my testbed but have not rolled it into the public version yet. In four days I have had four users contact me because "the logon doesn't work". In each case, they had a capital letter somewhere in their email address. For my fix, I think I would rather let people enter addresses in any case but do the login comparison in a case-insenstitive manner. I did not see UPPER() and LOWER() mentioned in the web2py manual as SQL functions available on columns for queries. I'll look up the source code and see if they're in there. -- Joe B. On Feb 19, 8:47 pm, mdipierro wrote: > It is intended but can be changed. > > You can do > > db(auth.settigns.table_user.id>0).update > (email=auth.settings.table_user.email.lower()) > > to make all current emails lower case and > > auth.settings.table_user.email.requires=[IS_LOWER(),IS_EMAIL > (),IS_NOT_IN_DB(db,auth.settings.table_user.email)] > > to make sure all new ones are converted lower case upon validation. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16813] Re: web2py "AJAX" admin editor
Changed files: web2py/applications/admin/controllers/default.py web2py/applications/admin/static/ajax_editor.js web2py/applications/admin/views/default/edit.html web2py/applications/admin/views/layout.html web2py/applications/admin/views/web2py_ajax.html this time patch is more intrusive than from last time, because i had to change html layout to make "flash" field available. Still missing part is relogin but this time this is just response to your request :) I don't know why it does not work from konqueror as jquery should be portable that much? Anyway for now this is MozillaFirefox only untill I found out what is not working in my JavaScript code :-\ On Mon, Feb 23, 2009 at 7:52 PM, Boris Manojlovic < boris.manojlo...@gmail.com> wrote: > will try to do it asap :) > only missing will be "relogin" as i still didn't look into session issue. > You would have to open new window(tab) and login there untill i find some > nice solution for session timeout. > > > On Mon, Feb 23, 2009 at 7:16 PM, mdipierro wrote: > >> >> ok but can you send me a patch that does 1,2,3? >> >> On Feb 23, 9:59 am, Boris Manojlovic >> wrote: >> > hello, >> > 1) what exactly you need is very simple to achive as putting with JS >> value >> > into some (or I'm missing your point, which i think is case here) >> > 2) this is done already trough javascript (ajax_editor.js) as that was >> > needed for successful "save" functionality (or resolve redirect is >> received >> > if it is not sent) >> > 3) that is still to be done on client side - server side is same (and >> > implemented) code as it was before for /edit/ control,JSON should >> contain >> > standard errors you receive by HTML as you can see in patch >> > >> > >> > >> > On Mon, Feb 23, 2009 at 4:41 AM, mdipierro >> wrote: >> > >> > > Boris. I really like this but we need >> > >> > > 1) make hash value visible and readonly >> > > 2) return the same when it was saved as well >> > > 3) some kind of notification (possibly in the form of flash) that >> > > informs the user if the file was saved or not. >> > >> > > Massimo >> > >> > > On Feb 22, 12:43 pm, Boris Manojlovic >> > > wrote: >> > > > Please try this patch last one was non working... >> > >> > > > On Sun, Feb 22, 2009 at 7:16 PM, Boris Manojlovic < >> > >> > > > boris.manojlo...@gmail.com> wrote: >> > > > > Hello to All, >> > >> > > > > i have started to work on something called "ajax" code editor. >> > > > > What exactly does it mean? >> > >> > > > >1. No need for reloads on editor page (just think about undo >> redo in >> > > > >editor window) >> > > > >2. No "terrible loss of code" if you are logged out >> (application >> > > > >timeout... with that "great" redirect to login page...) >> > > > >3. speed gain >> > >> > > > > Current implementation has "save" functionality only and it works >> just >> > > from >> > > > > firefox (konqueror ignores my jquery code and same for opera...). >> > > > > Most coding as it would be expected should (and is) done on client >> side >> > > and >> > > > > will degrade depending if user use javascript at all - no script >> no >> > > ajax >> > > > > anyway. >> > > > > All messages in current stage are json passed to client. >> > > > > Patch against latest SVN from google code >> > >> > > > > P.S. Comments welcome and needed (to continue on this idea or not) >> > > > > -- >> > > > > "Only two things are infinite, the universe and human stupidity, >> and >> > > I'm >> > > > > not sure about the former."-Albert Einstein >> > >> > > > -- >> > > > "Only two things are infinite, the universe and human stupidity, and >> I'm >> > > not >> > > > sure about the former."-Albert Einstein >> > >> > > > ajax_editor.patch >> > > > 7KViewDownload >> > >> > -- >> > "Only two things are infinite, the universe and human stupidity, and I'm >> not >> > sure about the former."-Albert Einstein >> >> >> > > > -- > "Only two things are infinite, the universe and human stupidity, and I'm > not sure about the former."-Albert Einstein > -- "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."-Albert Einstein --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~--- --- web2py_orig/applications/admin/controllers/default.py 2009-02-22 02:22:10.0 +0100 +++ web2py/applications/admin/controllers/default.py 2009-02-23 20:55:08.0 +0100 @@ -425,6 +425,9 @@ def edit(): """ File edit handler """ +# Load json only if it is ajax edited... +if request.vars.has_key('from_ajax'): +import gluon.contrib.simplejson as json filename = '/'.
[web2py:16812] Re: CAS vs Auth
Thank you both for the responses. I am beginning to use web2py for corporate applications and having enterprise strength authentication as a pluggable app will be very useful. On Feb 23, 8:06 am, notabene wrote: > Integrated Authentication and Authorization Infrastructure systems > tend to be very complex. > > The standard I suppose is defined by OASIS in the "Security Assertion > Markup Language" (SAMLhttp://en.wikipedia.org/wiki/SAML). > > An easy demo of the User-experience is given > here:http://www.switch.ch/aai/demo/easy.html > But the framework ("Shibboleth") is java and quite complex. > > Here is a list of software supporting SAML > 2.0:http://docs.feide.no/fs-0048-1.3-en.html#txt-0078-SW-alternatives > > On Feb 22, 6:16 am, mdipierro wrote: > > > Right now they serve two distinct purpose. > > > CAS does single sign on but no access control > > > Auth does basic authentication and group based access control. > > > It would be possible to implement authentication on CAS and/or > > implement CAS using Auth. > > > A more ambitious goal is to extend CAS to support distributed group > > based access control. The CAS protocol does not provide that > > functionality so we either have to invent a new protocol or do some > > literature search on the topic and look for existing standard. > > Whatever we do if you need group based access control, you cannot do > > that with CAS. > > > Massimo > > > On Feb 21, 7:31 pm, DJ wrote: > > > > Hi there, > > > > I have used CAS previously for single-sign and it worked well. Whats > > > recommended now? Auth or CAS? > > > > I would like to have authentication to do record level edit/updates > > > and have the same user login for multiple apps? Can I do this in Auth? > > > > Thanks, > > > Sebastian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16811] Trailing slash in ajax search
I'm using the AJAX search example from the manual. def add_message(): response.title="Add Message" return dict(form=FORM(INPUT(_id='keyword', _onkeyup="ajax('add_issue_find', ['keyword'],'target');")), target_div=DIV(_id='target')) If I call this as "/add_message" it works fine. If I call it as as "/add_message/", I get the page repeated at the search box. - Logo | search [ ] | | Logo || search [ ] I've tried testing for empty argument and setting keyword = '' but that doesn't help. I'm obviously new to programming, python and web2py so sorry if there's an obvious fix. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16810] Re: web2py "AJAX" admin editor
will try to do it asap :) only missing will be "relogin" as i still didn't look into session issue. You would have to open new window(tab) and login there untill i find some nice solution for session timeout. On Mon, Feb 23, 2009 at 7:16 PM, mdipierro wrote: > > ok but can you send me a patch that does 1,2,3? > > On Feb 23, 9:59 am, Boris Manojlovic > wrote: > > hello, > > 1) what exactly you need is very simple to achive as putting with JS > value > > into some (or I'm missing your point, which i think is case here) > > 2) this is done already trough javascript (ajax_editor.js) as that was > > needed for successful "save" functionality (or resolve redirect is > received > > if it is not sent) > > 3) that is still to be done on client side - server side is same (and > > implemented) code as it was before for /edit/ control,JSON should contain > > standard errors you receive by HTML as you can see in patch > > > > > > > > On Mon, Feb 23, 2009 at 4:41 AM, mdipierro > wrote: > > > > > Boris. I really like this but we need > > > > > 1) make hash value visible and readonly > > > 2) return the same when it was saved as well > > > 3) some kind of notification (possibly in the form of flash) that > > > informs the user if the file was saved or not. > > > > > Massimo > > > > > On Feb 22, 12:43 pm, Boris Manojlovic > > > wrote: > > > > Please try this patch last one was non working... > > > > > > On Sun, Feb 22, 2009 at 7:16 PM, Boris Manojlovic < > > > > > > boris.manojlo...@gmail.com> wrote: > > > > > Hello to All, > > > > > > > i have started to work on something called "ajax" code editor. > > > > > What exactly does it mean? > > > > > > >1. No need for reloads on editor page (just think about undo > redo in > > > > >editor window) > > > > >2. No "terrible loss of code" if you are logged out (application > > > > >timeout... with that "great" redirect to login page...) > > > > >3. speed gain > > > > > > > Current implementation has "save" functionality only and it works > just > > > from > > > > > firefox (konqueror ignores my jquery code and same for opera...). > > > > > Most coding as it would be expected should (and is) done on client > side > > > and > > > > > will degrade depending if user use javascript at all - no script no > > > ajax > > > > > anyway. > > > > > All messages in current stage are json passed to client. > > > > > Patch against latest SVN from google code > > > > > > > P.S. Comments welcome and needed (to continue on this idea or not) > > > > > -- > > > > > "Only two things are infinite, the universe and human stupidity, > and > > > I'm > > > > > not sure about the former."-Albert Einstein > > > > > > -- > > > > "Only two things are infinite, the universe and human stupidity, and > I'm > > > not > > > > sure about the former."-Albert Einstein > > > > > > ajax_editor.patch > > > > 7KViewDownload > > > > -- > > "Only two things are infinite, the universe and human stupidity, and I'm > not > > sure about the former."-Albert Einstein > > > -- "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."-Albert Einstein --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16809] Re: web2py "AJAX" admin editor
ok but can you send me a patch that does 1,2,3? On Feb 23, 9:59 am, Boris Manojlovic wrote: > hello, > 1) what exactly you need is very simple to achive as putting with JS value > into some (or I'm missing your point, which i think is case here) > 2) this is done already trough javascript (ajax_editor.js) as that was > needed for successful "save" functionality (or resolve redirect is received > if it is not sent) > 3) that is still to be done on client side - server side is same (and > implemented) code as it was before for /edit/ control,JSON should contain > standard errors you receive by HTML as you can see in patch > > > > On Mon, Feb 23, 2009 at 4:41 AM, mdipierro wrote: > > > Boris. I really like this but we need > > > 1) make hash value visible and readonly > > 2) return the same when it was saved as well > > 3) some kind of notification (possibly in the form of flash) that > > informs the user if the file was saved or not. > > > Massimo > > > On Feb 22, 12:43 pm, Boris Manojlovic > > wrote: > > > Please try this patch last one was non working... > > > > On Sun, Feb 22, 2009 at 7:16 PM, Boris Manojlovic < > > > > boris.manojlo...@gmail.com> wrote: > > > > Hello to All, > > > > > i have started to work on something called "ajax" code editor. > > > > What exactly does it mean? > > > > >1. No need for reloads on editor page (just think about undo redo in > > > >editor window) > > > >2. No "terrible loss of code" if you are logged out (application > > > >timeout... with that "great" redirect to login page...) > > > >3. speed gain > > > > > Current implementation has "save" functionality only and it works just > > from > > > > firefox (konqueror ignores my jquery code and same for opera...). > > > > Most coding as it would be expected should (and is) done on client side > > and > > > > will degrade depending if user use javascript at all - no script no > > ajax > > > > anyway. > > > > All messages in current stage are json passed to client. > > > > Patch against latest SVN from google code > > > > > P.S. Comments welcome and needed (to continue on this idea or not) > > > > -- > > > > "Only two things are infinite, the universe and human stupidity, and > > I'm > > > > not sure about the former."-Albert Einstein > > > > -- > > > "Only two things are infinite, the universe and human stupidity, and I'm > > not > > > sure about the former."-Albert Einstein > > > > ajax_editor.patch > > > 7KViewDownload > > -- > "Only two things are infinite, the universe and human stupidity, and I'm not > sure about the former."-Albert Einstein --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16808] Re: Drop down
Hi Massimo; Nope it's not hiding the forms. As a pre-caution I even took your exact version of the hide function, deleted my version, and then pasted in your version and still had no hiding of forms. All I can think of is that I'm doing something unexpected in my "db.py" file that is short circuiting the hide function. Here is the contents of my db.py file. See what you think. Thanks for all the help - How do you find the time to do all this besides being a professor? :-) Not much sleep - I bet. import datetime; now=datetime.datetime.now() db=SQLDB("sqlite://db.db") db.define_table('category', SQLField('name')) db.define_table('FACWO_Task', SQLField('Title'), SQLField('Description','text'), SQLField('category',db.category), SQLField('timestamp','datetime',default=now)) db.define_table('Electrical_Task', SQLField('Title'), SQLField ('timestamp','datetime',default=now)) db.define_table('Mechanical_Task', SQLField('Title'), SQLField ('timestamp','datetime',default=now)) db.define_table('Plumbing_Task', SQLField('Title'), SQLField ('timestamp','datetime',default=now)) db.category.name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB (db,'category.name')] db.FACWO_Task.Title.requires=[IS_NOT_EMPTY()] db.FACWO_Task.category.requires=IS_IN_DB (db,'category.id','category.name') --- I'm going to send you a jpeg copy of the screen shot when I invoke the application. Regards Rick Hess On Feb 20, 6:13 pm, mdipierro wrote: > This > > function hide() { $(".myform").hide(); } > $(document).ready(function(){hide();}); > > was supposed to hide all forms until you select one using the dropbox. > Is it not doing so? > > Massimo > > On Feb 20, 6:49 pm, rickhess wrote: > > > > > Hi Massimo; > > > Thanks for all the help. > > > So I made the updates as suggested. The upshot is that currently the > > tables and the pull down all show up on the same page. What I would > > like to do is to have an info screen or 1st page identical to "example > > 28" with a pull down at the top which allows the user to select the > > ticket type and then proceed to that page. How do I combine example 28 > > with what I have so far? Note substitute the word ticket with the word > > task. > > > So here's what I have to date: > > > In the default controller (controllers/default.py): > > > #!/usr/bin/python > > # -*- coding: utf-8 -*- > > # default controlling code > > > # # sample index page with internationalization (T) > > > def index(): > > form1=SQLFORM(db.FACWO_Task) > > form2=SQLFORM(db.Electrical_Task) > > form3=SQLFORM(db.Mechanical_Task) > > form4=SQLFORM(db.Plumbing_Task) > > > if form1.accepts(request.vars,session): > > response.flash="form accepted!" > > elif form2.accepts(request.vars,session): > > response.flash="form accepted" > > elif form3.accepts(request.vars,session): > > response.flash="form accepted" > > elif form4.accepts(request.vars,session): > > response.flash="form accepted" > > else: > > response.flash="form is invalid!" > > > return dict(form1=form1,form2=form2,form3=form3,form4=form4) > > > ------ > > and in the views/default/index.html there is: > > > > > > > general > > electrical > > mechanical > > plumbing > > > > > > {{=form1}} > > {{=form2}} > > {{=form3}} > > {{=form4}} > > > > > function hide() { $(".myform").hide(); } > > $(document).ready(function(){hide();}); > > $("#task_type").change(function(){hide(); $('.'+$(this).val > > ()).slideToggle();}) > > > > ---- > > So currently when I click on the default.py index you see a page with > > all the tables listed from top to down. You can see my desire for a > > front page. So in driving example 28 I saw a vey nice screen with name > > and email. So go any ideas how I could add the drop down to example 28 > > and then when a user selects a drop down item it will then go to the > > correct form representing the db table? > > > Regards > > RickHess > > > On Feb 19, 10:21 am, rickhess wrote: > > > > Hi Massimo; > > > > This is great let me give it a whirl and I'll post back as to how it > > > worked. > > > > RickHess > > > > On Feb 18, 7:31 pm, mdipierro wrote: > > > > > here is one possible solution (may contain typos) > > > > > def index(): > > > > form1=SQLFORM(db.electrical_ticket) > > > > form2=SQLFORM(dbmechanical_ticket) > > > > if form1.accepts(..): ... >
[web2py:16807] web2py 1.56.4 posted
Many bug fixes in tools in tools and typos in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16806] Re: web2py on gae - errors & questions
Can you tell me how to reproduce it? On Feb 23, 9:50 am, Robin B wrote: > It looks like a problem converting datetimes to/from strings? > > Robin > > On Feb 23, 9:21 am, mdipierro wrote: > > > Robin, > > > what is the bug? > > > Massimo > > > On Feb 23, 9:04 am, Robin B wrote: > > > > Looks like the type coercion code was last modified in r725. > > > >http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=... > > > > If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ > > > patched. > > > > Robin > > > > On Feb 23, 8:08 am, Joseph Jude wrote: > > > > > Okay with little bit of search, I found that, > > > > -In GAE, one can't select a single field; so I selected all fields > > > > (db.priority.ALL) and the error 1 vanished. > > > > -In GAE, datetime field throws up error. I removed datetime fields, > > > > and I didn't get any error. Once I introduce the datetime field in db > > > > model, the error is back. It is not only with null value; even when I > > > > try to insert a value, I get the same error. > > > > > Any help? > > > > > Thank you, > > > > Joseph > > > > > On Feb 23, 3:34 pm, Cephire wrote: > > > > > > All, > > > > > I'm trying out with web2py. It worked okay in the local web2py server; > > > > > however when I tried with GAE (again local), I get few errors. Please > > > > > help in resolving this. Thank you. > > > > > > Models > > > > > > > > > > > db.define_table('status', SQLField('name')) > > > > > > db.define_table('priority', SQLField('name')) > > > > > > db.define_table('cases', > > > > > SQLField('title'), > > > > > SQLField('description', 'text', length=256), > > > > > SQLField('status', db.status), > > > > > SQLField('priority', db.priority), > > > > > SQLField('created_by', db.auth_user), > > > > > SQLField('created_time', 'datetime', default=now), > > > > > SQLField('last_modified_by', db.auth_user), > > > > > SQLField('last_modified_time', 'datetime', default=now) > > > > > ) > > > > > > db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') > > > > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > > > > db.cases.title.requires=[IS_NOT_EMPTY()] > > > > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > > > > controller > > > > > == > > > > > @auth.requires_login() > > > > > def create(): > > > > > priority_values=[] > > > > > for pr in db().select(db.priority.name): > > > > > priority_values.append(pr['name']) > > > > > > status_values=[] > > > > > for st in db().select(db.status.name): > > > > > status_values.append(st['name']) > > > > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > > > > requires=IS_NOT_EMPTY())), > > > > > TR("Status:", status_values[0]), > > > > > TR("Priority:", > > > > > SELECT(priority_values,_name='priority', > > > > > requires=IS_IN_SET(priority_values))), > > > > > TR("Description:", TEXTAREA(_name='description')), > > > > > TR("Created By:", auth.user.email), > > > > > TR("",INPUT(_type="submit", _value="Create")) > > > > > )) > > > > > if form.accepts(request.vars, session): > > > > > #insert into the record > > > > > #dict index starts with 0; record id starts with 1 > > > > > db.cases.insert(title=form.vars.title, status=1, > > > > > priority=priority_values.index(form.vars.priority)+1, > > > > > description=form.vars.description,created_by=auth.user.id, > > > > > last_modified_by=auth.user.id) > > > > > redirect(URL(r=request, f='index')) > > > > > return dict(form=form) > > > > > > Error 1: > > > > > SyntaxError: SQLSet: no tables selected > > > > > at line > > > > > for pr in db().select(db.priority.name): > > > > > > Error 2: > > > > > I changed the insert line into the below: > > > > > > db.cases.insert(title="test title", priority=1, created_by=12, > > > > > description="test description") > > > > > > 1 & 12 are the IDs in the respective tables in google datastore > > > > > > and I get this error: > > > > > > str(obj)[11:].strip().split(':')[:3]] > > > > > ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16805] Re: web2py "AJAX" admin editor
hello, 1) what exactly you need is very simple to achive as putting with JS value into some (or I'm missing your point, which i think is case here) 2) this is done already trough javascript (ajax_editor.js) as that was needed for successful "save" functionality (or resolve redirect is received if it is not sent) 3) that is still to be done on client side - server side is same (and implemented) code as it was before for /edit/ control,JSON should contain standard errors you receive by HTML as you can see in patch On Mon, Feb 23, 2009 at 4:41 AM, mdipierro wrote: > > Boris. I really like this but we need > > 1) make hash value visible and readonly > 2) return the same when it was saved as well > 3) some kind of notification (possibly in the form of flash) that > informs the user if the file was saved or not. > > Massimo > > On Feb 22, 12:43 pm, Boris Manojlovic > wrote: > > Please try this patch last one was non working... > > > > On Sun, Feb 22, 2009 at 7:16 PM, Boris Manojlovic < > > > > > > > > boris.manojlo...@gmail.com> wrote: > > > Hello to All, > > > > > i have started to work on something called "ajax" code editor. > > > What exactly does it mean? > > > > >1. No need for reloads on editor page (just think about undo redo in > > >editor window) > > >2. No "terrible loss of code" if you are logged out (application > > >timeout... with that "great" redirect to login page...) > > >3. speed gain > > > > > Current implementation has "save" functionality only and it works just > from > > > firefox (konqueror ignores my jquery code and same for opera...). > > > Most coding as it would be expected should (and is) done on client side > and > > > will degrade depending if user use javascript at all - no script no > ajax > > > anyway. > > > All messages in current stage are json passed to client. > > > Patch against latest SVN from google code > > > > > P.S. Comments welcome and needed (to continue on this idea or not) > > > -- > > > "Only two things are infinite, the universe and human stupidity, and > I'm > > > not sure about the former."-Albert Einstein > > > > -- > > "Only two things are infinite, the universe and human stupidity, and I'm > not > > sure about the former."-Albert Einstein > > > > ajax_editor.patch > > 7KViewDownload > > > -- "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."-Albert Einstein --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16804] Re: web2py on gae - errors & questions
It looks like a problem converting datetimes to/from strings? Robin On Feb 23, 9:21 am, mdipierro wrote: > Robin, > > what is the bug? > > Massimo > > On Feb 23, 9:04 am, Robin B wrote: > > > Looks like the type coercion code was last modified in r725. > > >http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=... > > > If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ > > patched. > > > Robin > > > On Feb 23, 8:08 am, Joseph Jude wrote: > > > > Okay with little bit of search, I found that, > > > -In GAE, one can't select a single field; so I selected all fields > > > (db.priority.ALL) and the error 1 vanished. > > > -In GAE, datetime field throws up error. I removed datetime fields, > > > and I didn't get any error. Once I introduce the datetime field in db > > > model, the error is back. It is not only with null value; even when I > > > try to insert a value, I get the same error. > > > > Any help? > > > > Thank you, > > > Joseph > > > > On Feb 23, 3:34 pm, Cephire wrote: > > > > > All, > > > > I'm trying out with web2py. It worked okay in the local web2py server; > > > > however when I tried with GAE (again local), I get few errors. Please > > > > help in resolving this. Thank you. > > > > > Models > > > > > > > > > db.define_table('status', SQLField('name')) > > > > > db.define_table('priority', SQLField('name')) > > > > > db.define_table('cases', > > > > SQLField('title'), > > > > SQLField('description', 'text', length=256), > > > > SQLField('status', db.status), > > > > SQLField('priority', db.priority), > > > > SQLField('created_by', db.auth_user), > > > > SQLField('created_time', 'datetime', default=now), > > > > SQLField('last_modified_by', db.auth_user), > > > > SQLField('last_modified_time', 'datetime', default=now) > > > > ) > > > > > db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') > > > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > > > db.cases.title.requires=[IS_NOT_EMPTY()] > > > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > > > controller > > > > == > > > > @auth.requires_login() > > > > def create(): > > > > priority_values=[] > > > > for pr in db().select(db.priority.name): > > > > priority_values.append(pr['name']) > > > > > status_values=[] > > > > for st in db().select(db.status.name): > > > > status_values.append(st['name']) > > > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > > > requires=IS_NOT_EMPTY())), > > > > TR("Status:", status_values[0]), > > > > TR("Priority:", > > > > SELECT(priority_values,_name='priority', > > > > requires=IS_IN_SET(priority_values))), > > > > TR("Description:", TEXTAREA(_name='description')), > > > > TR("Created By:", auth.user.email), > > > > TR("",INPUT(_type="submit", _value="Create")) > > > > )) > > > > if form.accepts(request.vars, session): > > > > #insert into the record > > > > #dict index starts with 0; record id starts with 1 > > > > db.cases.insert(title=form.vars.title, status=1, > > > > priority=priority_values.index(form.vars.priority)+1, > > > > description=form.vars.description,created_by=auth.user.id, > > > > last_modified_by=auth.user.id) > > > > redirect(URL(r=request, f='index')) > > > > return dict(form=form) > > > > > Error 1: > > > > SyntaxError: SQLSet: no tables selected > > > > at line > > > > for pr in db().select(db.priority.name): > > > > > Error 2: > > > > I changed the insert line into the below: > > > > > db.cases.insert(title="test title", priority=1, created_by=12, > > > > description="test description") > > > > > 1 & 12 are the IDs in the respective tables in google datastore > > > > > and I get this error: > > > > > str(obj)[11:].strip().split(':')[:3]] > > > > ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16803] Re: Auth with new table assignment not working...
same thing got me. try, class MyAuth(Auth): def __init__(self, environment, T, db = db): ^^ On Feb 23, 7:55 am, Jason Brower wrote: > I have setup the auth modules as follows:' > # Create the user table > db.define_table('users', > SQLField('nickname', length=25), > SQLField('email', 'string'), > SQLField('first_name', 'string'), > SQLField('last_name', 'string'), > SQLField('password', 'password'), > SQLField('created', 'date', default=now), > SQLField('deleted', 'string'), > SQLField('verified', 'boolean', default= False), > SQLField('position', 'string'), > SQLField('profile_text', 'text'), > SQLField('profile_photo', 'upload', default=''), > SQLField('homepage', 'string'), > SQLField('event','string')) > > class MyAuth(Auth): > def __init__(self, environment, T, db = None): > "Initialise parent class & make any necessary modifications" > Auth.__init__(self,environment,db) > self.messages.logged_in = T("Logged in") > self.messages.email_sent = T("Email sent") > self.messages.email_verified = T("Email verified") > self.messages.logged_out = T("Logged out") > self.messages.registration_succesful = T("Registration > successful") > self.messages.invalid_email = T("Invalid email") > self.messages.invalid_login = T("Invalid login") > self.messages.verify_email_subject = T("Password verify") > self.messages.username_sent = T("Your username was emailed to > you") > self.messages.new_password_sent = T("A new password was emailed > to you") > self.messages.invalid_email = T("Invalid email") > self.messages.password_changed = T("Password changed") > self.messages.retrieve_username=str(T("Your username is"))+": > %(username)s" > self.messages.retrieve_username_subject="Username retrieve" > self.messages.retrieve_password=str(T("Your password is"))+": > %(password)s" > self.messages.retrieve_password_subject = T("Password retrieve") > self.messages.profile_updated = T("Profile updated") > #Use my own table instead of the default table. > self.settings.table_user=db.users > > Not the last line... With that I should see the new users profile > information in the profile page, but I get this profileScreen.png, which > I think is the default. I thought I would be getting information like > userDatabase.png. > Is there something I am missing? > --- > Regards, > Jason Brower > > usersDatatbase.png > 73KViewDownload > > profileScreen.png > 62KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16802] Re: New Appliance Submission: QrOne CSS Designer
session.connect(request,response,db) I guess we just need to patch the appliance On Feb 23, 9:11 am, Markus Gritsch wrote: > On Mon, Feb 23, 2009 at 4:03 PM, BigBaaadBob wrote: > > > Maybe I'm overly fussy but "if you don't want sessions" doesn't scream > > GAE to me... Isn't there a way this can either be made automatic or > > at least explicit as in "if you us GAE you can't use sessions"... > > But you *can* use sessions when running on GAE. Just configure them > to be stored in a table. > > Markus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16801] Re: web2py on gae - errors & questions
Robin, what is the bug? Massimo On Feb 23, 9:04 am, Robin B wrote: > Looks like the type coercion code was last modified in r725. > > http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=... > > If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ > patched. > > Robin > > On Feb 23, 8:08 am, Joseph Jude wrote: > > > Okay with little bit of search, I found that, > > -In GAE, one can't select a single field; so I selected all fields > > (db.priority.ALL) and the error 1 vanished. > > -In GAE, datetime field throws up error. I removed datetime fields, > > and I didn't get any error. Once I introduce the datetime field in db > > model, the error is back. It is not only with null value; even when I > > try to insert a value, I get the same error. > > > Any help? > > > Thank you, > > Joseph > > > On Feb 23, 3:34 pm, Cephire wrote: > > > > All, > > > I'm trying out with web2py. It worked okay in the local web2py server; > > > however when I tried with GAE (again local), I get few errors. Please > > > help in resolving this. Thank you. > > > > Models > > > > > > > db.define_table('status', SQLField('name')) > > > > db.define_table('priority', SQLField('name')) > > > > db.define_table('cases', > > > SQLField('title'), > > > SQLField('description', 'text', length=256), > > > SQLField('status', db.status), > > > SQLField('priority', db.priority), > > > SQLField('created_by', db.auth_user), > > > SQLField('created_time', 'datetime', default=now), > > > SQLField('last_modified_by', db.auth_user), > > > SQLField('last_modified_time', 'datetime', default=now) > > > ) > > > > db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') > > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > > db.cases.title.requires=[IS_NOT_EMPTY()] > > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > > controller > > > == > > > @auth.requires_login() > > > def create(): > > > priority_values=[] > > > for pr in db().select(db.priority.name): > > > priority_values.append(pr['name']) > > > > status_values=[] > > > for st in db().select(db.status.name): > > > status_values.append(st['name']) > > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > > requires=IS_NOT_EMPTY())), > > > TR("Status:", status_values[0]), > > > TR("Priority:", > > > SELECT(priority_values,_name='priority', > > > requires=IS_IN_SET(priority_values))), > > > TR("Description:", TEXTAREA(_name='description')), > > > TR("Created By:", auth.user.email), > > > TR("",INPUT(_type="submit", _value="Create")) > > > )) > > > if form.accepts(request.vars, session): > > > #insert into the record > > > #dict index starts with 0; record id starts with 1 > > > db.cases.insert(title=form.vars.title, status=1, > > > priority=priority_values.index(form.vars.priority)+1, > > > description=form.vars.description,created_by=auth.user.id, > > > last_modified_by=auth.user.id) > > > redirect(URL(r=request, f='index')) > > > return dict(form=form) > > > > Error 1: > > > SyntaxError: SQLSet: no tables selected > > > at line > > > for pr in db().select(db.priority.name): > > > > Error 2: > > > I changed the insert line into the below: > > > > db.cases.insert(title="test title", priority=1, created_by=12, > > > description="test description") > > > > 1 & 12 are the IDs in the respective tables in google datastore > > > > and I get this error: > > > > str(obj)[11:].strip().split(':')[:3]] > > > ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16800] Re: CAS vs Auth
Thanks. I will look into that On Feb 23, 7:06 am, notabene wrote: > Integrated Authentication and Authorization Infrastructure systems > tend to be very complex. > > The standard I suppose is defined by OASIS in the "Security Assertion > Markup Language" (SAMLhttp://en.wikipedia.org/wiki/SAML). > > An easy demo of the User-experience is given > here:http://www.switch.ch/aai/demo/easy.html > But the framework ("Shibboleth") is java and quite complex. > > Here is a list of software supporting SAML > 2.0:http://docs.feide.no/fs-0048-1.3-en.html#txt-0078-SW-alternatives > > On Feb 22, 6:16 am, mdipierro wrote: > > > Right now they serve two distinct purpose. > > > CAS does single sign on but no access control > > > Auth does basic authentication and group based access control. > > > It would be possible to implement authentication on CAS and/or > > implement CAS using Auth. > > > A more ambitious goal is to extend CAS to support distributed group > > based access control. The CAS protocol does not provide that > > functionality so we either have to invent a new protocol or do some > > literature search on the topic and look for existing standard. > > Whatever we do if you need group based access control, you cannot do > > that with CAS. > > > Massimo > > > On Feb 21, 7:31 pm, DJ wrote: > > > > Hi there, > > > > I have used CAS previously for single-sign and it worked well. Whats > > > recommended now? Auth or CAS? > > > > I would like to have authentication to do record level edit/updates > > > and have the same user login for multiple apps? Can I do this in Auth? > > > > Thanks, > > > Sebastian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16799] Re: Auth with new table assignment not working...
I found some typos in your code (based on latest trunk) which I fixed below. It works for me. db.define_table('users', SQLField('nickname', length=25), SQLField('email', 'string'), SQLField('first_name', 'string'), SQLField('last_name', 'string'), SQLField('password', 'password'), SQLField('created', 'date', default=request.now), SQLField('deleted', 'string'), SQLField('verified', 'boolean', default= False), SQLField('position', 'string'), SQLField('profile_text', 'text'), SQLField('profile_photo', 'upload', default=''), SQLField('homepage', 'string'), SQLField('event','string'), SQLField('registration_key',length=128)) from gluon.tools import Mail, Auth, Crud class MyAuth(Auth): def __init__(self, environment, db = None): "Initialise parent class & make any necessary modifications" Auth.__init__(self,environment,db) self.messages.logged_in = T("Logged in") self.messages.email_sent = T("Email sent") self.messages.email_verified = T("Email verified") self.messages.logged_out = T("Logged out") self.messages.registration_successful = T("Registration successful") self.messages.invalid_email = T("Invalid email") self.messages.invalid_login = T("Invalid login") self.messages.verify_email_subject = T("Password verify") self.messages.username_sent = T("Your username was emailed to you") self.messages.new_password_sent = T("A new password was emailed to you") self.messages.password_changed = T("Password changed") self.messages.retrieve_username=str(T("Your username is"))+": % (username)s" self.messages.retrieve_username_subject="Username retrieve" self.messages.retrieve_password=str(T("Your password is"))+": % (password)s" self.messages.retrieve_password_subject = T("Password retrieve") self.messages.profile_updated = T("Profile updated") #Use my own table instead of the default table. self.settings.table_user=db.users uth=MyAuth(globals(),db) # authentication/ authorization # auth.settings.mailer=mail # for user email verification auth.define_tables() # creates all needed tables # crud=Crud(globals(),db) # for CRUD helpers using auth # crud.settings.auth=auth # (optional) enforces authorization on crud On Feb 23, 1:55 am, Jason Brower wrote: > I have setup the auth modules as follows:' > # Create the user table > db.define_table('users', > SQLField('nickname', length=25), > SQLField('email', 'string'), > SQLField('first_name', 'string'), > SQLField('last_name', 'string'), > SQLField('password', 'password'), > SQLField('created', 'date', default=now), > SQLField('deleted', 'string'), > SQLField('verified', 'boolean', default= False), > SQLField('position', 'string'), > SQLField('profile_text', 'text'), > SQLField('profile_photo', 'upload', default=''), > SQLField('homepage', 'string'), > SQLField('event','string')) > > class MyAuth(Auth): > def __init__(self, environment, T, db = None): > "Initialise parent class & make any necessary modifications" > Auth.__init__(self,environment,db) > self.messages.logged_in = T("Logged in") > self.messages.email_sent = T("Email sent") > self.messages.email_verified = T("Email verified") > self.messages.logged_out = T("Logged out") > self.messages.registration_succesful = T("Registration > successful") > self.messages.invalid_email = T("Invalid email") > self.messages.invalid_login = T("Invalid login") > self.messages.verify_email_subject = T("Password verify") > self.messages.username_sent = T("Your username was emailed to > you") > self.messages.new_password_sent = T("A new password was emailed > to you") > self.messages.invalid_email = T("Invalid email") > self.messages.password_changed = T("Password changed") > self.messages.retrieve_username=str(T("Your username is"))+": > %(username)s" > self.messages.retrieve_username_subject="Username retrieve" > self.messages.retrieve_password=str(T("Your password is"))+": > %(password)s" > self.messages.retrieve_password_subject = T("Password retrieve") > self.messages.profile_updated = T("Profile updated") > #Use my own table instead of the default table. > self.settings.table
[web2py:16798] Re: New Appliance Submission: QrOne CSS Designer
On Mon, Feb 23, 2009 at 4:03 PM, BigBaaadBob wrote: > > Maybe I'm overly fussy but "if you don't want sessions" doesn't scream > GAE to me... Isn't there a way this can either be made automatic or > at least explicit as in "if you us GAE you can't use sessions"... But you *can* use sessions when running on GAE. Just configure them to be stored in a table. Markus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16797] Re: New Appliance Submission: QrOne CSS Designer
To really fix this, requires runtime configuration, but web2py does not have configuration, so the down side is that configuration is sprinkled throughout the app with if/else, try/except, comment/ uncomment. I agree that a standard configuration would be more maintainable. Robin On Feb 23, 9:03 am, BigBaaadBob wrote: > Maybe I'm overly fussy but "if you don't want sessions" doesn't scream > GAE to me... Isn't there a way this can either be made automatic or > at least explicit as in "if you us GAE you can't use sessions"... > > On Feb 23, 8:11 am, dhmorgan wrote: > > > fantastic! > > > On Feb 19, 2:51 pm, blackthorne wrote: > > > > hi > > > > I've been planning to work on this little application for a while but > > > only now I made it happen. > > > It's a port from a very simple CSS Designer that generates code for > > > you and allows you to keep visually updated on how it's going to look > > > on the fly. > > > >http://mdp.cti.depaul.edu/appliances/default/show/47 > > > > feedback is welcome! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16796] Re: This seems like it should be easy, but checkboxes are killing me in custom forms.
Alright, I figured out what I was doing. I didn't realize that checkboxes don't send anything if they are unchecked so I was calling an ajax() function in javascript to submit a form and always including the checkbox value regardless of if it was checked. Even if it was unchecked it still submitted the value. I had to put in some javascript to check if the checkbox was checked or not and then build the ajax() function accordingly. Sorry to waste your time with this. I am pretty new to all of this so sometimes I end up barking up the wrong tree. Thanks for you help. -Jason On Feb 22, 8:11 pm, mdipierro wrote: > def check(): > default=True > form=FORM(INPUT(_type='checkbox',_name='check',value=default),INPUT > (_type='submit')) > if form.accepts(request.vars): > if form.vars.check: response.flash='checked' > else: response.flash='not checked' > return dict(form=form) > > On Feb 22, 9:58 pm, jlegler wrote: > > > If I have a custom form, I seem to always have the checkbox returning > > the same result whether it is checked or not. Does anyone have any > > examples on how to make the checkbox return different results > > depending on whether it is checked or not? All I want to do is have > > the checkbox represent whether something is true or false in the > > database and if it is modified, have it modify the database. It works > > exactly the way I want it to when I go into the database > > administration portion of the GUI so seeing the source for that would > > even be helpful although I can't seem to find that either. Does > > anyone have any examples of a best practice way to accomplish this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16795] Re: web2py on gae - errors & questions
Looks like the type coercion code was last modified in r725. http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=side&path=/trunk/gluon/contrib/gql.py&old_path=/trunk/gluon/contrib/gql.py&old=718 If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ patched. Robin On Feb 23, 8:08 am, Joseph Jude wrote: > Okay with little bit of search, I found that, > -In GAE, one can't select a single field; so I selected all fields > (db.priority.ALL) and the error 1 vanished. > -In GAE, datetime field throws up error. I removed datetime fields, > and I didn't get any error. Once I introduce the datetime field in db > model, the error is back. It is not only with null value; even when I > try to insert a value, I get the same error. > > Any help? > > Thank you, > Joseph > > On Feb 23, 3:34 pm, Cephire wrote: > > > All, > > I'm trying out with web2py. It worked okay in the local web2py server; > > however when I tried with GAE (again local), I get few errors. Please > > help in resolving this. Thank you. > > > Models > > > > > db.define_table('status', SQLField('name')) > > > db.define_table('priority', SQLField('name')) > > > db.define_table('cases', > > SQLField('title'), > > SQLField('description', 'text', length=256), > > SQLField('status', db.status), > > SQLField('priority', db.priority), > > SQLField('created_by', db.auth_user), > > SQLField('created_time', 'datetime', default=now), > > SQLField('last_modified_by', db.auth_user), > > SQLField('last_modified_time', 'datetime', default=now) > > ) > > > db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') > > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > > db.cases.title.requires=[IS_NOT_EMPTY()] > > db.cases.description.requires=[IS_NOT_EMPTY()] > > > controller > > == > > @auth.requires_login() > > def create(): > > priority_values=[] > > for pr in db().select(db.priority.name): > > priority_values.append(pr['name']) > > > status_values=[] > > for st in db().select(db.status.name): > > status_values.append(st['name']) > > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > > requires=IS_NOT_EMPTY())), > > TR("Status:", status_values[0]), > > TR("Priority:", SELECT(priority_values,_name='priority', > > requires=IS_IN_SET(priority_values))), > > TR("Description:", TEXTAREA(_name='description')), > > TR("Created By:", auth.user.email), > > TR("",INPUT(_type="submit", _value="Create")) > > )) > > if form.accepts(request.vars, session): > > #insert into the record > > #dict index starts with 0; record id starts with 1 > > db.cases.insert(title=form.vars.title, status=1, > > priority=priority_values.index(form.vars.priority)+1, > > description=form.vars.description,created_by=auth.user.id, > > last_modified_by=auth.user.id) > > redirect(URL(r=request, f='index')) > > return dict(form=form) > > > Error 1: > > SyntaxError: SQLSet: no tables selected > > at line > > for pr in db().select(db.priority.name): > > > Error 2: > > I changed the insert line into the below: > > > db.cases.insert(title="test title", priority=1, created_by=12, > > description="test description") > > > 1 & 12 are the IDs in the respective tables in google datastore > > > and I get this error: > > > str(obj)[11:].strip().split(':')[:3]] > > ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16794] Re: New Appliance Submission: QrOne CSS Designer
Maybe I'm overly fussy but "if you don't want sessions" doesn't scream GAE to me... Isn't there a way this can either be made automatic or at least explicit as in "if you us GAE you can't use sessions"... On Feb 23, 8:11 am, dhmorgan wrote: > fantastic! > > On Feb 19, 2:51 pm, blackthorne wrote: > > > hi > > > I've been planning to work on this little application for a while but > > only now I made it happen. > > It's a port from a very simple CSS Designer that generates code for > > you and allows you to keep visually updated on how it's going to look > > on the fly. > > >http://mdp.cti.depaul.edu/appliances/default/show/47 > > > feedback is welcome! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16793] Re: web2py on gae - errors & questions
Okay with little bit of search, I found that, -In GAE, one can't select a single field; so I selected all fields (db.priority.ALL) and the error 1 vanished. -In GAE, datetime field throws up error. I removed datetime fields, and I didn't get any error. Once I introduce the datetime field in db model, the error is back. It is not only with null value; even when I try to insert a value, I get the same error. Any help? Thank you, Joseph On Feb 23, 3:34 pm, Cephire wrote: > All, > I'm trying out with web2py. It worked okay in the local web2py server; > however when I tried with GAE (again local), I get few errors. Please > help in resolving this. Thank you. > > Models > > > db.define_table('status', SQLField('name')) > > db.define_table('priority', SQLField('name')) > > db.define_table('cases', > SQLField('title'), > SQLField('description', 'text', length=256), > SQLField('status', db.status), > SQLField('priority', db.priority), > SQLField('created_by', db.auth_user), > SQLField('created_time', 'datetime', default=now), > SQLField('last_modified_by', db.auth_user), > SQLField('last_modified_time', 'datetime', default=now) > ) > > db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') > db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') > db.cases.title.requires=[IS_NOT_EMPTY()] > db.cases.description.requires=[IS_NOT_EMPTY()] > > controller > == > @auth.requires_login() > def create(): > priority_values=[] > for pr in db().select(db.priority.name): > priority_values.append(pr['name']) > > status_values=[] > for st in db().select(db.status.name): > status_values.append(st['name']) > > form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", > requires=IS_NOT_EMPTY())), > TR("Status:", status_values[0]), > TR("Priority:", SELECT(priority_values,_name='priority', > requires=IS_IN_SET(priority_values))), > TR("Description:", TEXTAREA(_name='description')), > TR("Created By:", auth.user.email), > TR("",INPUT(_type="submit", _value="Create")) > )) > if form.accepts(request.vars, session): > #insert into the record > #dict index starts with 0; record id starts with 1 > db.cases.insert(title=form.vars.title, status=1, > priority=priority_values.index(form.vars.priority)+1, > description=form.vars.description,created_by=auth.user.id, > last_modified_by=auth.user.id) > redirect(URL(r=request, f='index')) > return dict(form=form) > > Error 1: > SyntaxError: SQLSet: no tables selected > at line > for pr in db().select(db.priority.name): > > Error 2: > I changed the insert line into the below: > > db.cases.insert(title="test title", priority=1, created_by=12, > description="test description") > > 1 & 12 are the IDs in the respective tables in google datastore > > and I get this error: > > str(obj)[11:].strip().split(':')[:3]] > ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16792] Re: help with multiple foreign keys on the same table
On Feb 20, 4:16 pm, mdipierro wrote: > Sorry, try: > > src=db.hosts.with_alias('src') > dst=db.hosts.with_alias('dst') > rows=db().select(src.ALL,dsl.ALL,left=[src.on > (db.transmissions.src==src.id), dst.on(db.transmissions.dst==dst.id)]) > print rows the first one works. Thanks a lot. A. > > and > > src=db.hosts.with_alias('src') > dst=db.hosts.with_alias('dst') > rows=db().select(db.transmission.ALL,src.ALL,dsl.ALL,left=[src.on > (db.transmissions.src==src.id), dst.on(db.transmissions.dst==dst.id)]) > print rows > > On Feb 20, 3:49 am, angleto wrote: > > > On Feb 19, 10:41 pm, mdipierro wrote: > > > > This should do it: > > > > src=db.hosts.with_alias('src') > > > dst=db.hosts.with_alias('dst') > > > rows=db(db.transmissions.src==src.id) > > > (db.transmissions.dst==dst.id).select(src.ALL, dst.ALL) > > > > print rows > > > Thanks Massimo, > > unfortunately does not works, > > the SQL generated is: > > > SELECT src.dns_hostname, dst.dns_hostname, transmissions.data FROM > > dst, src, transmissions WHERE (transmissions.src=src.id AND > > transmissions.dst=dst.id); > > meanwhile the correct line should be: > > SELECT src.dns_hostname, dst.dns_hostname, transmissions.data FROM > > hosts AS dst, hosts AS src, transmissions WHERE > > (transmissions.src=src.id AND transmissions.dst=dst.id); > > > in the controller I wrote: > > query=db(db.transmissions.src==src.id) > > (nws_db.transmissions.dst==dst.id).select(src.dns_hostname, > > dst.dns_hostname, transmissions.data) > > > Do you know where is the error? > > > thank you very much. > > Angelo > > > > On Feb 19, 2:57 pm, angleto wrote: > > > > > Hi, > > > > I have a db like this: > > > > > db.define_table("hosts", > > > > SQLField("dns_hostname", "string", notnull=True, > > > > default=None,unique=True)) > > > > > db.define_table("transmissions", > > > > SQLField("src", db.hosts), > > > > SQLField("dst", db.hosts), > > > > SQLField("data", "integer", notnull=True, default=None)) > > > > > db.transmissions.src.requires=IS_IN_DB(db, > > > > 'hosts.id','hosts.dns_hostname') > > > > db.transmissions.dsr.requires=IS_IN_DB(db, > > > > 'hosts.id','hosts.dns_hostname') > > > > > I'm unable to print the table transmissions resolving the foreign keys > > > > src and dst. > > > > Somebody can help me? > > > > thanks in advance > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16791] Re: New Appliance Submission: QrOne CSS Designer
fantastic! On Feb 19, 2:51 pm, blackthorne wrote: > hi > > I've been planning to work on this little application for a while but > only now I made it happen. > It's a port from a very simple CSS Designer that generates code for > you and allows you to keep visually updated on how it's going to look > on the fly. > > http://mdp.cti.depaul.edu/appliances/default/show/47 > > feedback is welcome! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16790] Re: CAS vs Auth
Integrated Authentication and Authorization Infrastructure systems tend to be very complex. The standard I suppose is defined by OASIS in the "Security Assertion Markup Language" (SAML http://en.wikipedia.org/wiki/SAML). An easy demo of the User-experience is given here: http://www.switch.ch/aai/demo/easy.html But the framework ("Shibboleth") is java and quite complex. Here is a list of software supporting SAML 2.0: http://docs.feide.no/fs-0048-1.3-en.html#txt-0078-SW-alternatives On Feb 22, 6:16 am, mdipierro wrote: > Right now they serve two distinct purpose. > > CAS does single sign on but no access control > > Auth does basic authentication and group based access control. > > It would be possible to implement authentication on CAS and/or > implement CAS using Auth. > > A more ambitious goal is to extend CAS to support distributed group > based access control. The CAS protocol does not provide that > functionality so we either have to invent a new protocol or do some > literature search on the topic and look for existing standard. > Whatever we do if you need group based access control, you cannot do > that with CAS. > > Massimo > > On Feb 21, 7:31 pm, DJ wrote: > > > Hi there, > > > I have used CAS previously for single-sign and it worked well. Whats > > recommended now? Auth or CAS? > > > I would like to have authentication to do record level edit/updates > > and have the same user login for multiple apps? Can I do this in Auth? > > > Thanks, > > Sebastian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16789] Re: URL & Controller question
IIRC routes.py will work even if you go through apache, albeit without handling virtualhosts. On Feb 23, 12:02 pm, cjparsons wrote: > 1. One way is to use the routes.py script in the web2py directory to > rewrite URLs, assuming you are using web2py's built in web server. > There are instructions in the script. Ask here again if you're not > sure > > 2. All functions are exposed in controllers except: > - any function that takes an argument e.g. myfunc(key): > - a function that starts with a double underscore e.g. __myfunc(): > > Chris > On Feb 23, 10:40 am, Joseph Jude wrote: > > > All, > > I'm just starting out with web2py. I have two questions: > > : the url is mapped out as /app/controller/function. so this looks > > like :http://domain/init/default/index. How to have url > > ashttp://domain/index? > > : as I understand from the docs, all functions in the controller > > (default.py) are exposed. is it possible to hide functions in the > > controller file or should I take such functions to another file? > > > Thank you, > > Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16788] Re: URL & Controller question
1. One way is to use the routes.py script in the web2py directory to rewrite URLs, assuming you are using web2py's built in web server. There are instructions in the script. Ask here again if you're not sure 2. All functions are exposed in controllers except: - any function that takes an argument e.g. myfunc(key): - a function that starts with a double underscore e.g. __myfunc(): Chris On Feb 23, 10:40 am, Joseph Jude wrote: > All, > I'm just starting out with web2py. I have two questions: > : the url is mapped out as /app/controller/function. so this looks > like :http://domain/init/default/index. How to have url ashttp://domain/index? > : as I understand from the docs, all functions in the controller > (default.py) are exposed. is it possible to hide functions in the > controller file or should I take such functions to another file? > > Thank you, > Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16787] URL & Controller question
All, I'm just starting out with web2py. I have two questions: : the url is mapped out as /app/controller/function. so this looks like : http://domain/init/default/index. How to have url as http://domain/index? : as I understand from the docs, all functions in the controller (default.py) are exposed. is it possible to hide functions in the controller file or should I take such functions to another file? Thank you, Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16786] web2py on gae - errors & questions
All, I'm trying out with web2py. It worked okay in the local web2py server; however when I tried with GAE (again local), I get few errors. Please help in resolving this. Thank you. Models db.define_table('status', SQLField('name')) db.define_table('priority', SQLField('name')) db.define_table('cases', SQLField('title'), SQLField('description', 'text', length=256), SQLField('status', db.status), SQLField('priority', db.priority), SQLField('created_by', db.auth_user), SQLField('created_time', 'datetime', default=now), SQLField('last_modified_by', db.auth_user), SQLField('last_modified_time', 'datetime', default=now) ) db.cases.priority.requires=IS_IN_DB(db, 'priority.id','priority.name') db.cases.created_by.required=IS_IN_DB(db, 'auth_user.id') db.cases.title.requires=[IS_NOT_EMPTY()] db.cases.description.requires=[IS_NOT_EMPTY()] controller == @auth.requires_login() def create(): priority_values=[] for pr in db().select(db.priority.name): priority_values.append(pr['name']) status_values=[] for st in db().select(db.status.name): status_values.append(st['name']) form=FORM(TABLE(TR("Title:",INPUT(_type="text",_name="title", requires=IS_NOT_EMPTY())), TR("Status:", status_values[0]), TR("Priority:", SELECT(priority_values,_name='priority', requires=IS_IN_SET(priority_values))), TR("Description:", TEXTAREA(_name='description')), TR("Created By:", auth.user.email), TR("",INPUT(_type="submit", _value="Create")) )) if form.accepts(request.vars, session): #insert into the record #dict index starts with 0; record id starts with 1 db.cases.insert(title=form.vars.title, status=1, priority=priority_values.index(form.vars.priority)+1, description=form.vars.description,created_by=auth.user.id, last_modified_by=auth.user.id) redirect(URL(r=request, f='index')) return dict(form=form) Error 1: SyntaxError: SQLSet: no tables selected at line for pr in db().select(db.priority.name): Error 2: I changed the insert line into the below: db.cases.insert(title="test title", priority=1, created_by=12, description="test description") 1 & 12 are the IDs in the respective tables in google datastore and I get this error: str(obj)[11:].strip().split(':')[:3]] ValueError: invalid literal for int() with base 10: '' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16785] Re: DAL mssql DSN connection
thank you both, I will begin my test tomorrow as today I am out for a demo presentation. I will let you know asap, carlo On 23 Feb, 02:29, mdipierro wrote: > Hi Carlo, > > I added experimental DB2 support to sql.py (in trunk now). > > 1) make sure you have pyodbc > 2) download the trunk > 3) run > > cd gluon > python sql.py 'db2:DSN=myAS400;UID=myUID;PWD=myPWD' > > Let me know what happens. Please email me personally. > > Massimo > > On Feb 22, 9:47 am, carlo wrote: > > > I am going to port an application developed in Karrigell to web2py: > > RDBMS was DB2 on as400. > > > In my actual version I connected through DSN and pyodbc this way: > > > db400=pyodbc.connect("DSN=myAS400;UID=myUID;PWD=myPWD") > > > How can I get a DSN connection through SQLDB? thank you > > > carlo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:16784] Re: Hierarchical object
> all trees have a root. Create a dummy root object. I think this is the right answer. Thanks Massimo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---