[web2py] manually saving files

2010-01-06 Thread weheh
# model db.define_table('doc', Field('title','string'), Field('filename','upload') ) #controller text_form=SQLFORM.factory(Field('text_in','text',db.doc)) file_form=SQLFORM.factory(db.doc) ... if text_form.accepts(request.vars,formname='text_form'): #insert data into the doc table ... if fi

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

2010-01-06 Thread weheh
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. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@g

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

2010-01-06 Thread weheh
I want to store an audio file in the uploads folder and then have it played by an embed: #view {{url=os.path.join(request.folder,URL (r=request,c='uploads',f='audio',args=[audio_filename])}} http://groups.google.com/group/web2py?hl=en.

[web2py] Re: my routes.py

2010-01-06 Thread Sujan Shakya
Thanks. -- 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 from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http:

[web2py] Re: [web2py:38493] Re: Are self references broken on GAE?

2010-01-06 Thread Miguel Goncalves
I just tried it and it works now. Thanks Massimo! -Miguel On Wed, Jan 6, 2010 at 4:21 PM, mdipierro wrote: > you found a bug. I just fixed it in trunk. > > On Jan 6, 5:37 pm, Miguel Goncalves wrote: > > I am on :*Version* web2py Version 1.74.5 (2009-12-30 15:44:00) > > > > On Wed, Jan 6, 2010

[web2py] Re: mix translation

2010-01-06 Thread KMax
The lastest version. On 7 янв, 05:31, mdipierro wrote: > Which web2py version? I made some patches to sql.py and dal.py ( timestamp->timestamp with time zone, integer -> bigint, serial->bigserial), hardly belielive this is cause. Maybe ru locale is the reason? Webserver locale? Did anyone with ru

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

2010-01-06 Thread mdipierro
Why I do not have understand if why do I have to create a facebook application if all I want is to use facebook for authentication. A facebook application requires a fb canvas (as done in my original fb example) so that I can be embedded in a facebook page but I do not necessarily want that. Am I m

[web2py] Re: my routes.py

2010-01-06 Thread mdipierro
No reason. No overhead On Jan 6, 9:32 pm, Sujan Shakya wrote: > I want to share my routes.py file. The case is that I want only one > application to be hosted on my site and I want to keep my urls clean. > So instead of having urlhttp://crm.appspot.com/crm/default/list_persons, > I want to have u

[web2py] my routes.py

2010-01-06 Thread Sujan Shakya
I want to share my routes.py file. The case is that I want only one application to be hosted on my site and I want to keep my urls clean. So instead of having url http://crm.appspot.com/crm/default/list_persons, I want to have url like http://crm.appspot.com/list_persons. In order to achieve this b

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

2010-01-06 Thread Thadeus Burgess
I don't know... There are times where I have completely forgotten about the fact I was writing a post to begin with... so many hours went by before I got back to it. I would still have the problem if I left it longer than the session was set for... I would still have to copy everything over to an e

[web2py] Re: property tax appeal site made w/ gluon?

2010-01-06 Thread mdipierro
It is down. Massimo On Jan 6, 7:33 pm, s...@pobox.com wrote: > Just came across this oldie in the Chicago Python User Group archive: > >     Massimo> Dear fellow chicagoans, > >     Massimo> here is a new web site made 100% with python (with Gluon). > >     Massimo>      http://www.appealmyproper

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

2010-01-06 Thread Jon Romero
The source code also exists here: http://github.com/jonromero/fbconnect-web2py First of all you have to create a facebook application. The are plenty of tutorials (even though you just need to change one path). Then you copy the API and SECRET key. You must put on facebook app settings -> "Connect"

[web2py] Re: Linked sqlform inputs

2010-01-06 Thread mdipierro
Can you post an example of your code? On Jan 6, 7:22 pm, Delaney wrote: > On page  228 of the web2py manual I see the docs pertaining to almost > exactly what I'm trying to do with the title 'Validators with > Dependencies' and see that 'The same mechanism can be applied to FORM > and SQLFORM obj

[web2py] Re: storing encrypted form data to database

2010-01-06 Thread mdipierro
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 the fields like names, addresses > etc, not all fields. > > So the encrypted text is still

[web2py] Re: searching, entering many-to-many relationships

