[web2py] Re: a couple of related questions

2011-10-21 Thread niknok
Anyone? On Oct 21, 10:40 am, niknok wrote: > I have a person table[1] with a parent field with a clickable > representation view of the record. If I put this on a grid and click on > the link, I get a "not authorized" error message. I thought I need to > pass the sign

[web2py] a couple of related questions

2011-10-20 Thread niknok
I have a person table[1] with a parent field with a clickable representation view of the record. If I put this on a grid and click on the link, I get a "not authorized" error message. I thought I need to pass the signature so I can make it viewable. (This works fine if parameter user_signature=Fals

[web2py] looking for suggestions - large number of selections

2011-10-09 Thread niknok
I anticipate a huge number of entries in a person table and expect users find it difficult to do two things: * selecting or viewing multiple entries * adding a new entry on the fly The initial person table design used a traditional mother/father set-up but same-sex parent concept m

[web2py] error: () takes exactly 1 argument (2 given)

2011-10-06 Thread niknok
When I try form=SQLFORM.grid(db.person) with a defined represent parameter, I get the following error: () takes exactly 1 argument (2 given) The person table is defined as: db.define_table('person' ,Field('birth_date', 'date', requires=IS_DATE())

[web2py] date picker on v1.99

2011-10-06 Thread niknok
The new date picker looks very good. Is there a way to input dates by typing it directly (similar to default behaviour in older versions), in addition to selecting dates thru the calendar interface? /r Nik P.S. Though I couldn't type in a date, I could paste one. (which is a behavior I don't e

[web2py] question about preferred represenation and filtering

2011-10-06 Thread niknok
I have a self-referencing table [1] with a defined format for representing a record in this fashion: "Lastname, Firstname [-mm-dd]". In the father field, I expect it to display the drop-down list of persons as defined in format, but it doesn't unless I define it explicitly (like in the mother

[web2py] Re: what about web2py 2.0?

2011-09-20 Thread niknok
Web2Py 2.0 must be *fully* documented in online book. On Sep 20, 4:26 pm, Mengu wrote: > anything special coming up? > > will it broke backward compatibility? nobody needs backward > compatibility in a major version. > > are there any plans for a clean up?

[web2py] Re: preparing for 1.99.1

2011-09-12 Thread niknok
Yes. Eventually. :) On Sep 13, 1:30 pm, Gour-Gadadhara Dasa wrote: > On Mon, 12 Sep 2011 20:21:39 -0700 (PDT) > Massimo Di Pierro > > wrote: > > There is huge list of new features already in trunk that will be > > included in 1.99.1 > > [...] > > > I am forgetting something important? Am I forge

[web2py] Re: billing app

2011-09-12 Thread niknok
Thanks for sharing Kenneth. This looks good. Are you going to open source it? Would like to learn from the code, especially the invoicing part. On Sep 12, 6:03 pm, Kenneth Lundström wrote: > Now you can have a look at it athttp://web2py.nudata.fi/em > > Login with kenneth and kenneth > > This is

[web2py] Re: has anyone done web2py + google maps?

2011-09-10 Thread niknok
Thank you all for the responses and links. They are very good models to learn from. Has anyone done something similar to crimereports.com or haybol.ph? On Sep 11, 7:09 am, Christopher Steel wrote: > You might want to check out Public Radio Roadtrip an application done (in > progress?) by John Ty

[web2py] has anyone done web2py + google maps?

2011-09-09 Thread niknok
Any links to try out?

[web2py] Re: Off topic: New Google Groups Look

2011-09-09 Thread niknok
Looks like a major UI revamp is rolling out across big G's landscape. Too bad for people like me stuck with poor bandwidth, we'll make do with the old interface for now.

[web2py] Re: billing app

2011-09-08 Thread niknok
That would be awesome! Looking forward to it. On Sep 8, 3:05 pm, Kenneth Lundström wrote: > Hello Nikolai, > > I have created a simple billing application that contains customers, > products, hour tracker (simple) and receipt handling. > > If interested I could during the weekend put up a english

[web2py] billing app

2011-09-07 Thread niknok
is there any billing component among the web2py appliances that can be used as a base or a billing appliance? Just wondering if there's any such code out there before starting from scratch. Thanks.

[web2py] Re: web2py trunk [a bit OT]

2011-08-19 Thread niknok
so, is there a tag for "stable" or "trunk" On Aug 20, 8:51 am, pbreit wrote: > When you "hg pull" you grab all of the changes since you last did an "hg > pull" but your working directory remains unchanged. It is not until you do > an "hg update" that your working directory will reflect a new chan

[web2py] Re: web2py trunk [a bit OT]

2011-08-19 Thread niknok
mercurial Thanks On Aug 19, 7:18 pm, niknok wrote: > using the web2py repository, is this how you get trunk: > > hg clonehttps://code.google.com/p/web2py/ > > What are the commands to update the local copy to the latest trunk or > the latest stable? > > Thanks.

[web2py] Re: web2py trunk [a bit OT]

2011-08-19 Thread niknok
so, if I only do 'hg pull' i get trunk? and if I do 'hg update' I get stable? Is that what you mean? On Aug 19, 7:20 pm, David Marko wrote: > 'hg pull' and then 'hg update'

[web2py] Re: web2py trunk [a bit OT]

2011-08-19 Thread niknok
so, if I only do 'hg pull' i get trunk? and if I do 'hg update' I get stable? Is that what you mean? On Aug 19, 7:20 pm, David Marko wrote: > 'hg pull' and then 'hg update'

[web2py] web2py trunk [a bit OT]

2011-08-19 Thread niknok
using the web2py repository, is this how you get trunk: hg clone https://code.google.com/p/web2py/ What are the commands to update the local copy to the latest trunk or the latest stable? Thanks.

[web2py] PowerGrid and reference fields

2011-08-11 Thread niknok
When I list a table with a reference field, it shows up as an index key. I was expecting it to show up as usual, with the default record representation of the referenced table. It does show up correctly inside a modal window, after hitting an action button (i.e. Details), though. I tried settin

[web2py] copying upload type field from one table to another

2011-08-11 Thread niknok
When I try to copy an upload field, the link to the file gets broken in the new table. What's the correct way of copying this field type? For example, I do it like this: db.new_table.photo[1] = db.old_table[9] but in new_table, I get a broken link to the file in the upload folder. /r Nik

[web2py] field labels in crud search

2011-08-11 Thread niknok
I noticed while using crud search results that web2py doesn't use labels defined in tables as headers. Of course, headers can be defined in crud but wouldn't it be better if by default it uses the labels already defined with the table instead of field names?

[web2py] Re: crud.search query

2011-08-09 Thread niknok
I finally found out that "equals" don't work but using "contain" does. It's counter-intuitive but at least there's a workaround. On Jul 1, 7:24 pm, niknok wrote: > I have field "gender" that is defined like so: > >         Field('

[web2py] Re: The web2py grid/crud plugin you've always dreamed about!

2011-07-28 Thread niknok
I observed a curious behavior when scrolling inside a modal window: when you reach the top (or bottom) of the modal, your main window also scrolls up(or down) as well. Very nice. Kudos to Bruno! +1 for plans to make this part of web2py/contrib On Jul 26, 6:15 am, Bruno Rocha wrote: > BTW: > You

[web2py] Re: record representation using a non-id column?

2011-07-20 Thread niknok
Thanks Johann! On Jul 20, 8:11 pm, Johann Spies wrote: > On 20 July 2011 14:09, Johann Spies wrote: > > > > > I use this: > > > db.define_table('akb_doccenter_location', > > >                 Field('location')) > > Apologies, I did not complete the message before sending: the model includes > a

[web2py] Re: request - mmodal examples

2011-07-18 Thread niknok
bump. No takers? :s On Jul 16, 8:23 am, niknok wrote: > I just "discovered" this modal plugin: web2py.com/plugins/default/ > mmodal > > Sorry for being a little slow, but would someone please post an > example of how I can use crud inside modals?

[web2py] Re: Using T with IS_IN_DB

2011-07-16 Thread niknok
how about: db.t_status.f_name.represent=lambda f_name: T(f_name) On Jul 15, 9:27 pm, Kenneth Lundström wrote: > I have a requires with IS_IN_DB like this: > IS_IN_DB(db(db.t_status.id > 0), 't_status.id', '%(f_status)s / %(f_name)s') > > I d like to translate the f_name with T(). Is it possible?

[web2py] request - mmodal examples

2011-07-15 Thread niknok
I just "discovered" this modal plugin: web2py.com/plugins/default/ mmodal Sorry for being a little slow, but would someone please post an example of how I can use crud inside modals?

[web2py] Re: compute fields on update

2011-07-14 Thread niknok
> >>> db.commit() > >>> db(db.item.id == 1).select()[0].total_price > '9.95' > >>> db(db.item.id == 1).select()[0] > > at > 0x17f1758>, 'unit_price': 3.0, 'id': 1, 'delete_record': at 0x17f17d0>, &#x

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
As far as I know only with ID, which is always auto-magically created for you. On Jul 15, 6:54 am, Kenneth Lundström wrote: > Thanks, > > logic error noted, in this case it woun t be a problem. Can t think of a > fix without changing the idea behind this. > > I find it interesting that some field

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
In that case, this should work as well: query = db.auth_user.id == request.args[0]).select() if request.args[0].isdigit() else db.auth_user.username == request.args[0] user_id = db(query).select()[0].id or 0 On Jul 15, 6:54 am, Kenneth Lundström wrote: > Thanks, > > logic error noted, in this

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
request.args always contain strings. str(request.args(0)) is extraneous There's a logic hole here: What if my username is "1" but my record's id is 22. This code will return the record db.auth_user[1] when it's supposed to return db.auth_user[22] Anyway, ou get "invalid literal for int() with bas

