[web2py] Re: custom validation, was: Re: IS_IN_DB referencing linked tables

2010-09-08 Thread annet
Something like this in the controller: eventtyperows=db(db.event.eventtype==db.eventtype.id).\ select(db.event.eventtype,db.eventtype.eventtype,\ distinct=True,orderby=db.eventtype.eventtype) a=[e.event.eventtype for e in eventtyperows] b=[e.eventtype.eventtype for e in eventtyperows] fo

[web2py] How to insert only new items in db as fast as possible?

2010-09-08 Thread Miguel
Hi I have the following table: db.define_table("products", Field("categoryID", db.productCategory, writable=False, readable=False, requires=IS_IN_DB(db, "productCategory.id", "productCategory.name") ), # reference field Field("productName", 'string',length=512, default=None), Field("d

Re: [web2py] Reverse table look up in GAE

2010-09-08 Thread b vivek
Ok so if i have a table in my db named homepage as below:- -- id | data | --- 1 | vivek| -- 2 | andrew| --- Now if I want to retrieve only the last row .. i can do this homepage=db().select(db.homepage.ALL,orderby=

Re: [web2py] Reverse table look up in GAE

2010-09-08 Thread Andrew Thompson
On 9/9/2010 12:24 AM, b vivek wrote: Hi I wanted to retrieve the latest data entered in a table and thus used the below syntax for data look up homepage=db().select(db.homepage.ALL,orderby=~db.homepage.id ,limitby=(0,1)) This is expected to retrieve the last row enter

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 1:30 pm, mdipierro wrote: > > So maybe tonight do you want me to go through the manual and find all > > the missing datatypes and try to add them to the map? > > I would not stop you. ;-) > Here is a replacement data_type_map, it was shuffled a bit to put like types together for easie

[web2py] Reverse table look up in GAE

2010-09-08 Thread b vivek
Hi I wanted to retrieve the latest data entered in a table and thus used the below syntax for data look up homepage=db().select(db.homepage.ALL,orderby=~db.homepage.id,limitby=(0,1)) This is expected to retrieve the last row entered in the table homepage . While this works perfectly, it does not

Re: [web2py] Re: Routes.py on GAE

2010-09-08 Thread Miguel Goncalves
Hi Massimo Did you, by any chance, make any progress on this issue? Thanks Miguel On Tue, Sep 7, 2010 at 4:43 AM, mdipierro wrote: > Thanks for the reminder. I will look into this today. > > On Sep 7, 1:28 am, Miguel Goncalves wrote: > > Hi > > > > I guess this bug has not been fixed yet? >

[web2py] custom validation, was: Re: IS_IN_DB referencing linked tables

2010-09-08 Thread Andrew Thompson
On 9/7/2010 10:42 AM, mdipierro wrote: You cannot do a join in a IS_IN_DB IS_IN_DB(db((db.flockdata.flock==db.flocks.id)&(db.flockdata.house==db.houses.id)), db.flockdata.id, '%(houses.name)s')), and the format cannot contain a "." If I can build the validator a different way, is there a way

Re: [web2py] Re: CRUD RBAC problem

