[web2py] problem with migrating a sqlite db

2010-03-25 Thread Peter Etchells
I am getting a conflict between the number of records in a migrated table shown by web2py vs two other applications, including sqlite database browser I am trying to access a sqlite db created by another application (anki). One table is fields: dx.define_table('fields', Field('ordinal',

[web2py] AutocompleteWidget suggestion

2010-03-19 Thread Peter Etchells
Autocomplete is a very useful widget, thanks. In case it has missed anyone's attention, it can be used to autocomplete strings without reference to another table or field, eg db.person.name.widget=AutocompleteWidget(request, db.person.name) In this case, it is useful to have a autocomplete list

[web2py] Re: AutocompleteWidget suggestion

2010-03-19 Thread Peter Etchells
to continue, after finger trouble... .select(distinct=distinct, with argdistinct=False in __init-- another less useful suggestion is to optionally allow the search on any part of the string, rather than just the beginning. rows = self.db(field.like('%'+

[web2py] SQLFORM.factory and boolean values

2010-02-22 Thread Peter Woolf
, --Peter - def test_boolean_forms():   default_val=True   if request.get_vars.DefaultTrue==False:     default_val=False   form=SQLFORM.factory(Field(DefaultTrue,boolean, default=default_val))   if form.accepts(request.vars, session):     redirect(URL(r=request,f='test_boolean_forms

[web2py:32701] crud forms for multiple records? Multiple tables?

2009-10-11 Thread Peter Woolf
easily make a crud form for a single record, but this would mean I have many submit buttons on a page or a very long series of pages to do something simpler. Any thoughts would be appreciated. Thanks, --Peter --~--~-~--~~~---~--~~ You received this message because

[web2py:32707] Re: crud forms for multiple records? Multiple tables?

2009-10-11 Thread Peter Woolf
thanks Massimo! Let me see if I can get this going via the SQLFORM.factory--thanks for the suggestion. --Peter On Oct 11, 9:37 pm, mdipierro mdipie...@cs.depaul.edu wrote: Something is wrong with this: db.define_table('dogs',     ...     Field('vaccination_id', db.vaccinations

[web2py:32498] Re: problem with crud custom forms

2009-10-08 Thread Peter Woolf
This could work, but this solution is more permanent than I want. I'd like to make it so that I could dynamically select the fields I want to edit. I know I can do it with SQLform but without all of the nice features that crud provides. Other thoughts? thanks! --Peter On Oct 8, 11:30 am

[web2py:32506] Re: problem with crud custom forms

2009-10-08 Thread Peter Woolf
That works! Thanks! --Peter On Oct 8, 12:17 pm, Thadeus Burgess thade...@thadeusb.com wrote: You can set those in your controller dynamically. for example def admin_edit():       db.tablename.fieldname.writable = True       db.tablename.fieldname.readable = True       return dict(form

[web2py:31552] Re: Almost working on the dreamhost server... $50 to the person that can make this a script!

2009-09-23 Thread Peter Woolf
is below. If anyone can build on this to allow access to the admin window it would be most appreciated! --Peter code for web2py.install.py -- subdomain=yourDomaiNname.com ## --CHANGE THIS user=yourUserID ## -- CHANGE THIs # should be something like web2py.mydomain.com

[web2py:31559] Re: Almost working on the dreamhost server... $50 to the person that can make this a script!

2009-09-23 Thread Peter Woolf
, *sys.argv)' f=open(subdomain+/wsgihandler.py,w) f.write(\n.join(ws)) f.close() os.system(python2.5 +subdomain+/web2py.py) -- On Sep 23, 3:19 pm, Peter Woolf pwo...@gmail.com wrote: After too much frustration, I made a simple script for installation

[web2py:25402] Readable/writable fields and crud.read / SQLFORM readonly

2009-07-01 Thread Peter
* to False as well the field does disappear from the crud.read output. Problem (if it is that) seems to be in the underlying SQLFORM(..., readonly=True). Is this behavior correct, or have I misunderstood the semantics for readable/writable... ;-) This is using the 1.64.4 release. Cheers, -Peter

[web2py:25411] Re: Readable/writable fields and crud.read / SQLFORM readonly

2009-07-01 Thread Peter
. It maens you can want to edit/update the field but not show it in crud.read and SQLTABLEs On Jul 1, 8:04 am, Peter peter.kleyn...@gmail.com wrote: Given this controller: def vread():     db.auth_user.something.readable=False     db.auth_user.something.writable=True     return dict

[web2py:24411] how to get validator details for a field?

2009-06-18 Thread Peter Etchells
Hi web2pyzeans I want to be able to access the type and parameters of validators for a given field. How would I do something like: myfield=db['mytable'][field] if field.type=='integer': if field.requires[0] == validator.IS_INT_IN_RANGE: min = the min arg of the IS_INT_IN_RANGE validator

[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 mdipie...@cs.depaul.edu 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:23661] Re: problem with selfreference left outer join

2009-06-09 Thread Peter Etchells
prints: SELECT dog.name, dog.name, dog.name FROM LEFT JOIN dog ON dog.id=dog.father_id LEFT JOIN dog ON dog.id=dog.mother_id; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to

[web2py:23646] problem with selfreference left outer join

2009-06-08 Thread Peter Etchells
When trying the example in the new slide show: ...db = SQLDB('sqlite://storage.sqlite') db.define_table('dog', SQLField('name'), SQLField('father_id','reference dog'), SQLField('mother_id','reference dog')) .. data: 5 selected dog.id dog.namedog.father_id dog.mother_id 1

[web2py:22853] another page selector /page navigator

2009-05-28 Thread Peter Etchells
Try this simple page selector for web2py --~--~-~--~~~---~--~~ 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 from this group, send

[web2py:22855] Another page selector /page navigator

2009-05-28 Thread Peter Etchells
Try this page selector/paginator for web2pyhttp://99babysteps.appspot.com/how2/default/article_read/2. Built as a function that can be called from web2py views. Also optionally shows percentages. Feedback welcomed. --~--~-~--~~~---~--~~ You received this message

[web2py:19323] display two different links for the same field

2009-04-06 Thread Peter Etchells
I am trying to display a field twice in the same row, with two different links, along the lines of View per row: id(with href to function1)...sameid(with href to function2)...more fields from same row I can't see how to duplicate the id in the controller at the select, for example with

[web2py:19343] Re: display two different links for the same field

2009-04-06 Thread Peter Etchells
Thanks, Massimo I will proceed on the basis that the above method is the best to achieve that. I am enjoying working with web2py - it is the best out of those that I have tried for getting meaningful apps up and running quickly. Regards, PE --~--~-~--~~~---~--~~

[web2py:16079] Re: new puppy example please?

2009-02-09 Thread Peter
then be something like auth.messages.verify_email = \ 'Click on the link: %(validate_url)s/%(key)s to verify your email' I would be happy to suggest a patch, but I don't want to sneak in a fullurl() helper... ;-) Cheers, -Peter On Feb 9, 3:56 pm, Peter peter.kleyn...@gmail.com wrote: Hi

[web2py:16083] Re: new puppy example please?

2009-02-09 Thread Peter
it, since it is trivial enough. ;-) Maybe this is my chance to contribute: please put my suggestion to Chris in the official web2py documentation, by way of implementing option 1. ;-)) Cheers, -Peter On Feb 9, 5:07 pm, Wes James compte...@gmail.com wrote: As mentioned before it is so the developer

[web2py:16086] Re: new puppy example please?

2009-02-09 Thread Peter
) link to the verify_email function, currently not easily provided by web2py -- that is what this is about. Cheers, -Peter On Feb 9, 5:07 pm, Wes James compte...@gmail.com wrote: As mentioned before it is so the developer can put in their own messge. -wj On Mon, Feb 9, 2009 at 9:04 AM, Peter

[web2py:16015] MySQL and 1.56.1: 'no such record' error

2009-02-08 Thread Peter
still use? Cheers, -Peter # default.py: def testmysql(): pers = db(db.t2_person.id==t2.person_id).select()[0] form = SQLFORM(db.t2_person,pers) if form.accepts(request.vars,session): redirect(URL(r=request,f='index')) return dict(form=form) # db.py: db.define_table('t2_person

[web2py:16019] Re: MySQL and 1.56.1: 'no such record' error

2009-02-08 Thread Peter
Hi Massimo, The printed values are '9' 9L in both cases. Your first suggestion is ineffective, but the second one solves this problem: self.table._db(self.table.id==self.record.id).update(**fields) I have another issue that seems to be mysql related, I'll post this separately. -Peter

[web2py:16021] Re: MySQL and 1.56.1: 'no such record' error

2009-02-08 Thread Peter
to SQLFORM, and in 1.56 it includes all fields in the database table? Is that possible? At any rate, I can repair this by explicitly specifying the fields to be validated in the validator function. Cheers, -Peter On Feb 8, 6:39 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think the problem

[web2py:16028] Re: MySQL and 1.56.1: 'no such record' error

2009-02-08 Thread Peter
in the table, instead of the fields array that I passed to SQLFORM -- which I think is how it should be. Note that this is *not* mysql-related, it also occurs with sqlite. Cheers, -Peter # default.py def valtest(): pers = db(db.t2_person.id==t2.person_id).select()[0] fields = ['name','email

[web2py:16040] Re: MySQL and 1.56.1: 'no such record' error

2009-02-08 Thread Peter
, onvalidation=lambda form,fields=fields: myvalidator(form,fields)):     redirect(URL(r=request,f='index'))   return dict(form=form,p=p) On Feb 8, 1:14 pm, Peter peter.kleyn...@gmail.com wrote: My assumption is that an onvalidation callback has access to the 'fields' list as a local

[web2py:16041] Re: new puppy example please?

2009-02-08 Thread Peter
I'll leave this to someone else. For myself, the next stop is subclassing Auth... one reason being to adapt email registration. Cheers, -Peter On Feb 8, 6:04 pm, murray3 ch...@murraypost.net wrote: Massimo, having trouble getting email registration to work on localhost with the T2 Puppies app

[web2py:16060] Re: new puppy example please?

2009-02-08 Thread Peter
interest in documenting and expanding what is now in tools.py than what was left out of it. ;-) Cheers, -Peter On Feb 9, 12:47 am, mdipierro mdipie...@cs.depaul.edu wrote: Peter, if you and some others (Fran? Ceej?) want to take over T2 and move it on top of tools.py please go ahead. the source

[web2py:16003] web2py documentation site: http://www.99babysteps.com/how/base/index

2009-02-07 Thread Peter Etchells
http://www.99babysteps.com/how/base/index This is my first attempt at a web2py app, contains some web2py documentation - a work in progress. Currently not taking registrations or allowing comments. Any constructive comments welcome. regards, Peter Etchells

[web2py:15878] Re: new web site?

2009-02-04 Thread Peter
there. If you do decide to try Mediawiki, be sure to also copy the CSS over from the WP codex. ;-) Cheers, -Peter On Feb 4, 8:35 pm, mdipierro mdipie...@cs.depaul.edu wrote: oops. Thank you On Feb 4, 12:57 pm, Douglas Andrade dsandr...@gmail.com wrote: Hi Massimo, It is set in these files: grep

[web2py:15116] Re: Custom forms again

2009-01-19 Thread Peter
it? :-) This way, I can really go to town on the html as generated by SQLFORM. Thanks again! -Peter On Jan 19, 11:02 am, mdipierro mdipie...@cs.depaul.edu wrote: I think what is provided is not much different than what you asking a=DIV() a.append(H1()) a.append(H2()) a[0].append('hello

[web2py:15117] Re: Custom forms again

2009-01-19 Thread Peter
='+URL(r=request,f='step1')+';) ) Sorry for that, folks. -P On Jan 19, 4:21 pm, Peter peter.kleyn...@gmail.com wrote: Okay Massimo, that's exactly the clarity I'm looking for! I couldn't really find it in the docs, but if I can use this as a more or less official API, I'm happy. For one thing, I

