[web2py:12430] Re: have multiple button summits which work on different things in a form

2008-11-23 Thread mdipierro
for FORM you can do: if form.accepts(): if request.vars.submit1: do_task1 elif request.vars.submit1: do_task2 elif request.vars.submit1: do_task3 or if request.vars.submit1 and form.accepts(...): do_task1 if request.vars.submit2 and form.accepts(...

[web2py:12429] have multiple button summits which work on different things in a form

2008-11-23 Thread somebody
def form(): form=FORM(TABLE(""), TR(" ",INPUT (_name="submit1",_type="submit",_value="SUBMIT")), TR(" ",INPUT (_name="submit2",_type="submit",_value="SUBMIT")), TR("",INPUT(_name="submit3", _type="submit",_value="SUBMIT")), TR(" ",INPUT(_name

[web2py:12428] Re: Updating unique fields -a discussion

2008-11-23 Thread mdipierro
Actually this does not happen with SQLFORM since it is smart enough to figure out that the current record should be included when enforcing IS_NOT_IN_DB(...). In your case I see you are using a normal FORM instead of SQLFORM. In this case the solution is IS_NOT_IN_DB(db(db.users.id!=user_id),'us

[web2py:12427] Updating unique fields -a discussion

2008-11-23 Thread voltron
Hi all, I allow users to edit their account settings in a web application. One of the fields is their email address. I put a constraint on the field stating that it should never be empty, null and unique. I came across the situation that a user might want to change her/his email address, the prob

[web2py:12426] Re: form element classes

2008-11-23 Thread mdipierro
You can do TAG.SPAN(...) instead of SPAN() and TAG works for any TAG including user defined TAG.OPTGROUP() upper or lower case is the same. Massimo On Nov 23, 10:58 pm, mmstud <[EMAIL PROTECTED]> wrote: > I need optgroup and caption elements on my forms, so i had to add them > to htm

[web2py:12425] Re: T2 Registering

2008-11-23 Thread mdipierro
table.exposes is not a web2py attributes, but a T2 attribute. If you do not use T2 you use SQLFORM(...fields=[]) If you use T2 you you do not call SQLFORM explicitly so you set the fields using exposes. T2 does SQLFORM(,fields=table.exposes) On Nov 23, 10:52 pm, mmstud <[EMAIL

[web2py:12424] form element classes

2008-11-23 Thread mmstud
I need optgroup and caption elements on my forms, so i had to add them to html.py, but wouldnt it be nice to have all standard elements supported by web2py? http://www.htmlhelp.com/reference/html40/alist.html --~--~-~--~~~---~--~~ You received this message becaus

[web2py:12423] Re: T2 Registering

2008-11-23 Thread mmstud
On Nov 24, 3:40 am, mdipierro <[EMAIL PROTECTED]> wrote: > db.t2_person.exposes=['name','email','password'] ## add the fields you > need. What is the difference between exposes=[] and SQLFORM(fields=[]), btw? > > On Nov 23, 6:22 pm, Oscar <[EMAIL PROTECTED]> wrote: > > > Which is the best way of

[web2py:12422] Re: "unrecoverable" error with GAE from Vimeo tutorial

2008-11-23 Thread mdipierro
I suggest always using this: http://mdp.cti.depaul.edu/examples/default/download Experienced users who want to help with tests should get the development version. Massimo On Nov 23, 10:17 pm, "Yarko Tymciurak" <[EMAIL PROTECTED]> wrote: > On Sun, Nov 23, 2008 at 8:56 PM, hoben <[EMAIL PROTECTE

[web2py:12421] Re: Unable to determine what to delete

2008-11-23 Thread mdipierro
This query > db((db.table1.data == data) & (db.table2.table1_id == > db.table1.id)).delete() involves two tables therefore it is well defined in a select (it is a join) but not in a delete. You can only delete if a query involves a single table. Massimo On Nov 23, 8:48 pm, Tari <[EMAIL PROTECT

[web2py:12420] Re: "unrecoverable" error with GAE from Vimeo tutorial

2008-11-23 Thread Yarko Tymciurak
On Sun, Nov 23, 2008 at 8:56 PM, hoben <[EMAIL PROTECTED]> wrote: . > > Where can I get the latest version of web2py? The one I have was > downloaded from here: http://mdp.cti.depaul.edu/examples/default/download > ("source code"). Should I be using "latest development snapshot"? > The latest

[web2py:12419] Unable to determine what to delete

2008-11-23 Thread Tari
Hi, I would really appreciate help with this one: db((db.table1.data == data) & (db.table2.table1_id == db.table1.id)).delete() This condition works quite OK in a select, but how can I delete these rows? Instead deleting the appropriate rows from both tables, py gives me an "Unable to determine

[web2py:12418] Re: "unrecoverable" error with GAE from Vimeo tutorial

2008-11-23 Thread hoben
Thanks! The thing that convinced me to use web2py was a claim that the support in the google group was extremely fast - apparently it's true. Where can I get the latest version of web2py? The one I have was downloaded from here: http://mdp.cti.depaul.edu/examples/default/download ("source code").

[web2py:12417] Re: "unrecoverable" error with GAE from Vimeo tutorial

2008-11-23 Thread mdipierro
Hi Hoben, The error here is that ctypes is missing therefore uuid.uddi4 is not working. This is probably because you are using python2.6 but dev_appserver is supposed to run on Python2.5. I suggest you reinstall 2.5 and the the google stuff. I also noticed you are running an older version of we

[web2py:12416] Re: T2 Registering

2008-11-23 Thread mdipierro
db.t2_person.exposes=['name','email','password'] ## add the fields you need. On Nov 23, 6:22 pm, Oscar <[EMAIL PROTECTED]> wrote: > Which is the best way of hide registration key field? > > Thank you! > > Oscar. > > On 24 nov, 11:34, mdipierro <[EMAIL PROTECTED]> wrote: > > > Now I understand. Yo

[web2py:12415] "unrecoverable" error with GAE from Vimeo tutorial

2008-11-23 Thread hoben
I tried working through the Vimeo tutorial. Everything worked fine until I tried to deploy locally with dev_appserver.py. It's giving me "Internal error; Ticket issued: unrecoverable" Here is the debug from the terminal. I'm just trying to figure out how to get a basic web2py app deployed on GAE

[web2py:12414] Re: GAE: JOIN

2008-11-23 Thread mdipierro
Mind that will not work on GAE. GAE does not support Joins. Massimo On Nov 23, 6:21 pm, Oscar <[EMAIL PROTECTED]> wrote: > Thank you! > > I will review these! > > Oscar. > > On 24 nov, 11:48, mdipierro <[EMAIL PROTECTED]> wrote: > > > There is a section of the book on many-to-many. You can also

[web2py:12413] Re: T2 Registering

2008-11-23 Thread Oscar
Which is the best way of hide registration key field? Thank you! Oscar. On 24 nov, 11:34, mdipierro <[EMAIL PROTECTED]> wrote: > Now I understand. You found a bug in t2! Thank you. > > The string length defaults to 32. A uuid is longer so those fields > should have a length of 64. > Works on

[web2py:12412] Re: GAE: JOIN

2008-11-23 Thread Oscar
Thank you! I will review these! Oscar. On 24 nov, 11:48, mdipierro <[EMAIL PROTECTED]> wrote: > There is a section of the book on many-to-many. You can also look at > the examples in the pyworks2008 talk (on the web site) If this does > not answer the question I will rewrite the example you po

[web2py:12411] Re: Python newbie question about deployment server requirements

2008-11-23 Thread mdipierro
webfaction works with web2py. follow the instructions for cherrypy 3 Massimo On Nov 23, 10:54 am, SystemicPlural <[EMAIL PROTECTED]> wrote: > Thanks > > I've decided to go with Webfaction for now. only $11 a month and it is > a better deal than my current service - which I am not happy with for

[web2py:12410] Re: Date

2008-11-23 Thread mdipierro
1) class="date" will do what you ask, same for 'time' and 'datetime'. 2) db.event.vandatum.requires=IS_DATE(T("%Y-%m-%d')) then use the languages tab to create an en.py translation file (or en- en.py) and translate "%Y-%m-%d" into "%d/%m/%Y" 3) totdatum==vandatum + dagen should be totdatum=IS

[web2py:12409] Re: Python newbie question about deployment server requirements

2008-11-23 Thread SystemicPlural
Thanks I've decided to go with Webfaction for now. only $11 a month and it is a better deal than my current service - which I am not happy with for service reasons. If it works out I'll move my other stuff there as well. Thanks for everyones help. On Nov 23, 12:09 pm, Jonathan Benn <[EMAIL PROT

[web2py:12408] Re: GAE: JOIN

2008-11-23 Thread mdipierro
There is a section of the book on many-to-many. You can also look at the examples in the pyworks2008 talk (on the web site) If this does not answer the question I will rewrite the example you posted. Massimo On Nov 23, 10:33 am, Oscar <[EMAIL PROTECTED]> wrote: > Hi, > > How I can reproduce this

[web2py:12407] Re: GAE: JOIN

2008-11-23 Thread Oscar
Sorry I missed the link: http://blog.arbingersys.com/2008/04/google-app-engine-one-to-many-join.html (one-to-many) On 24 nov, 11:33, Oscar <[EMAIL PROTECTED]> wrote: > Hi, > > How I can reproduce this with Web2Py and T2: > > http://blog.arbingersys.com/2008/04/google-app-engine-better-many-to-.

[web2py:12406] Re: T2 Registering

2008-11-23 Thread mdipierro
Now I understand. You found a bug in t2! Thank you. The string length defaults to 32. A uuid is longer so those fields should have a length of 64. Works on sqlite because sqlite ignores length. You should not make the ristration key editable/visible in forms. it is used for email verification of

[web2py:12405] GAE: JOIN

2008-11-23 Thread Oscar
Hi, How I can reproduce this with Web2Py and T2: http://blog.arbingersys.com/2008/04/google-app-engine-better-many-to-many.html (many-to-many) Or (one-to-many) Regards. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[web2py:12404] Re: Appengine / Bulk Loader

2008-11-23 Thread Daniel Contag
Hi Massimo, with your change, nothing at all gets imported. I can see that using StringIO.StringIO is more pythonic than my hack but I'm at a loss as to why the table that worked before now doesn't get filled. Daniel On Sun, Nov 23, 2008 at 16:30, mdipierro <[EMAIL PROTECTED]> wrote: > > Can y

[web2py:12403] Date

2008-11-23 Thread annet
I am working on an event list, which is based on the following model: db.define_table('event', SQLField('bedrijf', db.bedrijf, notnull=True), SQLField('event', length=50, notnull=True), SQLField('vandatum', type='date', notnull=True,), SQLField('totdatum', type='date', notnull=Tr

[web2py:12402] Re: T2 Registering

2008-11-23 Thread Oscar
Ok, Sorry, some times my english isn't uderstandable. I explain again: I have a T2 project with t2_person table extended with some fields, so this tables come by default with a field named registration key, when I try to add a new record with this field not exposed nor displayed the app returns

[web2py:12401] Re: Appengine / Bulk Loader

2008-11-23 Thread mdipierro
Can you try instead import StringIO db.yourtable.import_from_csv_file(StringIO.StringIO(your_csv_string)) and see what happens? Booleans should be T/F not 1/0. Massimo On Nov 23, 8:23 am, "Daniel Contag" <[EMAIL PROTECTED]> wrote: > Hi everyone, some progress has been made... :) > > Adding thi

[web2py:12400] Re: T2 Registering

2008-11-23 Thread mdipierro
sorry. I do not understand the problem. Could you give us more details. Massimo On Nov 22, 11:05 pm, Oscar <[EMAIL PROTECTED]> wrote: > Hi, > > I getting an error about registration at T2_Person table, validation > says that string is so long ¿? I don't know why I'm getting this issue > because

[web2py:12399] Re: "No databases in this application" on GAE

2008-11-23 Thread mdipierro
appadmin needs to be improved. Right now it expects a SQL string and dumbly passes it to the DB. The string should be parsed and passed to the DAL instead. Massimo On Nov 22, 10:08 pm, Jonathan Benn <[EMAIL PROTECTED]> wrote: > Hi Massimo, > > On Nov 22, 10:15 am, mdipierro <[EMAIL PROTECTED]> w

[web2py:12398] Re: Return only one dict to the view?

2008-11-23 Thread Mark Larsen
Just return a dict of dicts --> return dict(dict1={'one':1,'two':2},dict2={3:'three',4:'four'}, dict3={'hi':'mom'}) > Yes, I realized this is a python issue, and found my python manual > telling me that I could combine several dicts in the return statement > by making a tuple out of them, just

[web2py:12397] Re: Appengine / Bulk Loader

2008-11-23 Thread Daniel Contag
Hi everyone, some progress has been made... :) Adding this to gql.py I am able to import tables that contain strings. However I receive a type error when importing a table that has a column of type boolean. The code: contrib/gql.py class SQLTable(SQLStorage): [..] def import_from_csv_string(se

[web2py:12396] Re: Python newbie question about deployment server requirements

2008-11-23 Thread Jonathan Benn
Hi Systemic, On Nov 22, 11:11 pm, SystemicPlural <[EMAIL PROTECTED]> wrote: > Thinking about learning python for a new project as it looks > v.interesting. (currently a .net and php developer) > I am trying to workout what kind of requirements the deployment server > will need. My current servi

[web2py:12395] Re: Appengine / Bulk Loader

2008-11-23 Thread Daniel Contag
Make that .import_from_csv_file ... Sorry. Daniel On Sun, Nov 23, 2008 at 12:55, Daniel Contag <[EMAIL PROTECTED]> wrote: > Hm, so it *should* work. Weird. > > This is the error when trying > > " > try: >from google.appengine.api import urlfetch > except: >pass > else: >url = "http:/

[web2py:12394] Re: Appengine / Bulk Loader

2008-11-23 Thread Daniel Contag
Hm, so it *should* work. Weird. This is the error when trying " try: from google.appengine.api import urlfetch except: pass else: url = "http://abc/db_hoersaal.csv"; result = urlfetch.fetch(url) if result.status_code == 200: db.table_one.import_from_csv_string(result.