[web2py] Re: compute fields on update

2011-07-14 Thread niknok
You're checking it from the shell. Do a db.commit() before checking for total_price. On Jul 15, 3:37 am, guruyaya wrote: > This is run on a web2py shell: > > >>> db.define_table('item', > > ...         Field('unit_price','double'), > ...         Field('quantity','integer'), > ...         Field('t

[web2py] [closed] Re: one form for multiple tables - updating record

2011-07-13 Thread niknok
Thanks Anthony. I checked that out but prefer Jay Kelnar take here: http://groups.google.com/group/web2py/msg/bc03cef19067fa83 In short, SQLFORM.factory has no record argument. You must retrieve the previous record and store it in form.vars. Jay shared me his code and I modified it here: http://

[web2py] Re: Many modal windows on one page

2011-07-12 Thread niknok
Bruno, would you be so kind and post a slice or short example on the use of easyframework+w2p? On Jul 13, 7:58 am, Bruno Rocha wrote: > I am usinghttp://easyframework.com/demo_popup.phpwithout problems. > > 2011/7/12 Kenneth Lundström > > > > > > > > > > > Is this impossible? Should I instead tr

[web2py] Re: one form for multiple tables - updating record

2011-07-11 Thread niknok
Thanks for looking Kenneth. Should it be a record id? From the book (and epydocs): record = db.person(request.args(0)) form = SQLFORM(db.person, record) where record is a Row object and it works correctly. I tried your suggestion to pass an id but got a "KeyError:'name'" error.