2010-09-08 Thread Alexey Nezhdanov
Sure On Thu, Sep 9, 2010 at 6:11 AM, mdipierro wrote: > No, it does not. It must be done in two queries. Can you send me the > patch by email? thanks. > > On Sep 8, 8:44 pm, Alexey Nezhdanov wrote: > > Updated version of the patch then. Includes case where there is no such > row > > ('create' a

[web2py] Re: web2py_vs_others missing T() section!

2010-09-08 Thread mdipierro
thanks. can you take charge and post it on a google doc? I can help editing. On Sep 8, 9:08 pm, weheh wrote: > Here's the text of the pdf document, courtesy one of my websites, > YAKiToMe!http://www.yakitome.com. > > --- > > web frameworks design comparison > draft - pleas

[web2py] Re: CRUD RBAC problem

2010-09-08 Thread mdipierro
No, it does not. It must be done in two queries. Can you send me the patch by email? thanks. On Sep 8, 8:44 pm, Alexey Nezhdanov wrote: > Updated version of the patch then. Includes case where there is no such row > ('create' action). > However, I'm not sure if these changes are GAE-compartible.

[web2py] Re: web2py_vs_others missing T() section!

2010-09-08 Thread weheh
Here's the text of the pdf document, courtesy one of my websites, YAKiToMe! http://www.yakitome.com. --- web frameworks design comparison draft - please help me improve it focus on Model-View-Controller frameworks Controllers In Rails class MyTestController < Application

Re: [web2py] Re: CRUD RBAC problem

2010-09-08 Thread Alexey Nezhdanov
Updated version of the patch then. Includes case where there is no such row ('create' action). However, I'm not sure if these changes are GAE-compartible. Not sure if bigtable likes .belongs on multiple columns. Can anybody test? Regards Alexey. --- tools.py_ 2010-09-08 08:40:22.266751051 +0400

[web2py] Re: web2py_vs_others missing T() section!

2010-09-08 Thread mdipierro
Unfortunately I lost the source of that document and I have been unable to update it in more than 1 year. It would be great if somebody were to extract the text from pdf and post it on google code so that more of us can contribute and keep it updated. Actually I seem to remember somebody did that

[web2py] web2py_vs_others missing T() section!

2010-09-08 Thread Tom Campbell
I just learned about http://www.web2py.com/examples/static/web2py_vs_others.pdf on StackOverflow a few minutes ago so maybe this is old news, but the Internationalization section doesn't talk about web2py's elegant T() object. That section doesn't mention web2py at all! Just discovered web2py Fri

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
No but this idea can be extended and used to create a more complex widget using reference fields. On Sep 8, 3:52 pm, geoff wrote: > This works for me now.  Indeed it was the formatting.  Probably on my > end. > > Of course this does not really solve an 'address' issue if an address is > more than

[web2py] hacking sf menu: how to make it ignore as menu items if they are in some

2010-09-08 Thread Jurgis Pralgauskis
If smb could take a look at https://web2py-gae-test.appspot.com/CodeByExample/default/topic_examples/115002/view I try to trick sf menu to pop up some info for me where user could set his preferences, or see the tree like stuff which involves LI's. but it hijacks my LI's and they become like me

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
PPS. perhaps the JS code should go in web2py_ajax.html and we should make this a default widget for list:integer and list:string types. Do we need a list:double also? Massimo On Sep 8, 3:47 pm, mdipierro wrote: > To try it. just drop in new empty app under models/ and access the > person table

Re: [web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread geoff
This works for me now. Indeed it was the formatting. Probably on my end. Of course this does not really solve an 'address' issue if an address is more than one field, which is the case for both myself and the original poster. In any case, that is a wonderful widget! Best, Geoff On Wed, 2010

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
ps. requires latest trunk code or you may get corrupted data in db. On Sep 8, 3:47 pm, mdipierro wrote: > To try it. just drop in new empty app under models/ and access the > person table using appadmin. > > On Sep 8, 3:45 pm, Massimo Di Pierro wrote: > > > perhaps this works > > >  db_list_str

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
To try it. just drop in new empty app under models/ and access the person table using appadmin. On Sep 8, 3:45 pm, Massimo Di Pierro wrote: > perhaps this works > >  db_list_string.py > 1KViewDownload > >

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread Massimo Di Pierro
perhaps this works def ListStringWidget(field,value,**attributes): _id = '%s_%s' % (field._tablename, field.name) _name = field.name if field.type=='list:integer': _class = 'integer' else: _class = 'string' requires = field.requires items=[LI(INPUT(_id=_id,_class=_class,

Re: [web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread geoff
This breaks, I believe formatting is the culprit. I was not able to fix it right away. On Wed, 2010-09-08 at 13:27 -0700, mdipierro wrote: > A little better: > > > def ListStringWidget(field,value,**attributes): > _id = '%s_%s' % (field._tablename, field.name) > _name = field.name >

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
> So maybe tonight do you want me to go through the manual and find all > the missing datatypes and try to add them to the map? I would not stop you. ;-) > There are > possibly some types that are not supported by web2py so not sure what > to do there. The other possible problem I see is fields

Re: [web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread geoff
Simply dropping this in does not appear to work, I am getting nothing where the widget ought to be. In any case, I don't think this is going to work for my case, as a simply storing mutltiple strings in a single field isn't what I need. I have another table with ~20 columns.. nutrition informatio

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
A little better: def ListStringWidget(field,value,**attributes): _id = '%s_%s' % (field._tablename, field.name) _name = field.name if field.type=='list:integer': _class = 'integer' else: _class = 'string' requires = field.requires items=[LI(INPUT(_id=_id,_class=_class,_name

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 11:56 am, mdipierro wrote: > I think I fixed these. One more try? > I did a temporary add of the key "longtext," to get it to run further and found a key error mediumtext which also is at end of line with a comma so the regular expression parsing the line pulls out "mediumtext," as th

[web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread mdipierro
How about this? def ListStringWidget(field,value,**attributes): _id = '%s_%s' % (field._tablename, field.name) _class = isinstance(field.type,str) and field.type or None _name = field.name requires = field.requires items=[LI(INPUT(_id=_id,_class=_class,_name=_name,value=v)) for

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 11:56 am, mdipierro wrote: > I think I fixed these. One more try? > > On Sep 8, 10:30 am, ron_m wrote: I think the re match still has a problem but it is closer. The fault is on a key error for "longtext," which should not be trying to match on the field type including the comma. Th

Re: [web2py] Re: Parent -> Child Models in a single form

2010-09-08 Thread geoff
Dominic, Could you give a high level overview of what is going on here and how you were able to implement the Parent -> Child model in a single form? Following your links, I wasn't able to discern where/if the input form was actually accepting values for multiple tables. I need similar functiona

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
I think I fixed these. One more try? On Sep 8, 10:30 am, ron_m wrote: > On Sep 8, 5:40 am, mdipierro wrote: > > > I think I fixed some of this in trunk. Could you print form me the > > line offending hit? If i see it I can fix the regular expression too. > > Thanks. > > I ran the new version fro

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 5:40 am, mdipierro wrote: > I think I fixed some of this in trunk. Could you print form me the > line offending hit? If i see it I can fix the regular expression too. > Thanks. > I ran the new version from trunk. The if hit!=None: line added at line 74 covers up the problem so now I ge

Re: [web2py] arbitrary delimiters in templates

2010-09-08 Thread Michele Comitini
great! 2010/9/8 mdipierro : > I just implemented arbitrary delimiters in web2py trunk. Now you can > do in a controller: > >    def render(filename,**variables): >        context = globals() >        context.update(variables) >        from gluon.template import render >        return > render(file

[web2py] Re: Debian Packaging

2010-09-08 Thread José L .
We're on September 8th, and no news from the packaging. Debian testing is frozen, which means that we won't see web2py in Debian stable before a year or two. I'd like to know if you keep on trying to do the packaging. Also, if you need help I can create a collaboration group for the packaging in a

[web2py] book editors

2010-09-08 Thread Massimo Di Pierro
If you have registered with the book app, you should now be able to edit it. Massimo

[web2py] arbitrary delimiters in templates

2010-09-08 Thread mdipierro
I just implemented arbitrary delimiters in web2py trunk. Now you can do in a controller: def render(filename,**variables): context = globals() context.update(variables) from gluon.template import render return render(filename=os.path.join(request.folder,'views',

[web2py] Re: web2py on gae

2010-09-08 Thread Peterle
Yes, the django-nonrel leader made a clear separation between micro- frameworks and the bigger ones (apps speed versus development speed and reusability) - On 8 Set, 14:45, Richard wrote: > seems you are referring to this > thread:http://groups.google.com/group/google-appengine-python/brows

[web2py] Re: Expando and Polymodel on GAE?

2010-09-08 Thread mdipierro
Can you please try again using latest trunk? Massimo On Sep 4, 7:13 pm, Dave wrote: > I tested this, and it does give all contacts when using > > > contacts = db(db.contact.id>0).select() > > Unfortunately, using > > > person = db(db.person.id>0).select() > > also returns all the contacts.  I

[web2py] Re: Logging unsuccessful logins

2010-09-08 Thread mdipierro
In trunk now: auth.settings.login_failed_log = "attempted failed login for email=% (email)s" On Sep 8, 5:04 am, Kenneth wrote: > Is there a way to log unseccessful logins, with username, tried > password and things like that? > > I´m having some problems with a couple of users not been able to

[web2py] Re: CRUD RBAC problem

2010-09-08 Thread mdipierro
I think this should be considered a bug and I agree with the change. Anybody opposed? Massimo On Sep 7, 11:46 pm, Alexey Nezhdanov wrote: > Hi. I think that I found some inconsistency in the topic. > When you do, say, > auth.add_permission(group_id) - it assumes the permission name 'any', table

[web2py] Re: web2py on gae

2010-09-08 Thread Richard
seems you are referring to this thread: http://groups.google.com/group/google-appengine-python/browse_thread/thread/fad46eb3745c39c2 On Sep 8, 10:25 pm, Peterle wrote: > considerations of.. > > > On 8 Set, 13:57, Peterle wrote: > > > google-appengine-python group, Google Appengine Python B

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
I think I fixed some of this in trunk. Could you print form me the line offending hit? If i see it I can fix the regular expression too. Thanks. On Sep 8, 3:03 am, ron_m wrote: > On Sep 7, 5:10 pm, mdipierro wrote: > > > If you have a mysql database running locally, please help me test it. > > F

[web2py] Re: Django Sentry

2010-09-08 Thread mdipierro
It would not be difficult to do something like this in web2py. All events are already in the auth_event table and tickets can be moved to db using scripts/tickets2db.py Any volunteers? On Sep 8, 3:24 am, Adi wrote: > http://github.com/dcramer/django-sentry > > Interesting way to track tickets a

[web2py] Re: Translate texts Email and Password in login page

2010-09-08 Thread mdipierro
You can still do db.auth_user.email.label=T('email') db.auth_user.password.label=T('password') Did you try this? On Sep 8, 4:53 am, Kenneth wrote: > I´m pretty sure this worked before but now i can´t get the texts Email > and Password translated on the login page. > > Kenneth

[web2py] Re: web2py on gae

2010-09-08 Thread Peterle
considerations of.. On 8 Set, 13:57, Peterle wrote: > google-appengine-python group, Google Appengine Python Best Framework: > what's about web2py? Interesting the valutations of Waldemar.

[web2py] web2py on gae

2010-09-08 Thread Peterle
google-appengine-python group, Google Appengine Python Best Framework: what's about web2py? Interesting the valutations of Waldemar.

Re: [web2py] Re: Permissions on records

2010-09-08 Thread Johann Spies
Thanks. That brings some light. I was trying to fit it into a controller. Regards Johann --     "Be not deceived; God is not mocked: for whatsoever a      man soweth, that shall he also reap."                                   Galatians 6:7

[web2py] Logging unsuccessful logins

2010-09-08 Thread Kenneth
Is there a way to log unseccessful logins, with username, tried password and things like that? I´m having some problems with a couple of users not been able to login. Or do you have some other ways/ideas to troubleshoot this? Kenneth

[web2py] Translate texts Email and Password in login page

2010-09-08 Thread Kenneth
I´m pretty sure this worked before but now i can´t get the texts Email and Password translated on the login page. Kenneth

[web2py] Django Sentry

2010-09-08 Thread Adi
http://github.com/dcramer/django-sentry Interesting way to track tickets and logs real-time.

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 7, 5:10 pm, mdipierro wrote: > If you have a mysql database running locally, please help me test it. > First problem I ran into Last line parameters are out of order on mysql() call so it outputs incorrect database URL string $ python scripts/extract_mysql_models.py user:p...@db_name use