2010-01-06 Thread skip
selecta> or you could use my improved version selecta> http://groups.google.com/group/web2py/browse_thread/thread/4f9dfc4e9c4b5b27# Thanks, I downloaded Massimo's CRM app then overlaid your version of the plugin. It seems to work, I think. I'm not quite sure about the expected behavior

[web2py] Re: Book errata and minor bug in clean sessions script

2010-01-06 Thread John Heenan
Sorry, fork is not the correct OS term, as the new process is not a copy of the parent process. The new process is just that, a new process. John Heenan On Jan 7, 11:14 am, John Heenan wrote: > My logs indicate that a web2py soft cron command to execute a Python > file at or after a given interv

[web2py] property tax appeal site made w/ gluon?

2010-01-06 Thread skip
Just came across this oldie in the Chicago Python User Group archive: Massimo> Dear fellow chicagoans, Massimo> here is a new web site made 100% with python (with Gluon). Massimo> http://www.appealmypropertytaxes.com/ Massimo> It can help you save money on property taxes. M

[web2py] Re: Linked sqlform inputs

2010-01-06 Thread Delaney
On page 228 of the web2py manual I see the docs pertaining to almost exactly what I'm trying to do with the title 'Validators with Dependencies' and see that 'The same mechanism can be applied to FORM and SQLFORM objects.' However I don't want 'password_again' in the database. If I try inserting

[web2py] Re: Book errata and minor bug in clean sessions script

2010-01-06 Thread John Heenan
My logs indicate that a web2py soft cron command to execute a Python file at or after a given interval is achieved by forking off another Python instance, instead of doing an exec on the contents of the file. A sample from my standard output logs is below. This is confirmed from examining web2py/g

[web2py] Re: Suggest appending version number to downloads of web2py

2010-01-06 Thread NeonGoby
Thanks fine, It's to help me keep track of what version I've downloaded. On my server, I unzip and rename the web2py to web2py_version, so that I can keep the prior version in case I encounter problems with the new version, and I simply create a symbolic link to the desired version. On Jan 6, 4:

[web2py] Re: storing encrypted form data to database

2010-01-06 Thread NeonGoby
Thanks, I'm interested in encrypted some of the fields like names, addresses etc, not all fields. So the encrypted text is still a text and no a binary blob? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to we

[web2py] Re: Can you please turn off the message counter in the subject?

2010-01-06 Thread skip
Massimo> makes sense. I think I have done it. Looks like it! Thanks, Skip -- 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 from this group, send email to web2py+

[web2py] Re: How to do a complex migration?

2010-01-06 Thread mdipierro
The new DAL is a priority and we are close to completion (will need testing). But the first version will just be a rewrite of the current one. New features will come later. When the new DAL is out we may need you help to this done. On Jan 6, 3:43 pm, Michael Toomim wrote: > So I should just wait?

[web2py] Re: SQLFORM without tables

2010-01-06 Thread mdipierro
fixed. On Jan 6, 6:37 pm, Jonathan Lundell wrote: > On Jan 5, 2010, at 3:13 PM, Thadeus Burgess wrote: > > > I think what he really wants is the same thing I have been discussing > > for quite a while :) > > > For now, sqlform.custom is the way to go > > >http://web2py.com/AlterEgo/default/show/2

[web2py] Re: Can you please turn off the message counter in the subject?

2010-01-06 Thread mdipierro
makes sense. I think I have done it. On Jan 6, 4:25 pm, s...@pobox.com wrote: > All web2py emails include both the list name and (apparently) the message > counter in the subject.  As the message counter auto-increments, no subjects > are truly the same and thus my 'k' key in Emacs's VM doesn't ki

Re: [web2py:38499] Re: SQLFORM without tables

2010-01-06 Thread Jonathan Lundell
On Jan 5, 2010, at 3:13 PM, Thadeus Burgess wrote: > I think what he really wants is the same thing I have been discussing > for quite a while :) > > For now, sqlform.custom is the way to go > > http://web2py.com/AlterEgo/default/show/205 A side note: this page (and I suppose others) refer to w

[web2py:38498] Re: storing encrypted form data to database

2010-01-06 Thread mdipierro
Are you looking to encrypt all data (including references) or specific text/string fields). In the latter case you can create a validator to do it remember that a validator is a two-way filter (in and out): class IS_SECURE: def __init__(self,encryption_key): self.key=encryption_key d

