[web2py] Re: url rewrite for SEO optimization

2010-06-16 Thread KR
routes.py is the way to do it it's a standard file of web2py On 16 juin, 20:36, Michelle Jun wrote: > hi > > i am wondering if i can do these things > > for example, i have list of businesses url links (this is generated > from my web2py default) > > http://domain.com/default/business/8http://dom

[web2py] Custom Form

2010-06-16 Thread Pai
Is it possible to do checkbox with constraints?? For example, consider following db.define_table('children', Field('name'), Field('sex')) db.children.insert('Tom', 'M') db.children.insert('Jerry', 'M') db.children.insert('Eve', 'F') db.children.insert('Mary', 'F') is it possible to create FORM

[web2py] Re: Radio buttons and check boxes orientation

2010-06-16 Thread hywang
CheckboxesWidget can arrange check boxes horizontally. you can specify the colum number by 'cols' Try this: db.define_table('test', Field('children')) db.test.children.requires = IS_IN_SET(['boy1','girl1','boy2','girl2','boy3','girl3','boy4','girl4']) def horizontal_checkbox(f,v):

[web2py] Re: import of web2py modules very complicated

2010-06-16 Thread pierreth
On 14 juin, 08:11, mdipierro wrote: > It depends. If you want to import any NORMAL python module, put it in > site packages and import it using normal python syntax. > > If you want to import "web2py modules", i.e. modules that belong to a > specific application only, then you have to follow the r

[web2py] Re: Radio buttons and check boxes orientation

