[web2py:23875] Re: how to prevent deletion of referenced records

2009-06-10 Thread annet
Massimo, I am using Postgres. In my application I have these tables: db.define_table('provincie', SQLField('provincie',label='Provincie * ',length=18,default='',notnull=True,unique=True), migrate=False) db.provincie.provincie.requires=[IS_LENGTH(18,error_message=T('length exceeds 18')),

[web2py:23874] Re: how to prevent deletion of referenced records

2009-06-10 Thread Joe Barnhart
I don't think it is something you need to add to web2py. This is really a workaround for sqlite because it doesn't respect the normal keywords of ON DELETE RESTRICT or CASCADE. It's a simple enough work- around that is added to the model file for sqlite but not the other databases. On Jun 10, 7

[web2py:23873] Re: sqllite web2py gen question

2009-06-10 Thread Fran
On Jun 11, 6:42 am, durga wrote: > I am developing a website with web2py and sqllite. I am expecting no. > of users of the site would increase to 50k. My question is  would the > sqllite in web2py  support for 50k users or I need to migrate to > mysql. The database would contain user information,

[web2py:23872] sqllite web2py gen question

2009-06-10 Thread durga
Hi, I am developing a website with web2py and sqllite. I am expecting no. of users of the site would increase to 50k. My question is would the sqllite in web2py support for 50k users or I need to migrate to mysql. The database would contain user information, messages and some blogs. thanks durg

[web2py:23871] Re: Custom Display Values

2009-06-10 Thread Hans Donner
Nice, > can be done with {{=form.custom.submit}} and if you want to add the delete? checkbox {{=form.custom.deletable}} On Thu, Jun 11, 2009 at 7:12 AM, mdipierro wrote: > > done but it is now > > {{=form.custom.form.begin}} > {{=form.custom.widget.field1}} > {{=form.custom.widget.field2}} >

[web2py:23870] Re: Custom Display Values

2009-06-10 Thread Horst Herb
On Thu, Jun 11, 2009 at 3:12 PM, mdipierro wrote: > > done but it is now > > {{=form.custom.form.begin}} > {{=form.custom.widget.field1}} > {{=form.custom.widget.field2}} > {{=form.custom.widget.field3}} > > {{=form.custom.form.end}} includes hidden fields! Fantastic! That's easy and intuitive a

[web2py:23869] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-10 Thread mdipierro
I did not receive your patch but if you now do: auth.settings.login.methods=[ldap_login(..)] then it does not store password in db and always requres ldap auth. If you do: auth.settings.login.methods=[ldap_login(..), auth] same as above but does store password in db. if you do auth.sett

[web2py:23868] Re: Custom Display Values

2009-06-10 Thread mdipierro
done but it is now {{=form.custom.form.begin}} {{=form.custom.widget.field1}} {{=form.custom.widget.field2}} {{=form.custom.widget.field3}} {{=form.custom.form.end}} includes hidden fields! Massimo On Jun 10, 11:27 pm, Hans Donner wrote: > > You only need widgets > > > > > {{=form.custom.wid

[web2py:23867] Re: Custom Display Values

2009-06-10 Thread Hans Donner
> You only need widgets > > > {{=form.custom.widget.field1}} > {{=form.custom.widget.field2}} > {{=form.custom.widget.field3}} > > {{=form.hidden_fields()}} > better is to use {{=form.start}} in stead of , this will take over any actions/methods etc that are used in the SQLFORM, and for now {{

[web2py:23866] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-10 Thread mr.freeze
I just sent you another (very simple) patch that forces auth to use the alternative login methods if present so, for example, LDAP will be queried each time. On Jun 9, 11:30 pm, mdipierro wrote: > Thanks! > > On Jun 9, 11:03 pm, "mr.freeze" wrote: > > > > > Massimo, you should have a patch in e

[web2py:23865] Re: problem with selfreference left outer join

2009-06-10 Thread Peter Etchells
Thanks, that worked! On Jun 10, 2:12 am, mdipierro wrote: --~--~-~--~~~---~--~~ 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 fr

[web2py:23864] Re: Custom Display Values

2009-06-10 Thread mdipierro
Now I understand the problem better. No problem. widget is always an input widget. Output widgets are called "represent" and usually much simpler. This will do what you want: db.location.town_id.represent=lambda id: SPAN(db.town[id].townname) Massimo On Jun 10, 9:28 pm, Gary wrote: > Massimo

[web2py:23863] Re: Using count in a where clause

2009-06-10 Thread mdipierro
I understand. You do not want to use count then db(...).select(...,limitby=(0,100)) will fetch the first 100 records. Massimo On Jun 10, 8:02 pm, "A. C. Censi" wrote: > In Oracle you can use rowcount, for example, select * from table where > rowcount<200 > > In sql server I think you can set a

[web2py:23862] Re: how to prevent deletion of referenced records

2009-06-10 Thread mdipierro
Got a little lost. Sorry. If you want me to implement this please summarize the result and give an example of API and an example of the SQL that should be generated. Massimo On Jun 10, 6:52 pm, Joe Barnhart wrote: > Here it is: > > http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers > > I

[web2py:23861] Re: Form validation causes checkbox to get selected

2009-06-10 Thread mdipierro
You are correct. I fixed it and I am uploading to trunk now (launchpad 904). Massimo On Jun 10, 5:52 pm, DJ wrote: > Hello, > > I see a strange behavior when I try to validate a FORM. If there is a > required field that is left empty Web2PY throws a "Cannot be empty" > error message (good behav

[web2py:23860] Re: Custom Display Values

2009-06-10 Thread Gary
Massimo, I was so excited that the 'widget' worked that I failed to notice that I have the same problem that I started with - except the code is much cleaner. :-) When the crud read is executed, the valued returned is the value in the table. While this is fine for most fields, when the field i

[web2py:23859] Re: Custom Display Values

2009-06-10 Thread Gary
Massimo, Thank you. You mentioned before that widget worked in the trunk - you are, of course correct, but I just wanted to make note to others that it fails in the current version 1.63.5. Also, {{=form.custom.labels [fieldname]}} did not work in the trunk. It failed with "TypeError: 'NoneType

[web2py:23858] Re: Using count in a where clause

2009-06-10 Thread A. C. Censi
In Oracle you can use rowcount, for example, select * from table where rowcount<200 In sql server I think you can set a rowcount: SET ROWCOUNT 100 (or whatever) then do your query SET ROWCOUNT 0 - sets it back to normal In other I don't know. A. C. Censi On Wed, Jun 10, 2009 at 7:05 PM, mdipie

[web2py:23857] Re: how to prevent deletion of referenced records

2009-06-10 Thread Joe Barnhart
Here it is: http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers I got this from carlo who mentioned it in this group earlier. His post: http://groups.google.com/group/web2py/browse_thread/thread/2f19933298d64478/302d7442d1bec4e1?lnk=gst&q=sqlite+trigger#302d7442d1bec4e1 On Jun 10, 2:04 pm

[web2py:23856] Form validation causes checkbox to get selected

2009-06-10 Thread DJ
Hello, I see a strange behavior when I try to validate a FORM. If there is a required field that is left empty Web2PY throws a "Cannot be empty" error message (good behavior). But along with this, the checkbox fields in the form also get selected even though they were left unchecked (unwanted act

[web2py:23855] Re: Using count in a where clause

2009-06-10 Thread mdipierro
I do not think that is possible but I may be wrong. If you teach how to do it in SQL I will tell you how to translate in web2pyese. Massimo On Jun 10, 3:18 pm, Marcos Prieto wrote: > Hi, > > I'm trying to do a query in which I use select() with count and > groupby > > db().select(field1, field

[web2py:23854] Re: windows service problem in 1.63 (source)

2009-06-10 Thread mdipierro
I am planning to release 1.64 tomorrow if nothing comes up. Massimo On Jun 10, 4:32 pm, Philip Kilner wrote: > Hi Massimo, > > 2009/6/10 mdipierro : > > > This is already fixed in trunk. Thanks for bringing it up. > > Any objection to my adding a note to the AlterEgo page to help until > that m

[web2py:23853] Re: Login_next

2009-06-10 Thread mdipierro
Actually keepvalues=True only works and makes sense for create forms. Massimo On Jun 10, 3:55 pm, Fran wrote: > On Jun 10, 7:48 pm, mdipierro wrote: > > > I do not think this is creating the problem. Crud is still redirecting > > UNLESS you set crud.settings.keepvalues=True. If this what you a

[web2py:23852] Re: Custom Display Values

2009-06-10 Thread mdipierro
On Jun 10, 3:49 pm, Gary wrote: > Massimo, > > Thank you so much for your feedback.  Most of the changes you > suggested certainly made the code simpler and easier to read, but I > have a couple of issues that I don't understand. > > 1) It appears that the line: > > getattr(crud,session.action)(d

[web2py:23851] Re: Controlling lazy T

2009-06-10 Thread mdipierro
If you run the code locally (whithout GAE) and click on [admin]/ [Languages]/[update languages] the string "Lazy subjects" will be added to the the language files. The problem may be that you need: subject=str(T('Lazy subjects')) Massimo On Jun 10, 3:27 pm, Carl wrote: > I am using web2py on

[web2py:23850] Using count in a where clause

2009-06-10 Thread Marcos Prieto
Hi, I'm trying to do a query in which I use select() with count and groupby db().select(field1, field1.count(), groupby=field2) but I'd like to be able to use the count column to limit the results, adding a where clause to the SQL, something like "where count > x" Is that possible? how? Than

[web2py:23849] Re: redirect

2009-06-10 Thread JohnMc
Massimo, Sorry for the delay. Work had me unplugged for a while. Hilights -- * trigger() just there to pop the form. * dwnld() I just took right out of your 'Rolling with...' document. * The jQuery set is on the input field and is bound to a double click. * The call to dwnld() is hardcoded for s

[web2py:23848] Re: windows service problem in 1.63 (source)

2009-06-10 Thread Philip Kilner
Hi Massimo, 2009/6/10 mdipierro : > This is already fixed in trunk. Thanks for bringing it up. > Any objection to my adding a note to the AlterEgo page to help until that makes it into a release? (Feels like a silly question - meaning that I think I should, unless that release will be RSN - but

[web2py:23847] Re: how to prevent deletion of referenced records

2009-06-10 Thread Joe Barnhart
Sqlite does offer triggers, tho. Is it possible to rewrite the ON DELETE...RESTRICT as a trigger and add it with pass-thru sql commands? On Jun 9, 6:56 am, carlo wrote: > Foreign key constraints are not implemented in Sqlite (although it > parses the command). > > See:http://www.sqlite.org/omit

[web2py:23846] Re: slides in keynote and ppt

2009-06-10 Thread Fran
On Jun 10, 8:12 pm, mdipierro wrote: > I posted the slides in Keynote format > http://www.web2py.com/examples/static/cookbook2.key.zip Works, but I don't have a Mac > and PowerPoint format > http://www.web2py.com/examples/static/cookbook2.ppt.zip 'Invalid request' F --~--~-~--~~--

[web2py:23845] Re: Login_next

2009-06-10 Thread Fran
On Jun 10, 7:48 pm, mdipierro wrote: > I do not think this is creating the problem. Crud is still redirecting > UNLESS you set crud.settings.keepvalues=True. If this what you are > doing? Yes, well done :) Can this be made to just take effect on 'update' not 'create' forms? (Didn't seem to work

[web2py:23844] Re: Custom Display Values

2009-06-10 Thread Gary
Massimo, Thank you so much for your feedback. Most of the changes you suggested certainly made the code simpler and easier to read, but I have a couple of issues that I don't understand. 1) It appears that the line: getattr(crud,session.action)(db[tablename],record) executes the crud call, bu

[web2py:23843] Controlling lazy T

2009-06-10 Thread Carl
I am using web2py on GAE. I am sending emails using GAE. I'd delimited the subject line with T ( ... ) and, you guessed it, GAE didn't like it at all. How can I have the subject string translated *before* the call to GAE's platform? example code: bSuccess = mail.send(to=to,subject=T('Lazy subj

[web2py:23842] Stuck again...

2009-06-10 Thread Jason Brower
I have this fancy little help from you guys... But I can't quite seem to work with the data the way I like. Basically, I want to display a list of all users that have similar tags that I do. So I would get something like this: Tag Name 1 -- Massimo -- Jukka -- Billy Tag Name 2 -- Massimo --

[web2py:23841] Re: global logging to file

2009-06-10 Thread mdipierro
Why do you need to cache the logging module? Is this only for speed? On Jun 10, 1:44 pm, Iceberg wrote: > After changing from FileHandler to RotatingFileHandler, now I think > the per-app log can be turned on by default (otherwise new comers > won't notice this good feature). > > The only thing

[web2py:23840] Re: web2py solution for debbuging with FirePHP/Firebug

2009-06-10 Thread mdipierro
How do you propose we include this in web2py? Should I just dump it in contrib? I have a feeling this should integrated with the logging function recently proposed (for that what is logged is also sent to firebug). What do you think? Massimo On Jun 10, 2:12 pm, sgtpep wrote: > Newer version upl

[web2py:23839] slides in keynote and ppt

2009-06-10 Thread mdipierro
I posted the slides in Keynote format http://www.web2py.com/examples/static/cookbook2.key.zip and PowerPoint format http://www.web2py.com/examples/static/cookbook2.ppt.zip Sould be nice if you could add slides about - IS_IN_DB - IS_NOT_IN_DB - form.custom.widget - CRON Massimo --~--~-

[web2py:23838] Re: web2py solution for debbuging with FirePHP/Firebug

2009-06-10 Thread sgtpep
Newer version uploaded and accessible by the link above. You can see screenshot of what you'll get: http://www.picamatic.com/view/3948659_109510221650-My-Desktop/ What's added: - skipping web2py debug messages (starts with "WEB2PY CRON") - situations: you have a page with self-submitting form or

[web2py:23837] Re: web2py perfomance

2009-06-10 Thread Alexey Nezhdanov
В сообщении от Wednesday 10 June 2009 22:45:02 mdipierro написал(а): > Most of what you proposed is already in trunk (althought in s lightly > different way). I added what was missing. > > Mind that it is not form.custom.widget.submit but form.custom.submit. Ok, thank you. Will have a look at the

[web2py:23836] Re: Login_next

2009-06-10 Thread mdipierro
Fran, I do not think this is creating the problem. Crud is still redirecting UNLESS you set crud.settings.keepvalues=True. If this what you are doing? Can you tell which lines causes the problem? Massimo On Jun 10, 1:41 pm, Fran wrote: > On Jun 10, 12:17 am, mdipierro wrote: > > > Please try

[web2py:23835] Re: web2py perfomance

2009-06-10 Thread mdipierro
Most of what you proposed is already in trunk (althought in s lightly different way). I added what was missing. Mind that it is not form.custom.widget.submit but form.custom.submit. Massimo On Jun 10, 11:10 am, Alexey Nezhdanov wrote: > Ok. > > Basically I'd like you to: > 1) apply 'inits2.dif

[web2py:23834] Re: global logging to file

2009-06-10 Thread Iceberg
After changing from FileHandler to RotatingFileHandler, now I think the per-app log can be turned on by default (otherwise new comers won't notice this good feature). The only thing I am still not sure is whether one can use logging and its FileHander (or RotatingFileHander) on GAE's readonly fil

[web2py:23833] Re: Login_next

2009-06-10 Thread Fran
On Jun 10, 12:17 am, mdipierro wrote: > Please try the version in trunk. No more request.env.referer. This was r897 right? This has caused problems for my app :/ I have pages which have a List at the top of the page (created by crud.select) & underneath a create form (created by crud.create).

[web2py:23832] Re: windows service problem in 1.63 (source)

2009-06-10 Thread mdipierro
This is already fixed in trunk. Thanks for bringing it up. Massimo On Jun 10, 12:08 pm, Philip Kilner wrote: > Hi Massimo, > > Apologies for the delay in following up. > > 2009/6/3 mdipierro : > > > If you start python from the web2py folder, can you do > > import gluon.winservice? > > If you s

[web2py:23831] Re: windows service problem in 1.63 (source)

2009-06-10 Thread Philip Kilner
Hi Massimo, Apologies for the delay in following up. 2009/6/3 mdipierro : > If you start python from the web2py folder, can you do > import gluon.winservice? > If you start python from the gluon folder can you do > import winservice? > Can you edit main and at the bottom insert > print os.getcwd

[web2py:23830] Re: windows service problem in 1.63 (source)

2009-06-10 Thread Philip Kilner
Hi Hans, 2009/6/3 Hans Donner : > > see the docstring in gluon.Winservice > it needs the win32 lib, to be installed seperately. > Yes - sorry, I should have mentioned that I have Mark Hammond's Win32 extensions installed. -- Regards, PhilK Email: p...@xfr.co.uk 'a bell is a cup...until it

[web2py:23829] Re: logging approach

2009-06-10 Thread cjparsons
I was involved in the older thread and went ahead used the logging module and haven't had any problems logging to file and to MySQL. I did a bit more research and think it's thread safe. But I haven't had many concurrent users so YMMV. Chris On Jun 9, 4:04 am, mdipierro wrote: > I forgot. Thanks

[web2py:23828] Re: Login_next

2009-06-10 Thread annet
Massimo, I tried the version in trunk. Problem solved, thanks! Kind regards, Annet --~--~-~--~~~---~--~~ 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@googlegr

[web2py:23827] Re: response.flash upgrade

2009-06-10 Thread annet
Before making this post ... > I think it is a good idea to substitute the current calendar with a > more straightforward one. I had a look at the dynarch site, the > calender we use in web2py has been moved to the 'old stuff' > section ... I also had a look at the new dynarch calendar and read t

[web2py:23826] Re: web2py perfomance

2009-06-10 Thread Alexey Nezhdanov
Ok. Basically I'd like you to: 1) apply 'inits2.diff' - it optimises SQLTable.__init__ and SQLField.__init__ 2) remove is_integer altogether and replace it everywhere with str(id).isdigit() 3) apply custom_widget.diff. This one is not perfomance related so please regard it as usual feature requ

[web2py:23825] Re: web2py perfomance

2009-06-10 Thread mdipierro
Alexey, I am lost with all the attachments. If there is something you want me to include please send me by email one patch that applies to the lastest trunk. I would not yet include lazy table evals just yet since I need to think more about it. I think there may be an easier way of doing but sinc

[web2py:23824] Re: Bing Api

2009-06-10 Thread mdipierro
I ported bingapi to web2py: http://www.reddit.com/r/programming/comments/8rdqz/use_bing_search_engine_from_web2py_try_it_here/ I changed it a bit so that it uses web2py's simplejson and web2py's fetch, so that it runs on GAE too. Not you can run on Google and search with Microsoft! Perverse, is

[web2py:23823] Bing Api

2009-06-10 Thread mdipierro
Add full web search capabilities to your app: http://www.reddit.com/r/programming/comments/8rajk/python_wrapper_on_bing_api/ they quote "Django" but this works great with web2py out of the box. Just copy "bingapi.py" into your app "modules" folder and import it. The file consists of 64 lines of

[web2py:23822] Re: Texteditor

2009-06-10 Thread mdipierro
yes. This is done in the admin interface, the htmledit.html view. On Jun 10, 6:48 am, "http://voakujobi.blogspot.com"; wrote: > That looks nice and easy to implement,but does anyone know if this > works with JQuery, since they both hook the onload event, (I think), > or is there a different meth

[web2py:23821] Re: web2py perfomance

2009-06-10 Thread Alexey Nezhdanov
On Wednesday 10 June 2009 16:31:31 AchipA wrote: > > > > So on my laptop try:except: function loses about 5% to regex - > > > > probably it depends on hardware/OS. > > > > > > Interesting, which python/platform are you using ? > > > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > > [GCC 4.2.3

[web2py:23820] Re: web2py perfomance

2009-06-10 Thread AchipA
> > > So on my laptop try:except: function loses about 5% to regex - probably > > > it depends on hardware/OS. > > > Interesting, which python/platform are you using ? > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Hm, is it perhaps 32bit ? Th

[web2py:23819] Re: Texteditor

2009-06-10 Thread http://voakujobi.blogspot.com
That looks nice and easy to implement,but does anyone know if this works with JQuery, since they both hook the onload event, (I think), or is there a different method Thanks in advance Victor On Jun 9, 5:46 pm, pk wrote: > oh thanks, it`s a cool tool. > > peter > > On 9 Jun., 18:16, annet wro

[web2py:23818] Re: web2py perfomance

2009-06-10 Thread Alexey Nezhdanov
On Wednesday 10 June 2009 12:40:44 AchipA wrote: > On Jun 10, 7:01 am, Alexey Nezhdanov wrote: > > I get these results (best timing): > >   try-variant: 10.24s > >   regex: 9.58s > > So on my laptop try:except: function loses about 5% to regex - probably > > it depends on hardware/OS. > > Interest

[web2py:23817] Re: global logging to file

2009-06-10 Thread Hans
WOW Iceberg! That should also work well for me. Thanks for sharing your solution idea! I'm going to try it later today. And I agree the 'uncomment me if you need app-logging' approach in combination with the per-application-log-file seems also to me the best (backward compatible, flexible). Since

[web2py:23816] Re: getHelperById ?

2009-06-10 Thread Hans Donner
Not quite, but has the same effect (hence the copy) for every component processed, it 'adds' the child components to the end of the processing que. So it searches layer by layer On Wed, Jun 10, 2009 at 10:29 AM, AchipA wrote: > > @massimo: thanks for the clarification, I just remember seeing > c

[web2py:23815] Re: web2py perfomance

2009-06-10 Thread AchipA
On Jun 10, 7:01 am, Alexey Nezhdanov wrote: > I get these results (best timing): >   try-variant: 10.24s >   regex: 9.58s > So on my laptop try:except: function loses about 5% to regex - probably it > depends on hardware/OS. Interesting, which python/platform are you using ? > And as Massimo po

[web2py:23814] Re: getHelperById ?

2009-06-10 Thread AchipA
@massimo: thanks for the clarification, I just remember seeing copy.copy-s there which mislead me. But does it work recursively ? @johnmc: I'm talking about server-side helpers, not browser-side html elements On Jun 10, 3:21 am, JohnMc wrote: > If form -- > > $('form').find('#whatever') > >

[web2py:23813] Re: how to prevent deletion of referenced records

2009-06-10 Thread Marco Prosperi
but can I manage warning messages for the user this way? I think could be preferable something at model level Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this grou