[web2py:38497] Re: Suggest appending version number to downloads of web2py

2010-01-06 Thread mdipierro
This was suggested a number of times. The problem is that it breaks automatic downloads and future automatic uploads becaue they would require knowledge of the version. Anyway instead of http://web2py.com/examples/static/web2py_src.zip you can access http://web2py.com/examples/static/1.74.5/web2

[web2py:38496] storing encrypted form data to database

2010-01-06 Thread NeonGoby
I would like to encrypt form data that will be stored into the database, not crypting the login password. I can think of two ways: 1. use dbio=False, or 2. use onvalidation function to encrypt the form data. But I'll need to declare the field as a blob in order to store the resulting binary da

[web2py:38495] Re: [ update all languages ] mix translation

2010-01-06 Thread mdipierro
I am a loss here. I need to your help. Look into gluon/languages.py There are two functions: def read_dict(filename): ... def write_dict(filename, contents): ... Can you try reproduce the problem and see if read_dict returns the correct data before it gets messed up and if write_dict gets the r

[web2py:38494] Suggest appending version number to downloads of web2py

2010-01-06 Thread NeonGoby
I think having the version number as part of the web2py distribution file will be helpful. -- 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 from this group, send email to

[web2py:38493] Re: Are self references broken on GAE?

2010-01-06 Thread mdipierro
you found a bug. I just fixed it in trunk. On Jan 6, 5:37 pm, Miguel Goncalves wrote: > I am on :*Version* web2py Version 1.74.5 (2009-12-30 15:44:00) > > On Wed, Jan 6, 2010 at 3:33 PM, mdipierro wrote: > > which web2py version. this should not happen with 1.74.5. > > > On Jan 6, 5:28 pm, Migue

Re: [web2py:38492] Can you please turn off the message counter in the subject?

2010-01-06 Thread skip
Jonathan> No, I'm just repeating your request. Ah, good man. It appears the motion has been offered and seconded. There's no stopping us now... ;-) Skip -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to

Re: [web2py:38491] Can you please turn off the message counter in the subject?

2010-01-06 Thread Jonathan Lundell
On Jan 6, 2010, at 3:51 PM, s...@pobox.com wrote: >>> Any chance you can get rid of the counter? I can't see that it >>> actually serves any useful purpose anyway. > >Jonathan> ==skip > > Sorry to be dense, but is that some command or setting I can use to edit my > group membership? I

Re: [web2py:38490] Can you please turn off the message counter in the subject?

2010-01-06 Thread skip
>> Any chance you can get rid of the counter? I can't see that it >> actually serves any useful purpose anyway. Jonathan> ==skip Sorry to be dense, but is that some command or setting I can use to edit my group membership? I don't see anything on web2py-users page at groups.go

Re: [web2py:38489] Can you please turn off the message counter in the subject?

2010-01-06 Thread Jonathan Lundell
On Jan 6, 2010, at 2:25 PM, s...@pobox.com wrote: > All web2py emails include both the list name and (apparently) the message > counter in the subject. As the message counter auto-increments, no subjects > are truly the same and thus my 'k' key in Emacs's VM doesn't kill the entire > subject. An

[web2py:38488] Can you please turn off the message counter in the subject?

2010-01-06 Thread skip
All web2py emails include both the list name and (apparently) the message counter in the subject. As the message counter auto-increments, no subjects are truly the same and thus my 'k' key in Emacs's VM doesn't kill the entire subject. Any chance you can get rid of the counter? I can't see that

Re: [web2py:38487] Re: Are self references broken on GAE?