[web2py:15090] Custom forms again

2009-01-18 Thread Peter
(). This works, but the direct use of the internal form/div structure to insert a new xml node is an eyesore. Is there a better way to do this? Ideally, I'd be looking for a sort of formalized API that I could use to manipulate the entire xml tree of the form, eg, similar to the DOM. Cheers, -Peter

[web2py:15104] Re: Custom forms again

2009-01-18 Thread Peter
afraid I am lacking both in experience and in time... ;-) Cheers, -Peter On Jan 19, 3:34 am, mdipierro mdipie...@cs.depaul.edu wrote: At this time using [i], .element, .append and .insert are the only methods to manipulate the form. Can you provide an example of the API you would like to have

[web2py:14237] Re: Inline images in SQLFORM, general SQLFORM API...

2008-12-29 Thread Peter
[..] stuff -- eg, through the new elements interface? Cheers again... -Peter On Dec 29, 7:10 am, mdipierro mdipie...@cs.depaul.edu wrote: define a widget, something like: def myhelper(field,value):     field_id='%s_%s' % (field._tablename,field.name)     inp=INPUT(_type='file',_id=field_id,_class

[web2py:14259] Re: Inline images in SQLFORM, general SQLFORM API...

2008-12-29 Thread Peter
, -Peter On Dec 29, 3:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: 1) I am sorry. I do not understand without a code example. 2) not possible. I agree there should be a way to do it. Using the latest trunk you can do form.element(_type='submit').update(_value='click me!') Massimo On Dec