2010-06-16 Thread mr.freeze
Try this: db.define_table('test', Field('answer',default='Maybe')) db.test.answer.requires = IS_IN_SET(['Yes','No','Maybe']) def horizontal_radios(f,v): table = SQLFORM.widgets.radio.widget(f,v) rows = table.elements('tr') table.components = [] table.append([row.elem

[web2py] Re: cosmetic dropbox request

2010-06-16 Thread mr.freeze
Try this: db.reg_registry.registry_id.requires = IS_IN_DB(db,'reg_registry.registry_id',lambda row: '%s-%s-%s' % (row.num_part1.rstrip(),row.num_part2.rstrip(), row.num_part3.rstrip()) ) '%(num_part1)s-%(num_part2)s-%(num_p art3)s' On Jun 16, 12:33 pm, Jean-Guy wrote: > Hello, > > I use %()s in a

[web2py] url rewrite for SEO optimization

2010-06-16 Thread Michelle Jun
hi i am wondering if i can do these things for example, i have list of businesses url links (this is generated from my web2py default) http://domain.com/default/business/8 http://domain.com/default/business/9 http://domain.com/default/business/10 http://domain.com/default/business/11 http://doma

[web2py] web2py_ajax.html and mootools

2010-06-16 Thread Albert Abril
Hi everybody! I'm wondering if is someone using mootools with web2py. If yes, could you report your experiences? For what I understood: · Web2py welcome applications uses jquery. · Any js library could be used with web2py. · web2py_ajax.html is connecting some response.* at the controllers with j

[web2py] Re: Defining db.py for the first time problem (db references possible?)

2010-06-16 Thread zsouthboy
Thanks for your help, mdiperro and Yarko (thanks for the investigation of the code :) ). Circular refererences aren't what I'm attempting at all (obviously that can't work). Instead, those fields would be left nullable and filled in later, for the most part. Example: an already created Person ob

[web2py] Re: Syntax highlighting for multiline string with pound character

2010-06-16 Thread Meteormarc
I found the answer to this question accidentially. The highlighting failure disappears if you write the inner string with single quotes ('mstree'). Marc On 14 jun, 23:18, Meteormarc wrote: > In the controller, when I have a multiline string with a pound (#) > character in it, the syntax highligh

[web2py] cosmetic dropbox request

2010-06-16 Thread Jean-Guy
Hello, I use %()s in a IS_IN_DB validator like this : db.reg_registry.registry_id.requires = IS_IN_DB(db,'reg_registry.registry_id','%(num_part1)s-%(num_part2)s-%(num_part3)s') return num_part1 -num_part2 -num_part3 My problem is that %()s seems to add whitespace at the end of the string w

[web2py] formstyle functions considered excellent!

2010-06-16 Thread MikeEllis
Massimo, Many, many thanks for adding formstyle functions in 179.1. You've provided a solution for the one aspect of SQLFORM that has given me the most headaches in trying to customize the presentation of form items, namely that the composition of the items in the field rows are determined in SQL

[web2py] Re: code broke, help

2010-06-16 Thread greenpoise
ok, it worked and after one browser refresh it stoped working. How could I show you that it worked somehow?? On Jun 16, 1:18 pm, greenpoise wrote: > Oops my bad. This one > > desde=datetime.datetime(request.now.year,request.now.month,request.now.day) >     hasta=desde+datetime.timedelta(days=10

[web2py] Re: code broke, help

2010-06-16 Thread greenpoise
Oops my bad. This one desde=datetime.datetime(request.now.year,request.now.month,request.now.day) hasta=desde+datetime.timedelta(days=10) form=FORM (H1(TABLE (TR(('From:',INPUT(_name="desde",_class='date',_value=desde,_id="desde",requires=IS_DATE())), ('To:',INPUT(_name="hasta",_class='d

[web2py] Re: code broke, help

2010-06-16 Thread greenpoise
I dont know how this could be different but this one did worked: desde=request.now hasta=request.now desde=datetime.datetime(request.now.year,request.now.month,request.now.day) hasta=desde+datetime.timedelta(days=10) form=FORM (H1(TABLE (TR(('From:',INPUT(_name="desde",_class='

Re: [web2py] Re: my app instead of welcome app???

2010-06-16 Thread Julius Minka
V Utorok, 15. jún 2010 o 15:51 -0700, Yarko Tymciurak napísal(a): > I think the simpler solution (simpler than routes.py) is - when > deploying, link your app to applicaitons/init --- it is simple, it > will behave as you want, and the only "operating system" that I can > think of that doesn't have

[web2py] Re: Submenus and IE6

2010-06-16 Thread KR
1.79.2 not 1.19.2 (in the first mail) On 16 juin, 13:01, KR wrote: > Hi, > > I have the same problem as in that thread : Submenus and IE6 > (http://groups.google.be/group/web2py/browse_thread/thread/5b80149ee6c... > ) > > To make sure that I didn't messed all up, I installed a fresh new > 1.19.2

[web2py] Re: Submenus and IE6

2010-06-16 Thread KR
Hi again, I just installed web2py 1.75.5 (according to the VERSION file, I downloaded the 1.75.4: http://web2py.com/examples/static/1.75.4/web2py_src.zip) and it works. According to the changelog, the bug was fixed on the 1.75.1 and I downloaded the first version available after that one to check

[web2py] crud chaining onaccept

2010-06-16 Thread szimszon
Hello! I wonder if somebody could help me. Can I chain somehow the onaccept functions or specify more functions on onaccept? I need crud.archive and I need some custom computing if the crud form is accepted like storing additional files, populate another table data from accepted form fields auto

[web2py] Re: Radio buttons and check boxes orientation

2010-06-16 Thread weheh
I find myself mostly defaulting to custom forms for anything that an end user sees. For internal app admin stuff, I am usually happy with whatever web2py produces automatically. On Jun 16, 10:53 am, Johann Spies wrote: > On 16 June 2010 16:44, weheh wrote: > > > Find out the id or class of the r

Re: [web2py] Re: Radio buttons and check boxes orientation

2010-06-16 Thread Johann Spies
On 16 June 2010 16:44, weheh wrote: > Find out the id or class of the radio buttons. Use firebug to see, or > look at the "CSS Conventions" section of the doc. You may need to > resort to a custom form, but I doubt it. Then set the css attribute: > display: inline; should probably do it. You may n

[web2py] Re: Radio buttons and check boxes orientation

2010-06-16 Thread weheh
Find out the id or class of the radio buttons. Use firebug to see, or look at the "CSS Conventions" section of the doc. You may need to resort to a custom form, but I doubt it. Then set the css attribute: display: inline; should probably do it. You may need to float the first one ... not sure about

[web2py] Re: Trouble doing manual insert of upload file

2010-06-16 Thread weheh
I will try this. How about how to open the upload file during validation (see my previous post)? On Jun 16, 2:58 am, mdipierro wrote: > Try this: > > file_form=SQLFORM.factory(db.auth_user,db.othertable,db.srcfile) > ... > if FORM.accepts(file_form,request.vars,formname='file_form'): # no > uploa

[web2py] Radio buttons and check boxes orientation

2010-06-16 Thread Johann Spies
How do I get radio buttons (and check boxes) to show up horizontally in stead of vertically? e.g. Yes {}No {} in stead of Yes {} No {} Regards Johann -- "Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pu

[web2py] Re: Looking for web2py AJAX "recipes"

2010-06-16 Thread mr.freeze
You might try this one too: http://web2pyslices.com/main/slices/take_slice/8 On Jun 16, 5:01 am, David Mitchell wrote: > Thanks GoldenTiger, > > Looks likehttp://www.web2pyslices.com/main/slices/take_slice/85addresses > my 1st requirement, > andhttp://www.web2pyslices.com/main/slices/take_slice/

[web2py] Re: Internal error

2010-06-16 Thread Cory Coager
See above, post #5. On Jun 15, 11:42 pm, mdipierro wrote: > No. the error you reported was with postgresql 8.1. What is the > problem with sqlite?

[web2py] Submenus and IE6

2010-06-16 Thread KR
Hi, I have the same problem as in that thread : Submenus and IE6 ( http://groups.google.be/group/web2py/browse_thread/thread/5b80149ee6cb508b/61fd3cb44109803e ) To make sure that I didn't messed all up, I installed a fresh new 1.19.2 web2py and I tried on the welcome/default/index page. On my win

Re: [web2py] Re: Looking for web2py AJAX "recipes"

2010-06-16 Thread David Mitchell
Thanks GoldenTiger, Looks like http://www.web2pyslices.com/main/slices/take_slice/85 addresses my 1st requirement, and http://www.web2pyslices.com/main/slices/take_slice/86 addresses my 2nd requirement. Still looking for solutions to the other two, but these get me off to a flying start! Regards