2010-01-06 Thread Miguel Goncalves
I am on :*Version* web2py Version 1.74.5 (2009-12-30 15:44:00) On Wed, Jan 6, 2010 at 3:33 PM, mdipierro wrote: > which web2py version. this should not happen with 1.74.5. > > On Jan 6, 5:28 pm, Miguel wrote: > > Hi > > > > I have the following model: > > > > db.define_table("sites", > >

[web2py:38486] Re: Are self references broken on GAE?

2010-01-06 Thread mdipierro
which web2py version. this should not happen with 1.74.5. On Jan 6, 5:28 pm, Miguel wrote: > Hi > > I have the following model: > > db.define_table("sites", >         SQLField("category_id",db.category), >         SQLField("owner",db.auth_user, writable=False, readable=False), >     SQLField("url

[web2py:38485] Re: [ update all languages ] mix translation

2010-01-06 Thread mdipierro
Which web2py version? On Jan 6, 5:13 pm, KMax wrote: > Hello >   I have broke my translation file for second time while 'update all > languages' >  Most translation are shifted to up heighbour. And at the and there > are 3-4 steps different: like > > # coding: utf8 at the begining all fine > { >

[web2py:38484] Are self references broken on GAE?

2010-01-06 Thread Miguel
Hi I have the following model: db.define_table("sites", SQLField("category_id",db.category), SQLField("owner",db.auth_user, writable=False, readable=False), SQLField("url", "string",length=2048, notnull=True, default=None), SQLField("parent_site", "reference sites")) How

[web2py:38483] [bug?] [ update all languages ] mix translation

2010-01-06 Thread KMax
Hello I have broke my translation file for second time while 'update all languages' Most translation are shifted to up heighbour. And at the and there are 3-4 steps different: like # coding: utf8 at the begining all fine { '"update" is an optional expression like "field1=\'newvalue\'". You cann

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

2010-01-06 Thread Richard
how about setting a huge timeout? On Jan 7, 7:45 am, mdipierro wrote: > ajax calls to keep session alive > > On Jan 6, 2:02 pm, Thadeus Burgess wrote: > > > > > (this) being using ajax calls or (this) being keeping the session alive? > > > -Thadeus > > > On Wed, Jan 6, 2010 at 1:53 PM, mdipierr

[web2py:38481] Re: Linked sqlform inputs

2010-01-06 Thread Delaney
Thanks for that, but it doesn't seem to work when using sqlform.custom.label & wigdets. Which is how I happen to be doing the whole form for this application. Is there an alternative? On Jan 1, 9:21 am, mdipierro wrote: > form=SQLFORM(...) > form[0].insert(position, TR( >                      

[web2py:38480] Re: Migrations broken in hg tip?

2010-01-06 Thread Michael Toomim
Nope. On step 2, when I run "python web2py ...", I get no errors at all. It updates the .table file and sql.log, does not change the DB, and gives me no errors. On Jan 6, 7:30 am, mdipierro wrote: > Did you get any operational error at all? > > On Jan 6, 3:00 am, Michael Toomim wrote: > > > >

[web2py:38479] Re: How to do a complex migration?

2010-01-06 Thread Michael Toomim
So I should just wait? On Jan 6, 8:26 am, mdipierro wrote: > You are correct and that is the future. It is different for every db. > The new DAL will have hooks to implement it. > > Massimo > > On Jan 6, 3:14 am, Michael Toomim wrote: > > > > > Here's what I propose: > > > In define_table, at th

[web2py:38478] Re: Feature "read more" in a default blog index page

2010-01-06 Thread Leandro - ProfessionalIT
> 1) XML(post.content) is vulenrable to XSS injections. Do XML > (post.content,sanitize=True) instead. I'll do it > 2) XML(post.content[0:500]) may (and will) truncate some tags. What if > for example post content[0:500]='bla bla ... bla http://groups.google.com/group/web2py?hl=en.

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

2010-01-06 Thread mdipierro
ajax calls to keep session alive On Jan 6, 2:02 pm, Thadeus Burgess wrote: > (this) being using ajax calls or (this) being keeping the session alive? > > -Thadeus > > On Wed, Jan 6, 2010 at 1:53 PM, mdipierro wrote: > > kpax does this. > > > On Jan 6, 11:56 am, Thadeus Burgess wrote: > >> So I

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

2010-01-06 Thread Massimo Di Pierro
I turned it into a plugin but I am not sure how to get the API key working. Can you explain to us what steps are necessary on the facebook registration site? Eventually his should be integrated with Auth. Massimo -- You received this message because you are subscribed to the Google Groups

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

2010-01-06 Thread Thadeus Burgess
(this) being using ajax calls or (this) being keeping the session alive? -Thadeus On Wed, Jan 6, 2010 at 1:53 PM, mdipierro wrote: > kpax does this. > > On Jan 6, 11:56 am, Thadeus Burgess wrote: >> So I have my blog... and I'm writing a post, and I walk off and leave >> it, come back to po

[web2py:38474] Re: template, static files, routes.py

2010-01-06 Thread mdipierro
Mind that if you have {{def a()}}hello{{return 'world'}} then {{a()}} prints renders as 'hello' but {{=a()}} renders as 'helloworld' Massimo On Jan 6, 1:07 pm, KMax wrote: > I just check layout.html and found there place for menu. > So it should not be the issue to plase at layout.html code l

[web2py:38473] Re: template, static files, routes.py

2010-01-06 Thread mdipierro
I think if you have a default you have to do {{try:}}{{something()}}{{except:}}default value{{pass}} Yes this is ugly. I am open to suggestions. On Jan 6, 12:51 pm, Thadeus Burgess wrote: > Massimo, > > This does not work. > > Especially if you are wanting a default for {{something()}} > > It a

[web2py:38472] Re: Which DB suit best with Web2py

2010-01-06 Thread mdipierro
yes. we support it. We also suport embedded firebird. On Jan 6, 12:13 pm, villas wrote: > Maybe Firebird deserves a mention for its flexibility.  You can do: > > select FIRST 3 SKIP 5 * from table >    --or use this alternative-- > select * from table ROWS 6 TO 8 > > It's so flexible that you can

[web2py:38471] Re: auth_user already exists

2010-01-06 Thread mdipierro
Yes: auth_table.bedrijf.requires=[IS_IN_DB(db, db.bedrijf.id, '% (bedrijfsnaam)s')] should be db.auth_table.bedrijf.requires=[IS_IN_DB(db, db.bedrijf.id, '% (bedrijfsnaam)s')] On Jan 6, 12:00 pm, annet wrote: > Massimo, > > The line now reads like: > > auth.settings.table_user=db.define_tabl

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

2010-01-06 Thread mdipierro
kpax does this. On Jan 6, 11:56 am, Thadeus Burgess wrote: > So I have my blog... and I'm writing a post, and I walk off and leave > it, come back to post, and of course my session has expired. > > What is the best way to keep this session alive? I am thinking an AJAX > call that is set to interv

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

2010-01-06 Thread Jon Romero
I wasn't suggesting using the actual OpenShare. The functionality is similar to what you want. + You have banners + You count the views/clicks + Served from a solid infrastructure + Easy to manage You can take a look at OpenShare's source code and quickly hack your solution. OpenShare is a cut-dow

[web2py:38468] Re: template, static files, routes.py

2010-01-06 Thread KMax
I just check layout.html and found there place for menu. So it should not be the issue to plase at layout.html code like {{=myhead()}} and only issue will be valid return of myhead(). is it? On 6 янв, 21:36, mdipierro wrote: > Yes and no. the web2py template language is very different from > Djang

Re: [web2py:38467] Re: template, static files, routes.py

2010-01-06 Thread Thadeus Burgess
Massimo, This does not work. Especially if you are wanting a default for {{something()}} It always uses the first definition, because of how views are extended and included. So as long as you have the def something(): and {{something()}} in the same template file, it will work, but going throug

[web2py:38466] Re: Which DB suit best with Web2py

2010-01-06 Thread villas
Maybe Firebird deserves a mention for its flexibility. You can do: select FIRST 3 SKIP 5 * from table --or use this alternative-- select * from table ROWS 6 TO 8 It's so flexible that you can even use SKIP on its own. --D -- You received this message because you are subscribed to the Google

[web2py:38465] Re: auth_user already exists

2010-01-06 Thread annet
Massimo, The line now reads like: auth.settings.table_user=db.define_table (auth.settings.table_user_name, What should the validators read like: auth_table.bedrijf.requires=[IS_IN_DB(db, db.bedrijf.id, '% (bedrijfsnaam)s')] This results in an error. I got the line of code I used to define t

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

2010-01-06 Thread Thadeus Burgess
So I have my blog... and I'm writing a post, and I walk off and leave it, come back to post, and of course my session has expired. What is the best way to keep this session alive? I am thinking an AJAX call that is set to interval at every minute ? -Thadeus -- You received this message because y

[web2py:38463] Re: auth_user already exists

2010-01-06 Thread annet
Massimo, I had a look at the sql.log file. The tables were created on 2009-12-29. When I exposed the default/index function this morning, at timestamp: 2010-01-06T09:39:53.092633, I got the ticket mentioned above. I retried exposing the function: timestamp: 2010-01-06T09:40:47.816061. And when I s

[web2py:38462] best approach to populating a form input type select

2010-01-06 Thread Miguel Lopes
I have a form to create related records with an input type select element that should display a list of records that are also related to the parent record. What would be the best approach to populate this form. I'm trying to stick with SQLFORM since I feel this is not achievable through CRUD. In c

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

2010-01-06 Thread K.R.Arun
On Jan 6, 1:50 am, Jon Romero wrote: > You can hack OpenShare (http://openshare.emotionull.com/). It's on > bitbucket, written on web2py, running on GAE. > hi I go through the openshare website. I have not registered yet, but following is what I get from reading the content on the site... *) It's

[web2py:38460] Re: auth_user already exists

2010-01-06 Thread mdipierro
Aha! this line auth_table=db.define_table(auth.settings.table_user_name, should be auth.settings.table_user=db.define_table (auth.settings.table_user_name, On Jan 6, 11:44 am, annet wrote: > Massimo, > > Thanks for your reply. > > > Back to your original problem: > > 2) You have a custom auth

[web2py:38459] Re: auth_user already exists

2010-01-06 Thread annet
Massimo, Thanks for your reply. > Back to your original problem: > 2) You have a custom auth_user in the wrong place in db.py (or with > wrong syntax) and the table gets defined twice. I am pretty sure this > is the case but I cannot point to the error if I do not see the code. This is the cod

[web2py:38458] Re: auth_user already exists

2010-01-06 Thread mdipierro
What you describe here would not work. Tables have to be redefined (at the web2py level) every time you need them. Therefore you must call auth.define_tables() or, as far as web2py is concerned, they do not exist. When you define them at the web2py level, if migrate=False, web2py assumes thay also

[web2py:38457] Re: Recommended way of using google-appengine-python with web2py

2010-01-06 Thread K.R.Arun
Nope, I can't. I unzipped the downloaded file and that's all. It's isn't in the path (I'm using Mint linux(custom Ubuntu)) But I found a solution though, just copy web2py directory within google_appengine directory, that's it. ;-) On Jan 6, 1:33 am, mdipierro wrote: > If you just install the GAE

[web2py:38456] Re: Detecting JS on server side

2010-01-06 Thread K.R.Arun
On Jan 5, 11:01 pm, Thadeus Burgess wrote: > no. > > Well... the only way to verify, is if you have an AJAX callback to the > server if you receive the callback, they have javascript... if you > don't receive one... then they dont. > > def receive_if_js(): >     session.has_javascript = True

[web2py:38455] Re: represent

2010-01-06 Thread mdipierro
You can set a represent attribute for a table but that is not used anywhere in web2py. You would have to call explicitly when you need it. I think T2 uses table.represent but I forgot. Massimo On Jan 6, 10:22 am, "KONTRA, Gergely" wrote: > And do tables have represent? > > if I specify a format

[web2py:38454] Re: Detecting JS on server side

2010-01-06 Thread K.R.Arun
hmm, well, What I want is to provide user a consistent webpage, even if they don't have JS support (Progressive enhancement). Now I use AJAX and those controllers that are used by AJAX functions don't have a view. So if there is no JS they get displayed as plain page with only data no styling (It w

Re: [web2py:38453] Re: searching, entering many-to-many relationships

2010-01-06 Thread Thadeus Burgess
I guess thats my queue to post the list when I get the chance :) -Thadeus On Wed, Jan 6, 2010 at 9:32 AM, mdipierro wrote: > please do. I missed this one. Thadeus is maintaining a list of > plugins. > > On Jan 6, 5:50 am, selecta wrote: >> or you could use my improved >> versionhttp://grou

Re: [web2py:38452] Re: myISAM table creation

2010-01-06 Thread Thadeus Burgess
O MySQLAdapter ->MyISAMAdapter ->InnoDBAdapter :) I love the new DAL! -Thadeus On Wed, Jan 6, 2010 at 9:28 AM, mdipierro wrote: > Right now you cannot unless you edit gluon.sql.py and replace InnoDB > with MyISAM. I am not sure about the implications. The new DAL will > make it easier

[web2py:38451] Re: auth_user already exists

2010-01-06 Thread annet
I tried something else, in the auth_table definition I set migrate=False and I made the auth.define_tables() statement a comment: # auth.define_tables() # creates all needed tables I am now able to expose the default/index function and the functions that do not require log

[web2py:38450] Re: How to do a complex migration?

2010-01-06 Thread mdipierro
You are correct and that is the future. It is different for every db. The new DAL will have hooks to implement it. Massimo On Jan 6, 3:14 am, Michael Toomim wrote: > Here's what I propose: > > In define_table, at this point: > >         if migrate: >             sql_locker.acquire() >          

Re: [web2py:38449] Re: represent

2010-01-06 Thread KONTRA, Gergely
And do tables have represent? if I specify a format string in define_table, isn't it a shortcut to setting the represent attr of the table? On Wed, Jan 6, 2010 at 01:54, mdipierro wrote: > Sorry. I am not sure I understand the question. > > This is not a valid expression: > >   db.post.widget =

[web2py:38448] Re: Feature "read more" in a default blog index page

2010-01-06 Thread mdipierro
Two problems with this: {{if len(post.content) > 500:}} {{=XML(post.content[0:500])}} [ read more ] {{else:}} {{=XML(post.content)}} {{pass}} 1) XML(post.content) is vulenrable to XSS injections. Do XML (post.content,sanitize=True) instead. 2) XML(post.content[0:500]) may (

[web2py:38447] Re: template, static files, routes.py

2010-01-06 Thread mdipierro
Yes and no. the web2py template language is very different from Django's because everything inside {{...}} is pure python. This means there is no concept of blocks but in python you have function calls. You can do #based.html {{def something()}}text goes here{{return}} {{extend 'layout.html'}} He

[web2py:38446] Re: searching, entering many-to-many relationships

2010-01-06 Thread mdipierro
please do. I missed this one. Thadeus is maintaining a list of plugins. On Jan 6, 5:50 am, selecta wrote: > or you could use my improved > versionhttp://groups.google.com/group/web2py/browse_thread/thread/4f9dfc4e9c... > btw i did further improvements so you can search tags and have a tag > clou

[web2py:38445] Re: Migrations broken in hg tip?

2010-01-06 Thread mdipierro
Did you get any operational error at all? On Jan 6, 3:00 am, Michael Toomim wrote: > I'm using hg tip and can't add a column to a table. It figures out > what to do, but doesn't alter the postgresql database. Then any > commands that need to use that column fail. > > It was able to create the ta

[web2py:38444] Re: myISAM table creation

2010-01-06 Thread mdipierro
Right now you cannot unless you edit gluon.sql.py and replace InnoDB with MyISAM. I am not sure about the implications. The new DAL will make it easier for you to write an adapter. On Jan 6, 1:35 am, Oguz Yarimtepe wrote: > Hi, > > How can i make DAL create MyISAM tables instead of InnoDB when i

[web2py:38443] Re: Exception

2010-01-06 Thread mdipierro
This was never really intended to work but now I see some people are using it this way and we may need to restore backward compatibility. It may be possible to do so. Let me try. On Jan 6, 1:28 am, Neveen Adel wrote: > I am using the following code to generate csv file: > >    "" >     import glu

[web2py:38442] Re: static filename from id

2010-01-06 Thread mdipierro
Don't. This would break lots of stuff. Instead create your own custom download function def donwload2(): row_id=request.args(0).split('.')[0] image = db.yourtable[row_id].image request.args=[image] return response.download(request,response,db) On Jan 6, 12:40 am, Mikko wrote: >

[web2py:38441] Re: template, static files, routes.py

2010-01-06 Thread Sujan Shakya
I want only one application to be hosted on my site and I want to keep my urls clean. So instead of having url http://crm.appspot.com/crm/default/list_persons, I want to have url like http://crm.appspot.com/list_persons. In order to achieve this behavior, I wrote the routes.py as: # routes.py imp

[web2py:38440] Re: Feature "read more" in a default blog index page [ SOLVED]

2010-01-06 Thread Leandro - ProfessionalIT
Great Master Thadeus !, perfect ! solved my problem !. Thank you very much ! -- Leandro. -- 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 from this group, send email t

Re: [web2py:38439] Re: Feature "read more" in a default blog index page

2010-01-06 Thread Thadeus Burgess
Since you are including html in your posts, it is a bit difficult... I am using markdown for blogitizor, so the html always comes out clean... snip = 2000 #num characters by default {{=WIKI(page.content[:snip], extras={ 'code-color': {'noclasses': True}, '

Re: [web2py:38438] Re: UliPad as IDE for web2py

2010-01-06 Thread Thadeus Burgess
Its still just a website, you have to refresh the page to see changes :) -Thadeus On Wed, Jan 6, 2010 at 2:57 AM, Werner F. Bruhin wrote: > mdipierro wrote: >> >> > the rule is simple. If the app is not "compiled" no change requires >> restarting except changes in files in the modules/ folde

[web2py:38437] template, static files, routes.py

2010-01-06 Thread Sujan Shakya
I have some questions that I have not understood. In layout.html, I found only one {{include}}. Is it possible to use more {{include}} in layout.html so that we can achieve equivalent of the following: {% block head %}{% endblock %} {% block content %}{% endblock %} {% block col3 %}{% endblock %}

[web2py:38436] Re: searching, entering many-to-many relationships

2010-01-06 Thread selecta
or you could use my improved version http://groups.google.com/group/web2py/browse_thread/thread/4f9dfc4e9c4b5b27# btw i did further improvements so you can search tags and have a tag cloud with links that returns a list of items that were tagged with this term, this code however is rather project s

[web2py:38435] Re: Feature "read more" in a default blog index page

2010-01-06 Thread Leandro - ProfessionalIT
>   To solve this problem I thought of two solutions: > >   1) Break the post in determined number of the words, but this has a > problem: >      - Break the formatation of my index page. > >      I implemented this to test but as the content field is a field > that accepts html tags if I put a "re

