Re: [web2py] job

2010-01-07 Thread Jason Brower
On Thu, 2010-01-07 at 11:54 -0800, mdipierro wrote: > Any of you behind this? > > http://www.startuply.com/Jobs/Web_Py_Web_Developer_1856_1.aspx > > if you know more I am curious. I haven't checked lately, but is there a site for people looking for a job in web2py on the homepage of web2py? If

[web2py] Re: How do I make directed relationship?

2010-01-07 Thread mdipierro
Yes, the problem is the one you mention. You need two left joins with different aliases. This should do it: x=db.person.with_alias('x') y=db.person.with_alias('y') rows = db(db.likes.id>0).select(x.ALL,y.ALL, left=[x.on(x.id==db.likes.person), y.on(y.id==db.likes.endeared)]) f

[web2py] How do I make directed relationship?

2010-01-07 Thread Christopher Helck
Perhaps this is a basic DB question: I want to model people who like other people. So I have a table of people and a table of relationships called 'likes'. The 'likes' table contains two columns: person, and endeared, both representing people. The problem comes when I want to join the two tables t

[web2py] Re: manually saving files

2010-01-07 Thread mdipierro
true On Jan 7, 6:55 pm, weheh wrote: > I assume I have to write the logic to determine whether uploadfolder > exists before writing into it, correct? > > On Jan 7, 6:04 pm, mdipierro wrote: > > > You can have subfolder structure > > > Field('file','upload',uploadfolder='') > > > any field ca

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread mdipierro
Under private should not use db.table.field.store and you should not use dafult/download. On Jan 7, 6:53 pm, weheh wrote: > That's cool. I can put things under private. I didn't realize that was > supposed to be my play area. > > If I do put files under private, should I insert the file's filena

[web2py] Re: storing encrypted form data to database

2010-01-07 Thread mdipierro
These two are nice: http://www.4dsolutions.net/cgi-bin/py2html.cgi?script=/ocn/python/blowfish.py http://www.josh-davis.org/files/uploads/2007/06/aes_v001.py each of them is single file no dependencies. solid algorithms. The AES if the offical US government standard for encryption. I tend to trus

[web2py] Re: manually saving files

2010-01-07 Thread weheh
I assume I have to write the logic to determine whether uploadfolder exists before writing into it, correct? On Jan 7, 6:04 pm, mdipierro wrote: > You can have subfolder structure > > Field('file','upload',uploadfolder='') > > any field can have its own uploadfolder which can me (but does not

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread weheh
That's cool. I can put things under private. I didn't realize that was supposed to be my play area. If I do put files under private, should I insert the file's filename into a db field of type string or should I use db.table.insert (fieldname=db.table.fieldname.store(stream,'filename'))? I know t

[web2py] Re: storing encrypted form data to database

2010-01-07 Thread NeonGoby
Can you recommend an encryption module? On Jan 6, 6:18 pm, mdipierro wrote: > Good point. It depends on the encrypt function. I would use one that > encrypt and then base64 encodes it to avoid problems. > > On Jan 6, 7:04 pm,NeonGoby wrote: > > > Thanks, > > I'm interested in encrypted some of th

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
Yeah, that's MUCH more legible. By the way I'm DONE!!! once I understood that part doing the rest was just a few minutes work. Thank you so much for your time and patience. Soon I will have some time to help with that previous project we had discussed earlier. Thanks again Massimo! On Jan 7, 3:4

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread mdipierro
On a second thought, you could have also done {{=form.element(_name='verify_email')}} which is more readable. On Jan 7, 5:42 pm, mdipierro wrote: > form is the form > form[0] is the table > form[0][-2] is the row (TR) before the last, the one you inserted > form[0][-2][1] is the second TD of th

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread mdipierro
form is the form form[0] is the table form[0][-2] is the row (TR) before the last, the one you inserted form[0][-2][1] is the second TD of the TR form[0][-2][1][0] is the first thing in the TD, the INPUT helper error messages are appended after INPUT/TEXTAREA helpers automatically, if any. On Ja

[web2py] Re: http_host in cron

2010-01-07 Thread mdipierro
The problem is this is not well defined. Your computer may have multiple network cards and multiple IP addresses. When a request arrives from outside the web server knows which IP is being used but when a function called by cron, it would not know which IP to pick. In fact you can cron even if you

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
Thank Works!!! I 'got my fish' and would also like to learn 'how to fish' now. :P But sure seems like a real cryptic non-documented way to do things. Is there any way to get more details. Just like using form[0] instead of form. The api docs online don't seem to fill the gaps for me with what'

[web2py] http_host in cron

2010-01-07 Thread Paul
is there a way to get the host ip info inside a function that has been called from a cron script? request.env.http_host doesn't seem to work (request doesn't make much sense when called from a cron script). im trying to use xmlrpc communication between two apps, but without hard coding the URL and

