[web2py] How to reuse the db definition?

2012-04-06 Thread Ronghui Yu
Hi, All, I would like to write some Python script for doing database house keeping work, and I would like to reuse the table definitions defined in models\db.py. But I am not able to import it since models is not a package, and I was trying to use exec_environment() to do that, but it request a co

[web2py] Re: reference or list:reference

2012-04-06 Thread Annet
HI Anthony, Thanks for your reply. It enables me to make the right choice on reference fields. Kind regards, Annet

[web2py] Re: represent in form

2012-04-06 Thread Annet
Hi Anthony, I apologize for not giving a reply to your answer to my question. I am talking about the second bullet in http://web2py.com/books/default/chapter/29/6#Record-representation. - To set the db.othertable.person.represent attribute for all fields referencing this table. This mean

[web2py] Re: auth_user reference to other table

2012-04-06 Thread Annet
Hi Anthony, Define it as Field('country', 'reference country') instead of > Field('country', db.country) -- the latter won't work if db.country hasn't > been defined yet. > Should I use 'reference table' instead of db.table in all table definitions or just in the definition of tables that refe

[web2py] Re: export Data Abstraction Layer (DAL) to be used with Google Cloud SQL on App Engine

2012-04-06 Thread Matt
Hey Jarod, I'm using it! The following hack - which I've documented in the issue I've raised below - seemed to fix some uploading issues. http://code.google.com/p/web2py/issues/detail?id=746&q=cloud Hope that helps, Matt On Monday, 19 March 2012 16:03:25 UTC+13, Jarod G.R. Meng wrote: > > Hi

[web2py] Re: redis support in Web2py

2012-04-06 Thread Massimo Di Pierro
I did not try it but I am told by the author it works. The more people use it the more it will be tested. If changes are necessary, we will take care of them. On Friday, 6 April 2012 21:06:29 UTC-5, cyan wrote: > > > Hi group, > > Could someone please let me know how much support exists for redi

[web2py] redis support in Web2py

2012-04-06 Thread cyan
Hi group, Could someone please let me know how much support exists for redis in web2py? I've come across this: http://code.google.com/p/web2py/source/browse/gluon/contrib/redis_cache.py, but not sure if redis is officially supported by web2py. If not, any timeline available? Many thanks.

[web2py] Re: AJAX form submission using CRUD in web2py

2012-04-06 Thread Anthony
> > Is it possible to validate CRUD form fields using ajax without > submitting the form in web2py? > > I have gone through the web2py online doc and have seen this link: > http://web2py.com/books/default/chapter/29/11#Ajax-form-submission So we > may do it using custom html. But I want to d

[web2py] Re: auth_user reference to other table