[web2py:14263] Re: Inline images in SQLFORM, general SQLFORM API...

2008-12-29 Thread Peter
=modified_on... but instead it starts afresh with tr id=t2_person_name_row, ie, the top table row. I can send you both html outputs if you like. Cheers, -Peter On Dec 29, 3:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: 1) I am sorry. I do not understand without a code example. 2) not possible. I

[web2py:14189] Re: Proposal: MVC separation - son of custom views

2008-12-28 Thread Peter
with formname=None instead of session; - form.accept without any second argument -- no luck with any of them. What am I doing wrong?? Cheers, -Peter On Nov 10, 9:15 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can havecustomforms. You always could. Since version 1.48 (posted today) it is even easier

[web2py:14202] Re: Proposal: MVC separation - son of custom views

2008-12-28 Thread Peter
problem as described above with my T2_PERSON extended table. Adding the name=id field makes no difference. If you have any further ideas, please let me know... Somehow related to T2?? Cheers, -Peter In db.py: db.define_table('t2_person', SQLField('name',length=40,requires=IS_NOT_EMPTY

[web2py:14204] Re: Proposal: MVC separation - son of custom views

2008-12-28 Thread Peter
message, no update in db). Cheers, -Peter On Dec 28, 6:50 pm, Peter peter.kleyn...@gmail.com wrote: Massimo, thanks for the incredibly fast turnaround -- on a Sunday even. ;-) I've done some more experimenting. This works beautifully on my PRODUCT table. I do have to add the name=id