[web2py:38434] Feature "read more" in a default blog index page

2010-01-06 Thread Leandro - ProfessionalIT
Hi, Well, I am developing my blog and in my index page I have the latest 05 posts. This posts can be big and I think that a good idea is "break" the content and put a link "read more" to read the full content of the post. To solve this problem I thought of two solutions: 1) Break the post i

[web2py:38433] Best way to implement who's online in web2py

2010-01-06 Thread rondevu
Should I have each user's session routinely log a timestamp with userid into a seperate db? or is auth.event useful for that? -- 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 unsubs

[web2py:38432] Re: Detecting JS on server side

2010-01-06 Thread moriarty
Depending on what you wanna do a simple [1] on your html would be enough. [1]http://www.w3schools.com/TAGS/tag_noscript.asp On 5 jan, 16:01, Thadeus Burgess wrote: > no. > > Well... the only way to verify, is if you have an AJAX callback to the > server if you receive the callback, they hav

[web2py:38431] Re: auth_user already exists

2010-01-06 Thread annet
I have given my question some more thought. Is it possible to generate the tables related to authorization and authentication in the base app, which also contains the other table definitions of my apps. And then in the cms app just uncomment the following lines of code: from gluon.tools import *

[web2py:38430] Re: How to do a complex migration?

2010-01-06 Thread Michael Toomim
Here's what I propose: In define_table, at this point: if migrate: sql_locker.acquire() try: t._create(migrate=migrate, fake_migrate=fake_migrate) finally: sql_locker.release() At the end, it can read the database schema

[web2py:38429] Migrations broken in hg tip?

2010-01-06 Thread Michael Toomim
I'm using hg tip and can't add a column to a table. It figures out what to do, but doesn't alter the postgresql database. Then any commands that need to use that column fail. It was able to create the table in the first place, but cannot add a column now that the table has been created. How should

[web2py:38428] auth_user already exists

2010-01-06 Thread annet
I have one application (called base) in which I define all the tables for three other applications. In the three applications I use the same db.py file. In these db.py files I set migrate=False on all tables. One of these applications is a CMS, in which I enabled Authorization and Authentication.

Re: [web2py:38427] Re: UliPad as IDE for web2py

2010-01-06 Thread Werner F. Bruhin
mdipierro wrote: > the rule is simple. If the app is not "compiled" no change requires restarting except changes in files in the modules/ folder. If the app is compiled you need to click on "remove compiled" and "compiled" again but no restart. As the OP of this thread, the above is what confu