[web2py] Re: manually saving files

2010-01-07 Thread mdipierro
You can have subfolder structure Field('file','upload',uploadfolder='') any field can have its own uploadfolder which can me (but does not need to be) a subfolder of uplaods/ On Jan 7, 4:59 pm, Thadeus Burgess wrote: > There is an issue with the uploads folder. > > Most filesystems will suf

Re: [web2py] Re: manually saving files

2010-01-07 Thread Thadeus Burgess
There is an issue with the uploads folder. Most filesystems will suffer a huge performance penaltiy if there are > 100 files in a single folder. So in an app that receives alot of uploads, having these all in one folder is really really bad for the servers performance (think flickr type site). H

[web2py] Re: manually saving files

2010-01-07 Thread mdipierro
There are two subfolders: private and uploads You should not mess up with uploads. Let SQLFORM put staff there and download retrieve it. You can manually do it but ONLY if you use db.table.insert(fieldname=db.table.fieldname.store (stream,'filename')) This is very special folder because ther

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread mdipierro
ERRATA. This will not work. I overlooked the fact you put something under uploads that is not actually uploaded and does not follow appropriate naming convention. You need: 1) your own action in controllers/audio.py def download_audio(): f=os.path.join(request.folder,'uploads',request.args(0)

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread mdipierro
Summing you have a download in controller default.py {{audio_filename='folder1/folder2/audio_filename.mp3'}} {{url=URL(r=request,c='default',f='download',args=audio_filename)}} "index". audio.py has > > def download(): >   return response.download(request,db) > > I also tried making a controllers

[web2py] Re: manually saving files

2010-01-07 Thread weheh
How about with an which I then write to a file abc under uploads/folder1/folder2 and want to insert into the db.doc.filename, which is of type 'upload'? On Jan 7, 8:54 am, mdipierro wrote: > If you have an represented as a > FieldStorage in request.vars.xyz you can do > > db.doc.insert(filename

[web2py] Re: query for not in

2010-01-07 Thread mdipierro
The syntax is correct but the logic escapes me. On Jan 7, 4:14 pm, Thadeus Burgess wrote: > So just to check my logic, this is the correct way to DALism the query? > > where = (db.orders.customer_id == None) > lefton = (db.customers.customer_id == db.orders.customer_id) > members = db(where).sele

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread mdipierro
You are right. It will never be in form.custom but this could work {{=form[0][-2][1][0]}} On Jan 7, 3:39 pm, Delaney wrote: > That makes a lot of sense, however in the view. > > {{=form.custom.label.verify_email}} > {{=form.custom.widget.verify_email}} > > The verify_email is not available fro

[web2py] Re: GAE AttributeError

2010-01-07 Thread mdipierro
This should work: session.form_vars=dict(form.vars) have you tried it? On Jan 7, 2:56 pm, johntynan wrote: > Thanks Massimo!  This works perfectly. > > I have one quick follow up question. > > When using the following code: > > form=SQLFORM(db.table) > if FORM.accepts(form,request.vars): >    

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread weheh
Sorry, Massimo, no joy. What is my download controller supposed to look like and what folder and file is it supposed to be in? Currently, the view is called from controller "audio" and action "index". audio.py has def download(): return response.download(request,db) I also tried making a cont

[web2py] Re: query for not in

2010-01-07 Thread Thadeus Burgess
So just to check my logic, this is the correct way to DALism the query? where = (db.orders.customer_id == None) lefton = (db.customers.customer_id == db.orders.customer_id) members = db(where).select(db.customers.ALL, left=db.orders.on(lefton)) -Thadeus On Thu, Jan 7, 2010 at 4:02 PM, Thadeu

Re: [web2py] Re: Facebook Connect for web2py is ready!

2010-01-07 Thread Alex Fanjul
Yeah, it's the same for wordpress... (moreover: for each wordpress) Alex F El 07/01/2010 23:01, Jon Romero escribió: > From http://wiki.developers.facebook.com/index.php/Facebook_Connect_Tutorial1 : "Each Connect website is treated as a Facebook application, and so it needs an API key. Go to the

[web2py] Re: query for not in

2010-01-07 Thread Thadeus Burgess
This would be a sample query in MYSQL... I just do not know how to port this to DAL syntax :) SELECT customers.* FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id WHERE orders.customer_id IS NULL -Thadeus On Thu, Jan 7, 2010 at 3:29 PM, Thadeus Burgess wrote: >

[web2py] Re: Facebook Connect for web2py is ready!

2010-01-07 Thread Jon Romero
>From http://wiki.developers.facebook.com/index.php/Facebook_Connect_Tutorial1 : "Each Connect website is treated as a Facebook application, and so it needs an API key. Go to the Facebook Developer application and click Create An Application. Fill in these fields: " You have to create an applicati

Re: [web2py] Re: Best approach for keeping a session alive

2010-01-07 Thread Wes James
look in db.py ## if no need for session # session.forget() Just don't use sessions. On Thu, Jan 7, 2010 at 2:57 PM, Richard wrote: > is there a way to disable timeout and have sessions last forever? That > would be useful for my intranet app where security is not an issue. > -- You received

[web2py] Re: Best approach for keeping a session alive

2010-01-07 Thread Richard
is there a way to disable timeout and have sessions last forever? That would be useful for my intranet app where security is not an issue. On Jan 8, 12:40 am, selecta wrote: > on the thought of huge timeout/no timeout > is there a implementation of "remember me" out there that I can look > at, I

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
That makes a lot of sense, however in the view. {{=form.custom.label.verify_email}} {{=form.custom.widget.verify_email}} The verify_email is not available from form.custom.label or form.custom.widget... still shows 'None,None' But I do think this is much closer! On Jan 7, 11:39 am, mdipierro

[web2py] query for not in

2010-01-07 Thread Thadeus Burgess
Query for records that are in one table but not in another table? myrecord --- theid -> FK -> listofstuff datetitme listofstuff --- myid myname myvalue So basically, I want all listofstuff that does not have a record in myrecord -Thadeus -- You received this message because you

[web2py] Re: GAE AttributeError

2010-01-07 Thread johntynan
Thanks Massimo! This works perfectly. I have one quick follow up question. When using the following code: form=SQLFORM(db.table) if FORM.accepts(form,request.vars): session.form_vars=form.vars as you had suggested here: http://groups.google.com/group/web2py/browse_thread/thread/b3508f4a9b

[web2py] job

2010-01-07 Thread mdipierro
Any of you behind this? http://www.startuply.com/Jobs/Web_Py_Web_Developer_1856_1.aspx if you know more I am curious. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe f

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread mdipierro
I get it now. I would do this: def reg_info(): form = SQLFORM(db.attendees) form[0].insert(-1,TR('Verify email',INPUT (_name='verify_email'),'')) def validate_email(form): if form.vars.email!=form.vars.verify_email: form.errors.verify_email='email does not match'

[web2py] Re: represent

2010-01-07 Thread mdipierro
Now I understand. Short answer. It cannot be done in the sense there is no API for it Long answer. It can be done this way: ### define table post and set the format ### based on a field that does not exist db.define_table('post', Field('title',length=256), Field('body','text',requires=IS

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
Sorry for the spamming of messages. But on page 213 of the manual it says... "The same mechanism can be applied to FORM and SQLFORM objects." Can I get an example that in the controller that will work with custom sqlforms? Maybe that's all I really need. On Jan 7, 10:52 am, Delaney wrote: > Ho

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
Honestly doing keeping 'verify_email' in the db is not a big deal to me. If there is a way to reference other Field values in db.define_table I'll do it there instead. Just a little lost with the docs on how to do it. On Jan 7, 10:49 am, Delaney wrote: > Sure,http://www.pasteall.org/10201/html4

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
Sure, http://www.pasteall.org/10201/html4strict This is the view and the output. On Jan 7, 10:28 am, mdipierro wrote: > where do you get '.verify_email'? can you show the complete > html output? > > On Jan 7, 12:22 pm,Delaney wrote: > > > The controller is... > > def reg_info(): > >     form = S

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread mdipierro
where do you get '.verify_email'? can you show the complete html output? On Jan 7, 12:22 pm, Delaney wrote: > The controller is... > def reg_info(): >     form = SQLFORM(db.attendees) >     form.append( >         Field('verify_email','string', >               requires = IS_EXPR('value==%s' % repr

Re: [web2py] Re: represent

2010-01-07 Thread KONTRA, Gergely
Sure. db.py: db.define_table('post', Field('title',length=256), Field('body','text',requires=IS_NOT_EMPTY()), Field('author',db.auth_user), ) db.define_table('comment', Field('post',db.post,writable=False,readable=False), Field('author',db.auth_user,writable=False,readable=Fals

[web2py] Re: Linked sqlform inputs

2010-01-07 Thread Delaney
The controller is... def reg_info(): form = SQLFORM(db.attendees) form.append( Field('verify_email','string', requires = IS_EXPR('value==%s' % repr(request.vars.get (form.vars.email, None)), error_message=T('Emails do not math'

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread vihang
thanks again for the interest. I will send the code directly to you with a release from my manager. This may take a bit of time... but since I am personally interested in this project, I will do the needful. Cheers On Jan 7, 8:28 pm, mdipierro wrote: > Send me what you have done. I am curious. >

[web2py] Duplicate Records

2010-01-07 Thread Thadeus Burgess
Ah... times such as these when Access really makes you happy... So I have an email field... unique, and people who think they are smart have signed up with a lowercase email, and then again with an uppercase email. Yes it is my fault for not converting to lowercase before validating. (well I did

[web2py] Re: represent

2010-01-07 Thread mdipierro
Hi Gergo, appadmin has nothing to do with t2 and t2 was deprecated long ago. I guess you can still define db.post.represent but I am not sure what do you want to do with it. What behavior do you expect? Can you provide a concrete example? On Jan 7, 9:31 am, "KONTRA, Gergely" wrote: > Yes, AFAI

[web2py] Re: Wrong behavior of auth.get_or_create_user()

2010-01-07 Thread dz0ny
Thank you, for clarification! On 7 jan., 15:01, mdipierro wrote: > Yes because get_or_create_user already expects an encrypted password. > In gluon.tools its is always called as > > user = self.get_or_create_user(form.vars) > > where form.vars have already passed validation, therefore the passwor

[web2py] Re: [web2py:38455] Re: represent

2010-01-07 Thread KONTRA, Gergely
Yes, AFAIK appadmin is a T2 thing. So, I wonder how can one rewrite the line below using db.post.represent (still that is more flexible) db.define_table('post', Field('title',length=256), Field('body','text',requires=IS_NOT_EMPTY()), Field('author',db.auth_user), format='%(title)s

Re: [web2py] Re: [web2py:38482] Re: Best approach for keeping a session alive

2010-01-07 Thread Wes James
That is why it would be nice to have workflows like plone. You can create/edit an item and then when you are done "publish" it. You would still need to save it to not get a login timeout, but people would not see it until you were ready. -wes On Wed, Jan 6, 2010 at 7:44 PM, Thadeus Burgess wro

[web2py] Re: Editing auth tables

2010-01-07 Thread mdipierro
They should be there http://.../yourapp/appadmin are they not? is it possible you have a auth.define_tables() is controller and not in a model? On Jan 7, 9:03 am, jiri wrote: > Hello, > > I am implementing webapp and I want to use "database administration" > that is already implemented in web2p

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread mdipierro
Send me what you have done. I am curious. On Jan 7, 8:26 am, vihang wrote: > Thanks for the clarification. > > If the end users cannot distribute compiled code out of a framework, > it would defeat the purpose of creating a framework. But web2py did > gel very well with a framework like Titanium,

[web2py] Editing auth tables

2010-01-07 Thread jiri
Hello, I am implementing webapp and I want to use "database administration" that is already implemented in web2py to edit "auth" tables - tables with information about users. I can't find tables in application admin section. Is this possible? I can see table names (auth_user, etc) in sql.log but I

[web2py] web2py help & resources

2010-01-07 Thread DenesL
Primary source of help: web2py groups - http://groups.google.com/group/web2py/topics http://groups.google.com/group/web2py-developers/topics http://groups.google.com/group/web2py-users-brazil/topics Tips on searching the users group -

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread vihang
Thanks for the clarification. If the end users cannot distribute compiled code out of a framework, it would defeat the purpose of creating a framework. But web2py did gel very well with a framework like Titanium, could see at ways to leverage it in future hopefully :-) Regards Vihang On Jan 7, 7

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread mdipierro
Yes it would violate because you make an executable. It does not requires a separate web2py installation to run as other web2py applications. If you distribute your code separately from web2py and let the users build their own exec, then you can distribute your code BSD but they will not be allowe

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread vihang
I am not modifying anything in web2py. Instead the titanium app 'imports web2py' similar to how the py2exe was used to create windows binary of web2py. Hence this is like a modified web2py exe using titanium instead of py2exe/py2app. This way, one can create web2py based apps in titanium. Do you th

[web2py] Re: Wrong behavior of auth.get_or_create_user()

2010-01-07 Thread mdipierro
Yes because get_or_create_user already expects an encrypted password. In gluon.tools its is always called as user = self.get_or_create_user(form.vars) where form.vars have already passed validation, therefore the password has already been encrypted. If you call get_or_create_user yourself in the

[web2py] Re: Web2py + Titanium (appcelerator)

2010-01-07 Thread mdipierro
If what you build is a web2py application then you can release it under any license you want. If you have taken out and modified web2py modules (those in the gluon folder) than your work MUST be released under GPL2 assuming this is compatible with the titanium license. On Jan 7, 7:45 am, vihang w

[web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread mdipierro
It is not special. It is a folder. It is not a controller action. Here is what you do: {{url=URL(r=request,c='download',args=audio_filename)}} > > This won't work. Why not? (If I move everything over to the static > folder and then change 'uploads' to 'static' in the URL statement, it > does work

[web2py] Re: manually saving files

2010-01-07 Thread mdipierro
If you have an represented as a FieldStorage in request.vars.xyz you can do db.doc.insert(filename=db.doc.filename.store (request.vars.xyz.file,request.vars.xyz.filename)) On Jan 7, 1:37 am, weheh wrote: > # model > db.define_table('doc', >   Field('title','string'), >   Field('filename','uploa

[web2py] Wrong behavior of auth.get_or_create_user()

2010-01-07 Thread dz0ny
Hello! I've discovered following problem when using auth.get_or_create_user ({"email":"m...@web.net", "password":"longlongtime"}), the password in database isn't encrypted, but stays plain. But when using form registration it's encrypted correctly. Is this right behavior? -- You received this me

[web2py] Web2py + Titanium (appcelerator)

2010-01-07 Thread vihang
Hello, I am working on a test app which integrates web2py with titanium, but there seems to be a bottleneck if I want to release/distribute as open source. Titanium is APL and web2py is GPL. Or was the info given to be wrong, as in APL code can call GPL code? I would prefer releasing the final cod

[web2py] Re: Best approach for keeping a session alive

2010-01-07 Thread selecta
on the thought of huge timeout/no timeout is there a implementation of "remember me" out there that I can look at, I want this feature for my page at some point and if is an implementation out there it would be nice to share! just in case, i guess what "remember me" does on most pages is to not de

[web2py] Re: Is there any 'Ad Rotator' like in ASP in web2py

2010-01-07 Thread K.R.Arun
Is source is available?? I haven't seen it. Please provide me the link. No one ever want's to start from scratch (most of the time). On Jan 7, 12:18 am, Jon Romero wrote: > I wasn't suggesting using the actual OpenShare. The functionality is > similar to what you want. > + You have banners > + Y

Re: [web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread Jason Brower
On Wed, 2010-01-06 at 22:58 -0800, weheh wrote: > I guess the os.path.join(request.folder...) isn't really necessary in > the above-given example. Just there as part of my testing why this > wasn't working. Unless you uploaded it with your web app, I would put it in static. Regards -- You receiv