[web2py] one form for multiple tables - updating record

2011-07-11 Thread niknok
I've read the section about "one form for multiple tables" and following the example created my function that updates four tables: def register(): form=SQLFORM.factory(db.person, db.affiliation, db.address, db.card) if form.accepts(request.vars): id = db.person.insert(**db.person

[web2py] fields and field_labels argument in crud.seach

2011-07-11 Thread niknok
This example from the epydoc doesn't work: form, results = crud.search(db.test, queries = ['equals', 'not equal', 'contains'], query_labels={'equals':'Equals', 'not equal':'Not equal

[web2py] Re: PowerFormWizard 0.1.4 - Bug Fixes and auto_validation (+ a new plugin for grids)

2011-07-08 Thread niknok
Any suggestion how to make this work with multiple tables (ie. one-to- many relationships)? For example, auth_user and is linked to other tables which I would like to view in other tabs? On Jul 7, 5:27 pm, Bruno Rocha wrote: > UPDATE: > > auto_validate renamed to .validate() > > Now we have ano

[web2py] record representation using a non-id column?

2011-07-08 Thread niknok
I have another unique column in my table that I would like to use as index for record representation. How do I tell web2py to use another index? Ttrying to use like: db.mytable.thisfield.represent = lambda id: db.other(myidx).thatfield

