[web2py:14656] SQLForm Level Validation -> Best Practices?

2009-01-07 Thread Manakel
Hello All, I'm just discovering web2py and i'm not able to wrap my mind about the Form level validation inside it. Let's say we talk about a defect. This defect has a "Fixing Date" (date where provider deliver the fixing code in integration system) and a "Closing Date" (date where the customer c

[web2py:14657] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread annet
Massimo, I added two lookup table to my application: db=SQLDB('sqlite://annet.db') db.define_table('shape', SQLField('name'), migrate='shape.table') db.define_table('color', SQLField('name'), migrate='color.table') db.define_table('shapecolor', SQLField('shapename'), SQLField('col

[web2py:14659] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread Fran
On Jan 7, 10:02 am, annet wrote: > when I comment out the last > validator, I have two drop boxes in the admin from which I can choose > a shape and a color and insert them into the database. However, when I > uncomment the two column unique constraint, the color drop box breaks, > it becomes a t

[web2py:14660] Re: Support for workflow?

2009-01-07 Thread Julius Minka
here, in my bookmarks, you can find some inspiration (design&code): http://delicious.com/jumi/workflow On Ut, 2009-01-06 at 22:43 -0800, Fran wrote: > On Jan 7, 3:04 am, mdipierro wrote: > > If you could come up with a reasonable list of specs and references I > > can try add that to T3. >

[web2py:14658] Re: SQLForm Level Validation -> Best Practices?

2009-01-07 Thread Fran
On Jan 7, 8:22 am, Manakel wrote: > But i don't understand how i can perform business level check when > using SQLForm > -> this may be real date , but it's a date in the future so i don't > allow the insertion/ update of the record (Business rules) > -> this may be a real date, and date is today

[web2py:14661] Re: Support for workflow?

2009-01-07 Thread Alexandre Miguel de Andrade Souza
Massimo, It is important to follow patterns. So, the best font is http://www.workflowpatterns.com/patterns/index.php See that many software implementations don't use all patterns. http://www.workflowpatterns.com/evaluations/opensource/index.php http://www.workflowpatterns.com/evaluations/comm

[web2py:14664] Re: web2py on dreamhost shell account?

2009-01-07 Thread Timothy Farrell
I have mine working like this: 1) Extract web2py to ~/web2py 2) Place the attached dispatch.fcgi in your webroot (~/www you said) 3) Modify dispatch.fcgi to point to the right directories in your situation 4) Place the attached htaccess file in your webroot.  (Make sure you rename it to .htacc

[web2py:14662] Re: Using threads to do re-occuring jobs

2009-01-07 Thread achipa
Sorry for the late response, been AFK for two weeks. As soon as I catch my breath I will post the latest iteration of my patch in the forum so people could comment/test it a bit before it gets included in the trunk. For documentation, currently I can post the emails we exchanged (if that's ok with

[web2py:14663] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread mdipierro
yes: def mywidget(field,value,options): id='%s_%s' % (field._tablename,field.name) else: raise SyntaxError, "widget cannot determine options" opts+=[OPTION(v,_value=k) for k,v in options] return SELECT(*opts,**dict(_id=id,_class=field.type, _name=field.name,v

[web2py:/] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread mdipierro
yes: def mywidget(field,value,options): id='%s_%s' % (field._tablename,field.name) else: raise SyntaxError, "widget cannot determine options" opts+=[OPTION(v,_value=k) for k,v in options] return SELECT(*opts,**dict(_id=id,_class=field.type, _name=field.name,v

[web2py:14667] Re: Using threads to do re-occuring jobs

2009-01-07 Thread mdipierro
Yes, free to post them. Massimo On Jan 7, 7:39 am, achipa wrote: > Sorry for the late response, been AFK for two weeks. As soon as I > catch my breath I will post the latest iteration of my patch in the > forum so people could comment/test it a bit before it gets included in > the trunk. For do

[web2py:14668] Re: SQLForm Level Validation -> Best Practices?

2009-01-07 Thread mdipierro
you need to define your own validators like class VALIDATOR: def __init__(self,...): pass def __call__(self,value): if valid value: return (value,None) else: return (value, error_message) On Jan 7, 2:22 am, Manakel wrote: > Hello All, > > I'm just discovering web2py and

[web2py:14670] Re: Cacheing makes web2py "forget" tenmplates sporadically

2009-01-07 Thread Timothy Farrell
The first argument in your cache decorator ( request.env.path_info ) is the key that the cache system uses to determine uniqueness.  If you have a form in your view, then you need to insert all levels of uniqueness into this key.  Perhaps something like this... cachekey = str(request.env.path_

[web2py:14669] Re: Cacheing makes web2py "forget" tenmplates sporadically

2009-01-07 Thread voltron
Thanks Massimo, The web2PY generic template is not displayed anymore. BUT I have a more serious problem, forms rendered in the cached view function are not validated and do not work anymore. Any ideas? Thanks On Jan 6, 5:55 pm, mdipierro wrote: > @voltron, > > ignore my original response. T

[web2py:14671] Re: Cacheing makes web2py "forget" tenmplates sporadically

2009-01-07 Thread mdipierro
Tim is right but I'd not cache a page that needs to process a form. Massimo On Jan 7, 8:42 am, Timothy Farrell wrote: > The first argument in your cache decorator ( request.env.path_info ) is the > key that the cache system uses to determine uniqueness. If you have a form > in your view, th

[web2py:14666] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread achipa
Fran, if you start working on a spatially aware DAL, please let me know so we could join forces or at least avoid code duplication. I have some spatial projects (none of them web2py at the moment) that I'm considering on migrating, but more serious spatial support would be needed for that, maybe e

[web2py:14672] Re: new template.py

2009-01-07 Thread DenesL
> parsing instead of using regular expressions. I was under the impression that you were using regex for speed, is parsing faster?. > 2) you use {{,}} inside strings as in > {{="hello {{ world }}" }} without running into trouble. Simpler = better. > 3) you can do > > {{ > for i in range(10): >

[web2py:14673] Re: Cacheing makes web2py "forget" tenmplates sporadically

2009-01-07 Thread DenesL
On Jan 7, 9:42 am, Timothy Farrell wrote: > The first argument in your cache decorator ( request.env.path_info ) is the > key that the cache system uses to determine uniqueness. If you have a form > in your view, then you need to insert all levels of uniqueness into this key. > Perhaps som

[web2py:14674] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread annet
Massimo and Fran, Thanks for your replies. I have used a widget only once, I'll give implementing it a try. Best regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To pos

[web2py:14675] Re: Cacheing makes web2py "forget" tenmplates sporadically

2009-01-07 Thread DenesL
Sorry, I was trying to read Tim's post, why can't I see his text past the right edge? --~--~-~--~~~---~--~~ 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:14676] Re: new template.py

2009-01-07 Thread mdipierro
On Jan 7, 9:25 am, DenesL wrote: > > parsing instead of using regular expressions. > > I was under the impression that you were using regex for speed, is > parsing faster?. I benchmarked it. In this case makes no difference. > > > 2) you use {{,}} inside strings as in > > {{="hello {{ world }}"

[web2py:14677] Re: Support for workflow?

2009-01-07 Thread BigBaaadBob
> > So, the best font ishttp://www.workflowpatterns.com/patterns/index.php > Oohh. Lots there, but I guess I was hoping for a Web2pyish simplest workflow api that could possibly work. ;-) --~--~-~--~~~---~--~~ You received this message because you are sub

[web2py:14678] Re: SQLForm Level Validation -> Best Practices?

2009-01-07 Thread Manakel
Wow, very fast answers :-) Can a custom validator get access to several fields of the Form? For example, if i make a checkClosingDate validator , how can my validator read both the ClosingDate (the date to validate) and the "Fixing Date" (support data) - in the creation case where Fixing date is

[web2py:14679] Re: Support for workflow?

2009-01-07 Thread Yarko Tymciurak
I just can't look at this thread..I have a rabbit's memory of falling down this hole once before, somewhere back in time... ...many, many patterns; rich topic; no good agreement from SME's on what is being solved, nor how to solve it (or if it's worth it); very open-ended feeling; in the end, n

[web2py:14680] Re: new template.py

2009-01-07 Thread mdipierro
I fixed a couple of things in the new template.py now it is 1ms slower then the old one (in average, both complex and simple pages that I have tested). Massimo On Jan 7, 9:56 am, mdipierro wrote: > On Jan 7, 9:25 am, DenesL wrote: > > > > parsing instead of using regular expressions. > > > I w

[web2py:14681] Re: new template.py

2009-01-07 Thread Timothy Farrell
1ms? Bah that's plenty of time to go get coffee while the webpage loads. mdipierro wrote: I fixed a couple of things in the new template.py now it is 1ms slower then the old one (in average, both complex and simple pages that I have tested). Massimo On Jan 7, 9:56 am, mdipierro wrote:

[web2py:14682] Re: SQLForm Level Validation -> Best Practices?

2009-01-07 Thread mdipierro
yes and no. a validator is uniquely associated to a field and validates that one field but it can validate depending on the values of other variables (request.vars) example: form=FORM('password:',INPUT(_name='password1',requires=IS_NOT_EMPTY ()), 'password again:',INPUT (_nam

[web2py:14683] access to id in t2 view

2009-01-07 Thread Julius Minka
using T2 http://127.0.0.1:8000/f7/default/display_ware/3 in controller: def display_ware(): ware=t2.display(db.ware) return dict(ware=ware) in HTML: {{extend 'layout.html'}} Tovar {{=ware}} {{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%request.args))}} How can I ma

[web2py:14684] Re: access to id in t2 view

2009-01-07 Thread mdipierro
It is already parsed for you by t2 and stored in t2.id=int(request.args [-1]) {{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%t2.id))}} Massimo On Jan 7, 10:29 am, Julius Minka wrote: > using T2 > > http://127.0.0.1:8000/f7/default/display_ware/3 > > in controller: > def display_ware():

[web2py:14685] Re: access to id in t2 view

2009-01-07 Thread Julius Minka
that was it, thanks for fast answer On St, 2009-01-07 at 08:34 -0800, mdipierro wrote: > It is already parsed for you by t2 and stored in t2.id=int(request.args > [-1]) > > {{=A(' Modify',_href=URL(r=request,f='modify_ware/%s'%t2.id))}} > > > Massimo > > On Jan 7, 10:29 am, Julius Minka wrot

[web2py:14686] Re: 1.55rc2 and Happy New Year.

2009-01-07 Thread Phyo Arkar
Dear Massimo; Dont worry , after this project done , (in 2 weeks) i will release web2py OS too. I had made a VM to use for this project , its with web2py and sliming it down , i can present you people with first release of web2py-vm. I will also need community help to make it evolve!. Regards,

[web2py:/] Re: 1.55rc4

2009-01-07 Thread Yarko Tymciurak
update on wsgiserver: - as of today, I received a suggestion on reverting to a specific changeset; this changeset (one line effect for us) has potential to address the issues we see in new server; - still plan to characterize more (tests, traces) before considering a change; look for request for

[web2py:14688] Re: new template.py

2009-01-07 Thread DenesL
Massimo, you still have a tab char instead of blanks in line 64 (rev 631). --~--~-~--~~~---~--~~ 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

[web2py:14689] Re: Support for workflow?

2009-01-07 Thread Alexandre Miguel de Andrade Souza
I sugest it only to get ideias, not to use everytthing. I agree that simplier is better. On Wed, Jan 7, 2009 at 2:14 PM, Yarko Tymciurak wrote: > I just can't look at this thread..I have a rabbit's memory of falling > down this hole once before, somewhere back in time... > ...many, many pat

[web2py:14690] Re: web2py on dreamhost shell account?

2009-01-07 Thread richard.ree
I followed your steps but got the following errors. 1. The .htaccess file causes this snippet of html to be returned for all requests: Error 2. When I run dispatch.fcgi unmodified, it bails with "ImportError: No module named fcgi" even though the import from gluon.contrib.gateways is successful (

[web2py:14691] Re: web2py on dreamhost shell account?

2009-01-07 Thread Timothy Farrell
Oops, I overlooked that last import in my attachment.  You were right to fix it how you did. Your step 3 tells me that it's working.  This is roughly what I get when I run mine.  Now it's just a matter of getting Apache to recognize your dispatch.fcgi.  Things to check: - permissions:   $ chm

[web2py:14692] Re: Support for workflow?

2009-01-07 Thread Yarko Tymciurak
On Wed, Jan 7, 2009 at 1:19 PM, Alexandre Miguel de Andrade Souza < alexandrema...@gmail.com> wrote: > I sugest it only to get ideias, not to use everytthing. > > I agree that simplier is better. > > On Wed, Jan 7, 2009 at 2:14 PM, Yarko Tymciurak wrote: > >> I just can't look at this thread.

[web2py:14693] default application page

2009-01-07 Thread Julius Minka
I have got following in controllers/default.py: response.menu=[ ['Tovar',False,t2.action('browse')], ['Odberatelia',False,t2.action('temp')]] def index(): return dict() when I go to http://127.0.0.1:8000/my_app/ it displays page views/default/index.html and in this page, it inserts "defaul

[web2py:14694] Re: web2py on dreamhost shell account?

2009-01-07 Thread richard.ree
The permissions checked out, but I still get the same error html snippet. The problem seems to be with the last line in .htacces: RewriteRule ^(.*)$ dispatch.fcgi/$1 [L] If I comment it out, I get the directory index where dispatch.fcgi and .htaccess are. Other content from ~/www is served ok,

[web2py:14695] Pre-populating Database with uploads inc sub-folders

2009-01-07 Thread Fran
I want to pre-populate the database with a whole bunch of images. Since the 'upload' field is fundamentally a string containing the filename I hoped to do so like this if I store the file in /uploads: db['%s' % table].insert( image="marker.png" ) This works in appadmin, but not in the

[web2py:14696] Re: web2py.exe can not start as windows service

2009-01-07 Thread Yarko Tymciurak
My Tests (continuing): with the latest trunk, on Winserver2003 - I can install, but I cannot start w/ either python or sc command line method - I got: StartService FAILED 1053: The service did not respond to the start of control request in a timely fashion. . Hmmm... On Tue, Jan 6, 2009 at

[web2py:14697] SQLFORM exposes id even fields specified

2009-01-07 Thread Robin B
When I try to create an edit form with SQLFORM, the form displays a id field labeled 'Record id', even when I specify fields=['name']. db.define_table('posts',SQLField('name','string',requires=IS_NOT_EMPTY ())) form = SQLFORM(db.posts,obj,fields=['name']) Record id: 3 Name: Is there a

[web2py:14698] example about group memberships and group based access control in t3

2009-01-07 Thread drayco
Hi, can you give a simple example about group memberships and group based access control in t3? Or how can i show or not some menu/submenu in t3? Can i do this whithout group memberships? --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[web2py:14699] Re: Pre-populating Database with uploads inc sub-folders

2009-01-07 Thread mdipierro
You need to rename your images. This is easy instead of myimage.png you can use gis_marker.image.myimage.png make sure "myimage" does not contain spaces or other special characters. web2py (T2/T3) needs to figure out from the image name which table and which field stores the reference to the im

[web2py:14700] Re: default application page

2009-01-07 Thread mdipierro
You need to use routes_in and routes_out there are examples in routes.examples.py On Jan 7, 2:54 pm, Julius Minka wrote: > I have got following in controllers/default.py: > > response.menu=[ > ['Tovar',False,t2.action('browse')], > ['Odberatelia',False,t2.action('temp')]] > > def index(): >r

[web2py:14701] Re: SQLFORM exposes id even fields specified

2009-01-07 Thread mdipierro
SQLFORM(showid=False) On Jan 7, 7:19 pm, Robin B wrote: > When I try to create an edit form with SQLFORM, the form displays a id > field labeled 'Record id', even when I specify fields=['name']. > > db.define_table('posts',SQLField('name','string',requires=IS_NOT_EMPTY > ())) > > form = SQLF

[web2py:14702] Re: example about group memberships and group based access control in t3

2009-01-07 Thread mdipierro
You cannot use access control for menu items in T3. If a page has "menu" checked and "public" check is always appears in menus. If a page has "menu" checked and "public" uncheck it will appear in menus only to authenticated users If a page has "menu" unchecked then it never appears in menus. You

[web2py:14703] Re: web2py.exe can not start as windows service

2009-01-07 Thread Iceberg
--- Original Message --- From:mdipierro > On Jan 5, 9:02 pm, Iceberg wrote: > > On Jan6, 5:26am, Fran wrote: > > > it's all working for me now with latest > > > src & your new winservice.py :) > > > All I see in Event Logs is: > > > web2py server star

[web2py:14704] Re: web2py.exe can not start as windows service

2009-01-07 Thread mdipierro
If anybody can figure out how to do that I have no objections. Actually I would prefer not to have the library.zip file. Massimo On Jan 7, 9:13 pm, Iceberg wrote: > --- Original Message --- > From:mdipierro > > On Jan 5, 9:02 pm, Iceberg wrote: > >

[web2py:14705] web2py 1.55 is out

2009-01-07 Thread mdipierro
We waited enough. To many changes to keep holding on. web2py 1.55 is out. Changelog: - many2many widget via tagging (IS_IN_DB(multiple=True) - delete and update return number of affected rows - better unittests - you can next cache calls (like cache a controller that caches a select). Thanks

[web2py:14706] Multiple field index

2009-01-07 Thread ionel
Hello everybody, I am writing an application for a personal library. But now I need to build a multiple field index because I don't want duplicate records in my database. Can I do this with web2py? Thanks --~--~-~--~~~---~--~~ You received this message because

[web2py:14707] Re: Multiple field index

2009-01-07 Thread Wes James
Look at IS_NOT_IN_DB -wj On Wed, Jan 7, 2009 at 9:01 PM, ionel wrote: > > Hello everybody, > > I am writing an application for a personal library. But now I need to > build a multiple field index because I don't want duplicate records > in my database. Can I do this with web2py? > > Thanks -

[web2py:14708] Re: web2py 1.55 is out

2009-01-07 Thread Robin B
I am amazed at the rate that features are added. Any idea when github.com/web2py will be updated? Also web2py.com says 'Service Temporarily Unavailable'. Robin On Jan 7, 9:40 pm, mdipierro wrote: > We waited enough. To many changes to keep holding on. > > web2py 1.55 is out. > > Changelog: >

[web2py:14709] Re: web2py 1.55 is out

2009-01-07 Thread mr.freeze
Very nice! What is SQLFORM.widgets ? On Jan 7, 9:40 pm, mdipierro wrote: > We waited enough. To many changes to keep holding on. > > web2py 1.55 is out. > > Changelog: > - many2many widget via tagging (IS_IN_DB(multiple=True) > - delete and update return number of affected rows > - better u

[web2py:14710] Re: Support for workflow?

2009-01-07 Thread Alexandre Miguel de Andrade Souza
Massimo, You requested, so I try to resume the most important patterns: A proposal of a simple workflow specification: By Alexandre Andrade (alexandrema...@gmail.com) A workflow have some basic aspects: 1. Data – A work flow is about informations and decisions. Information is in data, r

[web2py:14711] Proposal for importing functions into controllers

2009-01-07 Thread Robin B
Controller functions taking arguments, or functions with an extra space like def index (): are hidden: http://groups.google.com/group/web2py/browse_thread/thread/35c15761dc3801e7/b0ee7945e272922e?lnk=gst&q=arguments+space+#b0ee7945e272922e This is good that you can hide functions somehow, but us

[web2py:14712] Proposal for application routes.py

2009-01-07 Thread Robin B
Proposal: if web2py/applications/*/routes.py exists, then it is joined with web2p/routes.py if any, and the app may rewrite the sections after the app name, (controller, function, args, kwargs). This would be useful for building rich/restful urls: /api/blogs/11/posts/22/comments.xml While this