[web2py:14210] Re: Proposal: MVC separation - son of custom views

2008-12-28 Thread Peter
Check -- that did the trick. I didn't know that specifying the fields in the SQLFORM had this effect on the scope of the update. You live and learn... Thanks for the support! -Peter On Dec 28, 7:48 pm, mdipierro mdipie...@cs.depaul.edu wrote: I see. You need     form=SQLFORM(db.t2_person

[web2py:14223] Re: Inline images in SQLFORM, general SQLFORM API...

2008-12-28 Thread Peter
need. Maybe I should give it another shot. Care to share some T2 secrets? ;-) Cheers, -Peter On Dec 29, 12:14 am, Fran francisb...@googlemail.com wrote: On Dec 28, 9:42 pm, Peter peter.kleyn...@gmail.com wrote: BTW, I would really appreciate a more formal API for SQLFORM that is more geared

[web2py:14091] Re: IMPORTANT: Bill's patch

2008-12-23 Thread Peter
This looks like what I need: custom forms with fields that can tie into model and database, including validation,etc. But this modified version of Bill's patch hasn't yet made it into production yet (1.54), is that correct? -Peter On Nov 10, 8:01 am, mdipierro mdipie...@cs.depaul.edu wrote

[web2py:13571] Re: Editing T2 -- caching problems?

2008-12-15 Thread Peter
edit; - in order for email reg to work, T2 assumes a working SMTP server on localhost:25 Cheers, -Peter On Dec 15, 12:57 am, Yarko Tymciurak yark...@gmail.com wrote: Hi Peter - IF you are doing this for T3, then you should look at the include in applications/t2/models/db.py --- plugins_t2

[web2py:13572] Re: Editing T2 -- caching problems?

2008-12-15 Thread Peter
/shutdown process... Cheers, -Peter On Dec 15, 3:29 pm, Peter peter.kleyn...@gmail.com wrote: Yarko, thanks.  I'm doing this only for the registration/auth/authZ functions in T2. As such, I don't have strong preferences where the code is located. ;-) I instantiate a t2 object at the bottom

[web2py:13585] Re: Editing T2 -- caching problems?

2008-12-15 Thread Peter
OK, thanks! Most Python/web stuff I have experience with doesn't have such long-running processes-- which, in a way, I guess is to web2py's credit. ;-) Anyway, now that I know I can learn to live with it. Cheers, -Peter On Dec 15, 8:29 pm, mdipierro mdipie...@cs.depaul.edu wrote: Hi Peter

[web2py:13552] Editing T2 -- caching problems?

2008-12-14 Thread Peter
the log.infos that I put in also come up empty. Thanks in advance, -Peter --~--~-~--~~~---~--~~ 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

[web2py:13235] Re: User management and registration

2008-12-09 Thread Peter
So...I've just finished watching the T2 video on Vimeo. It will take me a few days to digest this, but... wow! I'm going to try and re-write my Django app in web2py, see how far I can get... Thank you! -Peter On Dec 7, 7:42 pm, mdipierro [EMAIL PROTECTED] wrote: http://mdp.cti.depaul.edu

<    1   2   3   4   5