[web2py] Re: headers argument behavior in v1.97.1

2011-07-07 Thread niknok
urs when running the mentioned controller, or qhen doing some > > other action on this? > > > Need more onfo to help tracking this issue. > > > []'s > > > On Thu, Jul 7, 2011 at 2:50 AM, niknok wrote: > > >> ** > >> While using crud, I some

[web2py] Re: headers argument behavior in v1.97.1

2011-07-07 Thread niknok
have a Traceback ticket error? what message, what file/line? > > The erro occurs when running the mentioned controller, or qhen doing some > other action on this? > > Need more onfo to help tracking this issue. > > []'s > > > > > > > > > > On

[web2py] headers argument behavior in v1.97.1

2011-07-06 Thread niknok
While using crud, I sometimes define headers for *some* fields listed in the fields argument. This works until I upgraded to 1.97.1 and now I get an error if I do not define the headers for *all* fields listed in the fields argument. For example, the following code no longer works rows=cr

[web2py] Re: crud.search query

2011-07-03 Thread niknok
Bump. Anyone? On Jul 1, 7:24 pm, niknok wrote: > I have field "gender" that is defined like so: > >         Field('gender','reference aux_gender',notnull=True,widget=radio_h) > > The aux_gender table data were inserted from: > >  

[web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2011-06-30 Thread niknok
be an equivalent for SQLFORM.factory? On Jun 30, 2:41 pm, niknok wrote: > In the validation example,  I entered a single character in the Bio > and was allowed to proceed to the next field despite the > db.person.bio.requires = IS_LENGTH(minsize=5, maxsize=200). You  made > a note a

[web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2011-06-29 Thread niknok
In the validation example, I entered a single character in the Bio and was allowed to proceed to the next field despite the db.person.bio.requires = IS_LENGTH(minsize=5, maxsize=200). You made a note about "Client side validation is not supposed to validate everything!", is this included in that

[web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2011-06-29 Thread niknok
+1 Another golden egg from the proverbial goose ... or gander, in this case. :P Thank you Bruno On Jun 29, 10:33 pm, Bruno Rocha wrote: > Hi, > > I just created a new plugin for stepped form wizards. > > I made it last night, so it is not tested very well, I would like your help > to test it. >

[web2py] Re: pop-up pages interface

2011-06-29 Thread niknok
This is interesting. Could you tell me how to use this in Web2py? On Jun 29, 4:10 pm, Bruno Rocha wrote: > if want an easy way... > > http://easyframework.com/+ web2py > > -- > Bruno Rocha > [ About me:http://zerp.ly/rochacbruno] > > > > > > > > O

[web2py] Re: Social network plug-in

2011-06-18 Thread niknok
Can someone post this somewhere where resume download is supported? I got a crappy connection right now... On Jun 12, 12:09 am, Massimo Di Pierro wrote: > Here is the source of the facebook clone > >  web2py.app.friends.w2p > 1002KViewDownload

[web2py] Re: relational database example app

2011-06-18 Thread niknok
Google Translate thinks it's Swahili... On Jun 19, 1:40 pm, Vineet wrote: > What is this tongue? (wewe andeya kuja nikufundishe web2py na ubebe > nyama :D) > > It is my sincere thought that web2py group is for sharing the > knowledge within the community. > Kindly write something which others can

[web2py] Re: web2py book changelog?

2011-06-16 Thread niknok
gt; the book is referring to > > On Sat, Jun 11, 2011 at 2:19 AM, niknok wrote: > > > Is there like a change log for the web2py book where I can view what's been > > added or modified recently? > > > /r > > -- > Sebastian E. Ovide

[web2py] web2py book changelog?

2011-06-10 Thread niknok
Is there like a change log for the web2py book where I can view what's been added or modified recently? /r

[web2py] Re: recommendations for production system?

2011-05-18 Thread niknok
It's nice to see feedback from real users of these hosts. Could you please add how much traffic you got with those plans you have? On May 18, 6:54 am, Carlos wrote: > Hi all, > > In order to prepare my web2py production system, I would really welcome all > your advice. > > I will get one node fro

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-12 Thread niknok
Ok, here's a quote for you: “Confusion is the welcome mat at the door of creativity.” ;) On May 13, 2:26 am, pbreit wrote: > I suppose it's personal preference but the comma placement at the beginning > of the line is really confusing.

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-12 Thread niknok
settings.hmac_key))) > When I try the above, CRYPT works fine for me. > > Anthony > > > > > > > > On Wednesday, May 11, 2011 11:02:17 PM UTC-4, niknok wrote: > > here's the code I used. > >http://pastie.org/1891534 > > > what's weird is that I know tha

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-11 Thread niknok
ecrypted variable... On May 10, 10:54 pm, Anthony wrote: > On Tuesday, May 10, 2011 2:10:07 AM UTC-4, niknok wrote: > > > Anthony, sorry for the typo. I meant calling onvalidation=, and not > > onaccept > > > That is the behavior I'm expecting, since I