2012-04-06 Thread Anthony
> > i like to ask the user for his country. So I added a field country to the > auth_user table. but I like it to be a referenz to db.country which I > define later in the db.py file. for some reason I get an error message when > trying to do that. > Define it as Field('country', 'reference co

Re: [web2py] nice to introduce new button in grid

2012-04-06 Thread Jonathan Lundell
On Apr 6, 2012, at 6:14 PM, Anthony wrote: > I wonder if it wouldn't be straightforward to have a version of BEAUTIFY > (arguments? alternative version called DUMP?) that would suppress this > behavior and give us a dump of the object down to lower-level structures: > dicts, lists, etc? Or is th

Re: [web2py] nice to introduce new button in grid

2012-04-06 Thread Anthony
> > I wonder if it wouldn't be straightforward to have a version of BEAUTIFY > (arguments? alternative version called DUMP?) that would suppress this > behavior and give us a dump of the object down to lower-level structures: > dicts, lists, etc? Or is there already some better way to explore t

[web2py] How to accept authentication from external service

2012-04-06 Thread JimK
I'm looking for a way to accept authentication from an external service within a web2py app. Specifically, I'd like my app to accept authentication from a site like AppSumo or Groupon where they help sell the product for you, accept the payment and then redirect to my web2py app. Normally, my

Re: [web2py] Improving scaffolding application

2012-04-06 Thread Hironori Kawano
Hi, Bruno Thank you for your reply. I have been reading your book and it's really great! Hope to create a lot of services with web2py I am using Safari Online to read it and just gave you a good review! Thanks. Hiro On Tuesday, April 3, 2012 2:05:46 PM UTC+9, rochacbruno wrote: > > This is talk

[web2py] Moda em rede Social

2012-04-06 Thread Ovidio Marinho
Esta caracterizado que existe um modismo em redes sociais. primeiro veio a grande moda do Orkut , depois o Facebook, e tantas outras muito boas que não decolaram , mas que podem decolar a qualquer momento dependendo da sua oferta de facilidade e necessidade. No Android ja exite uma app que faz de s

Re: [web2py] new feature in trunk: better markmin

2012-04-06 Thread Massimo Di Pierro
This has been on the todo list for a while. It requires refactoring of the way markmin handles nested lists. If this is done, must be donefor both markmin2html and markmin2latex. I very much support this feature but it not a priority for me. If somebody wants to work on it, I will take a patch.

[web2py] Re: auth_user reference to other table

2012-04-06 Thread pbreit
Actually, I'm not sure that is the problem. Are you getting a specific error message? Can you show the auth_user and db.country code you are using? On Friday, April 6, 2012 1:22:52 PM UTC-7, pbreit wrote: > > I think you need to make sure the auth tables is created before the > db.country table

[web2py] Re: auth_user reference to other table

2012-04-06 Thread pbreit
I think you need to make sure the auth tables is created before the db.country table with this line: auth.define_tables()

[web2py] auth_user reference to other table

2012-04-06 Thread BlueShadow
Hi, i like to ask the user for his country. So I added a field country to the auth_user table. but I like it to be a referenz to db.country which I define later in the db.py file. for some reason I get an error message when trying to do that.

Re: [web2py] new feature in trunk: better markmin

2012-04-06 Thread Martin Weissenboeck
Maybe we could get nested lists? Something like - item a -- item aa -- item ab - item b Martin Am 06.04.2012 03:09 schrieb "Massimo Di Pierro" : > Consider this text > > text = """ > **bold** > ''italic'' > ``code`` > [[anchor]] > [[link to #anchor]] > http://example/image.jpg (embeds the image)

[web2py] AJAX form submission using CRUD in web2py

2012-04-06 Thread rahulserver
Is it possible to validate CRUD form fields using ajax without submitting the form in web2py? I have gone through the web2py online doc and have seen this link: http://web2py.com/books/default/chapter/29/11#Ajax-form-submission So we may do it using custom html. But I want to do it using CR

Re: [web2py] Re: data source configuration

2012-04-06 Thread Alex
thanks, Anthony. In case that's the way to go: could this be added somewhere to the official documentation? I think that's really important and it is not obvious for non-python-experts (like me). Alex Am Freitag, 6. April 2012 15:44:43 UTC+2 schrieb Anthony: > > could you explain how this woul

Re: [web2py] Re: How to install gluon in virtualenv?

2012-04-06 Thread Bruno Rocha
Experimental: You can do: easy_install gluino And you will get a minified web2py inside your virtual env. On Fri, Apr 6, 2012 at 1:43 PM, Alan Etkin wrote: > I belive you can copy the entire web2py source folder and append the > location to sys.path > > > On Friday, April 6, 2012 6:52:46 AM U

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Massimo Di Pierro
The problem is that everything supported so far makes markmin self-sufficient. ajax:@{...} would require web2py.js On Friday, 6 April 2012 11:31:47 UTC-5, Alan Etkin wrote: > > I like ajax:@... more than the iframe solution. iframe has not so good > publicity AFAIK among some users. For example

[web2py] Re: new feature in trunk: generic.map

2012-04-06 Thread Massimo Di Pierro
I guess yes but I did not need them On Friday, 6 April 2012 08:47:26 UTC-5, Alan Etkin wrote: > > Will the example mark db points in a google map? Are there any other uses > possible provided by the Google API trough the web2py interface? > > On Thursday, April 5, 2012 8:54:32 PM UTC-3, Massimo D

[web2py] Re: How to install gluon in virtualenv?

2012-04-06 Thread Alan Etkin
I belive you can copy the entire web2py source folder and append the location to sys.path On Friday, April 6, 2012 6:52:46 AM UTC-3, Vincenzo Ampolo wrote: > > Hi, > > How can I install and use gluon in virtualenv ? > > Thanks > > -- > Vincenzo Ampolo > http://vincenzo-ampolo.net > http://goshaw

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Alan Etkin
I like ajax:@... more than the iframe solution. iframe has not so good publicity AFAIK among some users. For example here: http://stackoverflow.com/questions/755795/are-iframes-html-obsolete . I am not saying that I would not use iframe, just that there are users against it. For suggesting othe

[web2py] Re: new feature in trunk: generic.map

2012-04-06 Thread Cliff
+1 On Thursday, April 5, 2012 7:54:32 PM UTC-4, Massimo Di Pierro wrote: > > Example: > > # model > db.define_table('point', > Field('name'), > Field('latitude','double'), > Field('longitude','double')) > > #controller > def map(): > return dict( > googlem

[web2py] Re: Uploads saving to DB, but not to file system

2012-04-06 Thread rdodev
Issue posted. On Friday, April 6, 2012 11:47:29 AM UTC-4, Massimo Di Pierro wrote: > > say you have a vars.file_name that contains the file to be uploaded. > Before the insert you need to do (I think): > > vars.file_name = > db.UPLOAD.file_name.store(vars.file_name.file,filename=ars.file_name.fi

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Massimo Di Pierro
I will double check. You should be able to do embed:@{} which uses iframe. perhaps we should also have a ajax:@{...} This requires some more thought. What features would you like to see? On Friday, 6 April 2012 10:34:17 UTC-5, Alan Etkin wrote: > > > @{controller/function/a/r/g/s.extensi

[web2py] Re: nice to introduce new button in grid

2012-04-06 Thread Massimo Di Pierro
I really think these buttons should go away in favor of a dropdown menu. On Friday, 6 April 2012 10:15:30 UTC-5, Manuele wrote: > > can you suggest a nice looking solution for easly introduce new buttons > in grid and smartgrid when I'm in edit mode? > This are an example of a button to introduce

[web2py] Re: Uploads saving to DB, but not to file system

2012-04-06 Thread Massimo Di Pierro
say you have a vars.file_name that contains the file to be uploaded. Before the insert you need to do (I think): vars.file_name = db.UPLOAD.file_name.store(vars.file_name.file,filename=ars.file_name.filename) Perhaps this can be automated a little but. Let me give it some thought. Please open

Re: [web2py] nice to introduce new button in grid

2012-04-06 Thread Jonathan Lundell
On Apr 6, 2012, at 8:15 AM, Manuele Pesenti wrote: > > can you suggest a nice looking solution for easly introduce new buttons in > grid and smartgrid when I'm in edit mode? > This are an example of a button to introduce: > > my_extra_element_1 = FORM(INPUT(_type="submit", _value=T('Share data')

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Alan Etkin
> @{controller/function/a/r/g/s.extension} (converts to the corresponding full URL http:///app/controller/function/a/r/g/s.extension) The example as is didn't work for me: this instead did: @{appname/controller/function.extension} And as I posted elsewhere makes a link. Now for me this could

[web2py] nice to introduce new button in grid

2012-04-06 Thread Manuele Pesenti
can you suggest a nice looking solution for easly introduce new buttons in grid and smartgrid when I'm in edit mode? This are an example of a button to introduce: my_extra_element_1 = FORM(INPUT(_type="submit", _value=T('Share data')), _action=URL('share_data_with_users', args=table_id)) I wo

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Alan Etkin
I should have tested it before posting. My guess was that it will return a link to an absolute URL. What I meant was that I expected the actual data returned by the controller function call (normally a dict), although I don't know how this should be rendered when processed by markmin. Perhaps a

[web2py] Uploads saving to DB, but not to file system

2012-04-06 Thread rdodev
I already searched thought this groups for uploads and found a bunch similar questions, but not exactly my case -- I apologize if this has been answered before. I have a minimal RESTful web service defined as follows: db.define_table('UPLOAD', Field('custom_name' ,type='string', length=40,

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Massimo Di Pierro
On Friday, 6 April 2012 08:30:03 UTC-5, Alan Etkin wrote: > > I think this is groovy (i.e. one notch up from cool) > > However, there's one thing: if @{hello} returns the output of the > variable, shouldn't @{a/b/c} return the output of the call to the url? > Isn't that what it does? > > On

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Massimo Di Pierro
Let me think about his. On Friday, 6 April 2012 06:43:47 UTC-5, villas wrote: > > Hi Massimo > > I love to see improvements to Markmin, it's great. > > One thing that I do is substituting my own special 'tags' in my Markmin > text with info from my 'Snippets' table which contains standard paragr

[web2py] Re: Trying to debug welcome with trunk

2012-04-06 Thread Massimo Di Pierro
sorry. fixed. On Friday, 6 April 2012 07:23:19 UTC-5, Alan Etkin wrote: > > I pulled the last version and get an error when welcome starts: > > Version 1.99.7 (2012-04-05 22:06:40) dev > > Traceback (most recent call last): > File "/home/alan/web2py/web2py-hg/gluon/restricted.py", line 205, in

[web2py] Re: new feature in trunk: generic.map

2012-04-06 Thread Alan Etkin
Will the example mark db points in a google map? Are there any other uses possible provided by the Google API trough the web2py interface? On Thursday, April 5, 2012 8:54:32 PM UTC-3, Massimo Di Pierro wrote: > > Example: > > # model > db.define_table('point', > Field('name'), >

Re: [web2py] Re: data source configuration

2012-04-06 Thread Anthony
> > could you explain how this would look in detail? > So I would have a file called settings.py in the modules folder and the > following content: > dbconnection = '...' > > in my model files I could access the variable dbconnection, right? > Yes, but of course you have to import the settings m

Re: [web2py] new feature in trunk: full auditing

2012-04-06 Thread Massimo Di Pierro
yes On Friday, 6 April 2012 01:58:14 UTC-5, szimszon wrote: > > And there is still a archive_db parameter? > > Like: > db.table._archive_records(archive_db=other_db) > > 2012. április 6., péntek 3:28:40 UTC+2 időpontban Massimo Di Pierro a > következőt írta: >> >> Please check it again. I did no

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread Alan Etkin
I think this is groovy (i.e. one notch up from cool) However, there's one thing: if @{hello} returns the output of the variable, shouldn't @{a/b/c} return the output of the call to the url? On Friday, April 6, 2012 12:08:57 AM UTC-3, Massimo Di Pierro wrote: > > Consider this text > > text = """

[web2py] Re: Restful/Crud best practices?

2012-04-06 Thread rdodev
Bumping this discussion, because I'm really wondering how to avoid repetition of code when using restful requests (and in particular the crud wrapper). A follow up question perhaps is, should crud be used at all when implementing restful services? TIA. On Thursday, April 5, 2012 4:41:24 PM UTC-

[web2py] Re: reference or list:reference

2012-04-06 Thread Anthony
> > db.define_table('Node', > Field('createdOn',type='datetime',writable=False,readable=False), > Field('modifiedOn',type='datetime',writable= False,readable=False), > migrate=False) > > db.define_table('Keyword', > Field('word',length=128,default='',notnull=True,unique=True), >

Re: [web2py] Re: data source configuration

2012-04-06 Thread Alex
could you explain how this would look in detail? So I would have a file called settings.py in the modules folder and the following content: dbconnection = '...' in my model files I could access the variable dbconnection, right? settings.py is only loaded once (I'm not that familiar with modules)

[web2py] Trying to debug welcome with trunk

2012-04-06 Thread Alan Etkin
I pulled the last version and get an error when welcome starts: Version 1.99.7 (2012-04-05 22:06:40) dev Traceback (most recent call last): File "/home/alan/web2py/web2py-hg/gluon/restricted.py", line 205, in restricted exec ccode in environment File "/home/alan/web2py/web2py-hg/applicat

[web2py] Re: new feature in trunk: better markmin

2012-04-06 Thread villas
Hi Massimo I love to see improvements to Markmin, it's great. One thing that I do is substituting my own special 'tags' in my Markmin text with info from my 'Snippets' table which contains standard paragraphs. For example... My special tag in Markmin text is: {id} Or, more flexibly: {myt

[web2py] How to install gluon in virtualenv?

2012-04-06 Thread Vincenzo Ampolo
Hi, How can I install and use gluon in virtualenv ? Thanks -- Vincenzo Ampolo http://vincenzo-ampolo.net http://goshawknest.wordpress.com

[web2py] IS_IN_DB with join

2012-04-06 Thread Manuele Pesenti
what are the possible record representation for the IS_IN_DB validator in this case? join = (db.auth_membership.group_id==db.auth_group.id)\ &(db.auth_membership.user_id==db.auth_user.id) requires=IS_IN_DB(db(join), 'auth_group.id') the string '%(auth_user.first_name)s' is not accepted as I ex

[web2py] Re: DataTables Help needed

2012-04-06 Thread Vineet
> Actually, it was a typo on my part...I did get it to work but now, working > on 23,500 records and it takes so long to process..is that jquery?? > With that much of data to load, your best bet would be AJAX. dataTables plugin provides for loading data with server-side ajax function. You mi

Re: [web2py] new feature in trunk: generic.map

2012-04-06 Thread Manuele Pesenti
+1 I think I'll propose generic_openlayers.map :-) Manuele Il 06/04/2012 01:54, Massimo Di Pierro ha scritto: Example: # model db.define_table('point', Field('name'), Field('latitude','double'), Field('longitude','double')) #controller def map(): retur

[web2py] reference or list:reference

2012-04-06 Thread Annet
I defined the following tables: db.define_table('Node', Field('createdOn',type='datetime',writable=False,readable=False), Field('modifiedOn',type='datetime',writable= False,readable=False), migrate=False) db.define_table('Keyword', Field('word',length=128,default='',notnull=True,u

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-06 Thread Kenny Chung
I just did it. :) thank you. On Fri, Apr 6, 2012 at 12:10 AM, pbreit wrote: > I don't think so. Try: apt-get install python-imaging

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-06 Thread pbreit
I don't think so. Try: apt-get install python-imaging