[web2py] Re: update is not saved in the database??

2011-05-11 Thread niknok
ord`` is a web2py thing that will take any changes made to the > record instance (by use of assignment or update function) and issue the > appropriate SQL > > -- > Thadeus > > > > > > > > On Mon, May 9, 2011 at 9:37 PM, niknok wrote: > > Yes, guys thanks. I

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread niknok
Anthony, sorry for the typo. I meant calling onvalidation=, and not onaccept That is the behavior I'm expecting, since I've seen that work like so before. Here's a stripped-down version of the function: def cnv(): c_hash=request.args(0) form=SQLFORM.factory( Field('card_number','s

[web2py] Re: drop down box content depends of another drop box

2011-05-09 Thread niknok
search "cascading select" or "cascading dropdowns" On May 10, 1:24 pm, pepe_eloy wrote: > Hello! > > How can I fill a drop box widget with content depends of another drop > box? I'll explain better: I have 3 tables: > > db.define_table('categoria', >                 SQLField('nombre', notnull=Tru

[web2py] Re: update is not saved in the database??

2011-05-09 Thread niknok
10:45:36 AM UTC-4, niknok wrote: > > > I have these lines that is supposed to update a record but it doesn't: > > >     db.card.validated.writable=True > >     db.card.modified_by.writable=True > >     > > db.card(db.card.alnum==c_hash).update(validated=T

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread niknok
I was trying to process it inside onvalidation= ... On May 9, 10:53 pm, Anthony wrote: > On Monday, May 9, 2011 10:37:02 AM UTC-4, niknok wrote: > > > I tried: > > >     form=SQLFORM.factory( > >         Field('card_number','string' > >

[web2py] Re: represented fields and jqgrid

2011-05-09 Thread niknok
pbreit, config is a Storage() object and member_status a Dictionary, and the python get() function. Ross, you're right. That's how I'm using it. I went back to re-check my definition file and everything appears to be in order. Note that it's only in jqgrid that it's not showing up, it works corre

[web2py] update is not saved in the database??

2011-05-09 Thread niknok
I have these lines that is supposed to update a record but it doesn't: db.card.validated.writable=True db.card.modified_by.writable=True db.card(db.card.alnum==c_hash).update(validated=True,modified_by=auth.user.id) Is there anything I missed? I tried to include a manual db.commit()

[web2py] using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread niknok
I tried: form=SQLFORM.factory( Field('card_number','string' ,label='Enter a card number to verify' ,requires=CRYPT(auth.settings.hmac_key)) But instead I found form.vars.card_number unencrypted. This is on w2p v1.94.5. /r Nik

[web2py] custom attributes

2011-05-08 Thread niknok
Massimo (or anyone who'd like to pitch in) You made this suggestion when I asked a question about a "help system". Field('name',...) db.table.name.help = 'custom attribute' Could you please elaborate on this, and perhaps add a use case or example? Also, I was reading the co

[web2py] Re: skinning a cat ...

2011-05-08 Thread niknok
@Niphlod Yes, that would be interesting. On May 7, 4:09 am, Niphlod wrote: > go for raw sql if you need to, but be aware that that article was > written in 2007, testing only MS SQL Server behaviour we are in > 2011, MS SQL Server 2008 is on the run (and that article could be > referring onl

[web2py] Re: requires questions

2011-05-08 Thread niknok
Thanks for the suggestion. I tried it but I was unable to make use of it. Your suggestion did force me to rethink the design so I discarded the full IS_MATCH string(can't even remember why I went for that), and simply kept the expression string itself (i.e. '^\\d{3}-\\d{4}-\ \d{4}-\\d{1}?$') And

[web2py] Re: represented fields and jqgrid

2011-05-06 Thread niknok
bump... Anyone? On May 5, 8:27 am, niknok wrote: > I .represent a field as follows: > >         db.auth_user.gender.represent=lambda i: db.aux_gender[i].concept[:1] > if i>0 else '?' >         db.auth_user.member_status.represent=lambda i: > config.member_s

[web2py] requires questions

2011-05-06 Thread niknok
I'm doing a requires statement so the id number matches a prescribed format, encrypt it, and then store it in the database (if it isn't a duplicate number) db.card.id_number.requires=[eval(db.agency[int(request.vars.id_number)].regex),CRYPT(),IS_NOT_IN_DB(db,'card.id_number') Do you use ev

[web2py] skinning a cat ...

2011-05-06 Thread niknok
this SQL statement : SELECT agency.card_type FROM agency WHERE agency.id NOT IN (select issuer from card where person=1) is equivalent in DAL: registered_cards=db(db.card.person==1)(db.card.issuer==db.agency.id)._select(db.card.issuer) unregistered_cards=db((db.agency.is_active

[web2py] Re: CRUD.search sorting order

2011-05-06 Thread niknok
I should have also said that I think the fields should be fields and > not strings: > i.e. > fields = [db.auth_user.id, db.auth_user.last_name, ] > > On May 4, 2:47 pm, niknok wrote: > > > > > > > > > I'm using v1.94.6 and retrieving orde

[web2py] getting characters before encryption

2011-05-05 Thread niknok
I have SSNs in a table as text strings. I'm planning to use CRYPT() on the web2py app fields that will store these SSNs. define_table('identity_card' ,Field('person', 'reference auth_user') ,Field('id_type', 'reference valid_id') ,Field('id_number','stri

[web2py] represented fields and jqgrid

2011-05-05 Thread niknok
I .represent a field as follows: db.auth_user.gender.represent=lambda i: db.aux_gender[i].concept[:1] if i>0 else '?' db.auth_user.member_status.represent=lambda i: config.member_status.get(i)[:1] or '?' The first one works, and displays data in jqgrid as expected:'M','F' or'?'

[web2py] displaying user's local time

2011-05-03 Thread niknok
How do I display the user's local time in a form?

[web2py] Re: button action

2011-05-03 Thread niknok
+1 for the link :P On May 2, 9:36 pm, Massimo Di Pierro wrote: > http://mywiki.wooledge.org/XyProblem > > what do you want to do exactly? > > On May 1, 8:04 pm, niknok wrote: > > > > > > > > > I have this button that redirects to a URL: > > >

[web2py] Re: button action

2011-05-03 Thread niknok
gt; http://mywiki.wooledge.org/XyProblem > > what do you want to do exactly? > > On May 1, 8:04 pm, niknok wrote: > > > > > > > > > I have this button that redirects to a URL: > > > form[0][-1][1].append(INPUT(_type='button',_value=T('Prev

[web2py] Re: jquery for triggering change in dropdown list values

2011-05-03 Thread niknok
Right now, I just generate a list from the database and feed it into a IS_IN_SET validator. It worked out faster than slice 85. On May 2, 11:38 pm, Anthony wrote: > On Sunday, May 1, 2011 11:56:55 PM UTC-4, niknok wrote: > > > Thanks Anthony. > > > I've actually tried

[web2py] Re: jquery for triggering change in dropdown list values

2011-05-01 Thread niknok
Thanks Anthony. I've actually tried that, but it was a tad too slow for me. :( On May 1, 12:32 pm, Anthony wrote: > This may help:http://www.web2pyslices.com/main/slices/take_slice/85 > > > > > > > > On Saturday, April 30, 2011 10:53:16 PM UTC-4, niknok wrote

[web2py] button action

2011-05-01 Thread niknok
I have this button that redirects to a URL: form[0][-1][1].append(INPUT(_type='button',_value=T('Previous') ,_onclick='document.location="%s"' %URL("question"))) what do I add to _onclick to do the following: 1) session.current_item -=1 2) redirect(URL('question')) /

[web2py] joins in crud select

2011-05-01 Thread niknok
Can I do joins in CRUD? I'm getting a 404 Not Found error with this: rows=crud.select(db((db.qa.candidate==user_id)&(db.quiz.id==db.qa.quiz))) But the following works alright: rows=db((db.qa.candidate==user_id)&(db.qa.quiz==db.quiz.id)).select() /r Nik

[web2py] expression question

2011-05-01 Thread niknok
I'm wondering why this doesn't work: delta=datetime.timedelta(seconds=15*60) db(request.now>(db.qa.time_start+delta)).count() TypeError: can't compare datetime.datetime to Expression while this one does: delta=datetime.timedelta(seconds=15*60) db(db.qa.time_start<(request.n

[web2py] table cleanup

2011-04-30 Thread niknok
Where should I run a function whose task is to maintain the status of a table record? For example, I have a survey table with the column status. A record's status is "open" when a user answers it, and it is set to "completed" when a user finishes answering it. But, if in case the user doesn't fini

[web2py] jquery for triggering change in dropdown list values

2011-04-30 Thread niknok
I am clueless about jQuery, but I'm wondering if there's any script I can use to trigger a change the values in one dropdown list after selecting a value from another dropdown list in a CRUD form? Right now, I used a jquery script I picked up in the list that initiates a submit action. The consequ

[web2py] redirect to series of pages/functions after registration

2011-04-30 Thread niknok
After registration, user is automatically logged in (when verification is set to False). How do I direct a newly registered user to a series of pages? I have a number of pages, I would like a user to go through. I tried: auth.settings.register_next =[URL(c='default',f='profile'), URL(c='default

[web2py] multi-select dropdown behavior with plugin_wiki installed

2011-04-30 Thread niknok
When plugin_wiki is installed, the multi-select dropdown uses a different dropdown widget. Although it indicates how many items are selected, is there a way to make it show at least one of the items checked by default? I also miss the ability to type a letter and get to those items beggining with

[web2py] Re: selecting a value in dropdownlist reference to another value in dropdownlist

2011-04-30 Thread niknok
How can I add something like this in a CRUD form? On Apr 26, 1:26 am, Massimo Di Pierro wrote: > I would do something like this: > > db.define_table('nominee',Field('name'),Field('region_id',db.Regions)) > > def get_nominees(): >     region_id = request.vars.region_id >     return TAG[''](*[OPTIO

[web2py] IS_IN_DB label from two tables

2011-04-30 Thread niknok
The following validator doesn't work: IS_IN_DB(db(db.g_province.id==db.g_municipality.province)\ ,db.g_municipality.psgc_m\ ,label='%(g_municipality.name)s (%(g_province.name)s)') I am trying to generate a select option that shows a label cons

[web2py] Re: readable/writable settings of auth.signature

2011-04-30 Thread niknok
it? > > On Apr 29, 2:09 am, niknok wrote: > > > > > > > > > I'm trying to set it like this: db.mytable.is_active.readable=False > > but it doesn't appear to be working as they still show up in the CRUD > > forms I make. > > > Is there a w

[web2py] readable/writable settings of auth.signature

2011-04-29 Thread niknok
I'm trying to set it like this: db.mytable.is_active.readable=False but it doesn't appear to be working as they still show up in the CRUD forms I make. Is there a way to individually set the readable, writable settings for each field that auth.signature creates?

[web2py] Re: debugging help. when trying to edit a record.

2011-04-29 Thread niknok
Argh! It was a logic error. I was accessing a different database. Thanks anyway. On Apr 29, 11:43 am, niknok wrote: > The following model and controller works fine when adding records, but > generates an error "('issuer')" when I try > to edit a record. Unf

[web2py] debugging help. when trying to edit a record.

2011-04-28 Thread niknok
The following model and controller works fine when adding records, but generates an error "('issuer')" when I try to edit a record. Unfortunately for me, I couldn't understand what that error actually means, or what I missed doing. Could someone give me a nudge forward? Thanks. /r Nik code is he

[web2py] Re: using another unique column in IS_IN_DB

2011-04-24 Thread niknok
Thanks Villas. I missed that, and it defaulted to 'string'. How do I use 'list:reference ' with another database? I tried: 'list:reference gdb.country' but that doesn't work. On Apr 25, 7:09 am, villas wrote: > country.iso2 is a  'list:reference

[web2py] Re: IS_IN_DB validator

2011-04-23 Thread niknok
Found the answer: orderby is supported. IS_IN_DB(dbset, field, orderby='mytable.myfield', ...) On Apr 24, 8:31 am, niknok wrote: > Thanks. But I guess I did not explain myself properly. > > I would like the list to display the titles, but sorted by say the ID > f

[web2py] bpython shell

2011-04-23 Thread niknok
My 0.01 dollar opinion. Two weeks after trying it out, I've had it. It's actually nice except for the crashes - which I get lots of. So, I lose the code I'm trying out. Its auto-completion doesn't even help redeem it. I'm back to the robust iPython shell, now with ipdb installed, it gives iPyt

[web2py] using another unique column in IS_IN_DB

2011-04-23 Thread niknok
I have the following: db.profile.citizenship.requires=IS_IN_DB(gdb,'country.iso2', '%(name)s',multiple=True,zero=None) It works fine until I try accessing the record from appadmin (I can view the table, it fails when I view a specific record), which dumps me this: Traceback (most recent call

[web2py] Re: requires statement validation string coming from a field

2011-04-23 Thread niknok
**bump** Anyone? On Apr 23, 3:17 pm, niknok wrote: > I have a field regex which contains requires segements like "IS_MATCH('^ > \d{3}-\d{4}-\d{4}-\d{1}?$')" in an administrative table > > I store them as as Storage types and then retrieve and apply it to a &

[web2py] Re: IS_IN_DB validator

2011-04-23 Thread niknok
0:30 pm, DenesL wrote: > Yes, use the label parameter e.g. > > IS_IN_DB(dbset, field, label='%(title)s', ...) > > On Apr 23, 8:59 am, niknok wrote: > > > > > > > > > Is there a way to sort the list generated by IS_IN_DB by another field > > other than the one formatted for display? > > > Thanks. > > > /r > > Nik

[web2py] IS_IN_DB validator

2011-04-23 Thread niknok
Is there a way to sort the list generated by IS_IN_DB by another field other than the one formatted for display? Thanks. /r Nik

[web2py] IS_IN_DB validator

2011-04-23 Thread niknok
Is there a way to sort the list generated by IS_IN_DB by another field other than the one formatted for display? Thanks. /r Nik

[web2py] requires statement validation string coming from a field

2011-04-23 Thread niknok
I have a field regex which contains requires segements like "IS_MATCH('^ \d{3}-\d{4}-\d{4}-\d{1}?$')" in an administrative table I store them as as Storage types and then retrieve and apply it to a Form like this: Field('f4', requires=IS_EMPTY_OR(settings.regex[4])) In a model file, it's defi

  1   2   >