[web2py] Re: From ul to bootstrap row

2012-06-03 Thread Annet
Hi Anthony,

Thanks for your reply, exactly what I'd hoped for.

I was left with one small problem, in case of an odd number or rows in 
socialmedia I was missing a  and closing  

I solved it by adding this:

After this:

{{for i, r in enumerate(relatednames):}}
  {{if not i % 2:}}{{pass}}

  {{=r}}
  
  {{if i % 2:}}{{pass}}

... I added this:

  {{n=i}}
{{pass}}
{{if not n % 2:}}
   
  
 {{pass}}


I am not sure it's the most elegant way to solve the problem, but it works.


@pbreit

> Sounds like you should be using a table.

Maybe, but I wanted to make use of twitter bootstraps grid, which saves me 
css code.


Kind regards,

Annet


{{if :}}
   
  
{{pass}}



Re: [web2py] Twitter OAuth lib

2012-06-03 Thread Michele Comitini
Twitter oauth is supported by web2py natively.

mic
Il giorno 03/giu/2012 02:37, "Udi Milo"  ha scritto:

> I want to allow my users to connect a Twitter account to their account.
> Which python lib do you recommend using?
>
> Twython uses requests which I'm having difficulty running on 2.5.4 and I have 
> not tried any other yet.
>
>


[web2py] Re: appadmin in Romanian (for Massimo)

2012-06-03 Thread CtrlSoft

salut Ioane! )

[web2py] Dynamic model creation

2012-06-03 Thread Christian
Hello group,

I found a backend service, mostly for mobile apps, called parse.com. Looking at 
their REST documentation (https://parse.com/docs/rest), it looks like one can 
e.g. dynamically generate different kind of objects, which get persistet (see 
"creating objects" in the docs to see what I mean). These objects can get 
relationships to other objects and can also be queried. So if the client posts 
GameScore or GameScores, both are valid (but different) objects (in different 
tables?)  and get persisted,
My questions: how looks sth. like this on the model side? How is this done? How 
to model general tables and still make them queryable. Or does the model 
generate tables dynamically? Could something like this be modeled with DAL? 
On the controller side: could such a dynamic model be made available via sth 
like @request.restful?

I would be happy for any hint, as I have no idea, how this is done!

Thanks and regards,
Christian

P.S.: I also found a open source clone, which rebuilds the iOS client library 
and the server with node and MongoDB, if this might be of any help. I do not 
speak JS and have no clue about mongo. https://github.com/eaigner/DataKit



[web2py] Re: appadmin in Romanian (for Massimo)

2012-06-03 Thread rif
Thank you very much, Ionel!

-rif

sâmbătă, 2 iunie 2012, 18:30:30 UTC+3, ionel a scris:
>
> Hello Massimo,
>
> This is the language file for appadmin in Romanian.
>
> Thank you,
>
> i.a.
>
>

[web2py] Re: sqlform.grid html text

2012-06-03 Thread CtrlSoft
thanks! 

On Tuesday, May 29, 2012 1:14:54 AM UTC+3, villas wrote:
>
> You could try to use .represent.  I mean something a bit like this...
>
> db.yourtable.yourfield.represent = lambda yourfield,row: XML(yourfield)
> query = db
> grid = SQLFORM.grid(query.)
> return dict(grid=grid)
>
> Hope it works!
>


[web2py] Re: Trouble migrating databases

2012-06-03 Thread david.waldrop

More headaches.  I gave up on trying to migrate because I do not know what 
is going on.  I suspect the DAL table definitions, the actual database 
tables, and the mysterious *.table files are out of sync in some weird way. 
 If anyone has any pointers on this I think I will have to figure it out 
sooner or later in order to deploy production apps.

Meanwhile I have hit another dead end.  I tried to delete the entire 
content of the database sub-directory, let web2py rebuild the empty table 
structures, and use the db.export_to_csv, and db.import_from_csv 
capability.  This appeared to work, but did not preserve the correct 
relationships between tables.  For example in production my id 
is associated with "meeting.ids" 1 and 19, but after export and import I 
was associated with someone else's meeting.

This has been a long weekend so far with very little progress.  I am hoping 
the breakthroughs start right now.


[web2py] Re: SQLFORM list with indirect labels

2012-06-03 Thread Martin Barnard
You know, this should be in the book. 
Hereon the 
section regarding record representation would be a good point. 

Martin


On Saturday, 2 June 2012 21:14:56 UTC+3, Anthony wrote:
>
> db.define_table('customers_job',
>> Field('city', db.cities),
>> Field('description', 'text'),
>> Field('customer', db.customer),
>> format="%(customer)s - %(city)s"
>> )
>
>
> The "format" argument to define_table() is not recursive -- the "customer" 
> value in the format argument above will simply be the value of the 
> "customer" field, which is an integer id referring to the db.customer 
> table. The db.customer table has its own "format" argument, but that format 
> is not used in constructing the formats of any referring tables. Instead of 
> providing a string format, as above, you can use a callable (e.g., lambda) 
> format to achieve what you want:
>
> db.define_table('customers_job',
> Field('city', db.cities),
> Field('description', 'text'),
> Field('customer', db.customer),
> format=lambda r: '%s - %s' % (db.customer[r.customer].customer,
>   db.cities[r.city].city)
> )
>
> That will take the id values of the record from the city and customer 
> fields and use them to query the db.customer and db.cities tables, 
> respectively, to obtain the customer and city names.
>
> Anthony
>


[web2py] Re: Trouble migrating databases

2012-06-03 Thread david.waldrop
Some minor breakthru.  I have fixed "most" (that I know of)  of the 
migration errors - Manually.
I was successful at using the DAL option fake_migrate_all = True and 
migrate_enabled = True which created some of the *.Table files - (but not 
all, also this did not seem to do anything to help except for refresh the 
SQL.LOG)
I then compared the structure in the SQL.LOG file to each table and added 
some missing fields directly to the sqllite database using a slqlite editor.
I am back to where I need to be on the migration, but have no real idea 
what went wrong or if it will happen again. Needless to say this should be 
less complex and more transparent - even better if it "JUST WORKS, ALL THE 
TIME"

*One open question remains about Export_to_CSV,and import_from_CSV screwing 
up the relationships between records.any insight would be much 
appreciated*




[web2py] Non Janrain authentication docs are out-of-date

2012-06-03 Thread Alec Taylor
Reading through the authentication docs because I want Facebook and
Twitter auth for my web2py app.

Unfortunately the Facebook auth example no longer works, since about 6
months ago Facebook stopped maintaining an SDK for Python.

Looks like it's being maintained here now: https://github.com/pythonforfacebook/

So maybe update the docs to use that.

However it might be time to add in something to the docs that supports
auth in a few different networks (e.g.: Facebook, Google, Twitter and
LinkedIn), without requiring Janrain?

This project allows for this for App Engine, but I haven't yet tried
to incorporate it into web2py or get it running without GAE:
https://github.com/crhym3/simpleauth

Interested in hearing your thoughts,

Alec Taylor


Re: [web2py] Re: Trouble migrating databases

2012-06-03 Thread Ovidio Marinho
I also tried to migrate sqlite to postgres with the migration tools
and fails. Double the fields in comparison with the sqlite postgres,
and the creation of random fields were needed to redo the hand and
imports  .csv that were occurring right in sqlite does not accept
headers in postgres, even going through problems, but the migration is
being done in hand same. And yet not understood migrate_enabled =
True, there was no use to me. My solution is being made ​​step by
step, or hand to hand.



       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2012/6/3 david.waldrop :
> Some minor breakthru.  I have fixed "most" (that I know of)  of the
> migration errors - Manually.
> I was successful at using the DAL option fake_migrate_all = True and
> migrate_enabled = True which created some of the *.Table files - (but not
> all, also this did not seem to do anything to help except for refresh the
> SQL.LOG)
> I then compared the structure in the SQL.LOG file to each table and added
> some missing fields directly to the sqllite database using a slqlite editor.
> I am back to where I need to be on the migration, but have no real idea what
> went wrong or if it will happen again. Needless to say this should be less
> complex and more transparent - even better if it "JUST WORKS, ALL THE TIME"
>
> One open question remains about Export_to_CSV,and import_from_CSV screwing
> up the relationships between records.any insight would be much
> appreciated
>
>


[web2py] Re: Trouble migrating databases

2012-06-03 Thread Massimo Di Pierro
Hello David,

glad to know this was resolved. I was looking into it on my side and I do 
not know what may have caused it. My guess is that you had migrations off, 
you upgraded and auth needed to add some fields but migrations where off. 
What happened after that I do not know.

About export/import. Are you doing it for one table at the time or for all 
tables are once? Can you show us some code?

Massimo

On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:
>
> Some minor breakthru.  I have fixed "most" (that I know of)  of the 
> migration errors - Manually.
> I was successful at using the DAL option fake_migrate_all = True and 
> migrate_enabled = True which created some of the *.Table files - (but not 
> all, also this did not seem to do anything to help except for refresh the 
> SQL.LOG)
> I then compared the structure in the SQL.LOG file to each table and added 
> some missing fields directly to the sqllite database using a slqlite editor.
> I am back to where I need to be on the migration, but have no real idea 
> what went wrong or if it will happen again. Needless to say this should be 
> less complex and more transparent - even better if it "JUST WORKS, ALL THE 
> TIME"
>
> *One open question remains about Export_to_CSV,and import_from_CSV 
> screwing up the relationships between records.any insight would be much 
> appreciated*
>
>
>

[web2py] smartgrid and unsupported query error

2012-06-03 Thread weheh
I'm running SQLFORM.smartgrid with a left= join as follows:

grid = SQLFORM.smartgrid(
   db.url_queue,
   constraints=dict(url_queue=query),
   left=db.brand.on(
   (auth.accessible_query('read', db.brand, auth.user_id)) &
   (db.brand.id == db.url_queue.brand_id)
   ),
   fields=[...],
   headers={...},
   paginate=20,
   maxtextlength=100,
   searchable=True,
   deletable=True,
   editable=False,
   details=False,
   create=False,
   ui='web2py',
   linked_tables=[],
   )
The left join is causing smartgrid to give me an "unsupported query" error 
message. If I comment out the left= arg, the error message goes away but 
the query returns the wrong data, as expected. Any help would be appreciated
. Thanks.


[web2py] Re: smartgrid and unsupported query error

2012-06-03 Thread Massimo Di Pierro
Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense 
that it displays only one table at the time but knows how to link other 
tables automatically.

In principle it should be possible to make left joins work. Please open a 
suggestion for improvement with an example on google issues

Massimo

On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>
> I'm running SQLFORM.smartgrid with a left= join as follows:
>
> grid = SQLFORM.smartgrid(
>db.url_queue,
>constraints=dict(url_queue=query),
>left=db.brand.on(
>(auth.accessible_query('read', db.brand, auth.user_id)) 
> &
>(db.brand.id == db.url_queue.brand_id)
>),
>fields=[...],
>headers={...},
>paginate=20,
>maxtextlength=100,
>searchable=True,
>deletable=True,
>editable=False,
>details=False,
>create=False,
>ui='web2py',
>linked_tables=[],
>)
> The left join is causing smartgrid to give me an "unsupported query"error 
> message
> . If I comment out the left= arg, the error message goes away but the 
> query returns the wrong data, as expected. Any help would be appreciated. 
> Thanks.
>


RE: [web2py] Re: Trouble migrating databases

2012-06-03 Thread David Waldrop
Massimo,  I am basically using the examples right form the book.  I am deleting 
the local SQLlite database and the tables (now that I have a handle on the 
migration stuff) and would like to copy the current postgress production 
database to the local sqlite version.  I tried at 1st with meeting monkey and 
noted the relationships between records in different tables is not preserved. I 
also trued with COPSIS and have a similar situation.  Does Import/Export know 
how to maintain relationships across tables using the original primary and 
foreign keys?

 

Code from book I am using ->

 

def dumpdb():

#download(db.export_to_csv_file(open('c:/meetingmonkey_back_up.csv','w')))

import StringIO

s = StringIO.StringIO()

db.export_to_csv_file(s)

response.headers['Content-Type'] = 'text/csv'

return s.getvalue()

 

 

def loaddb():

form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))

if form.process(session=None).accepted:

db.import_from_csv_file(form.vars.data.file,unique=False)

# for every table

#for table in db.tables:

## for every uuid, delete all but the latest

#items = db(db[table]).select(db[table].id,

#   db[table].uuid,

#   orderby=db[table].modified_on,

#   groupby=db[table].uuid)

#for item in items:

#db((db[table].uuid==item.uuid)&\

#   (db[table].id!=item.id)).delete()

return dict(form=form)

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: Sunday, June 03, 2012 12:11 PM
To: web2py@googlegroups.com
Subject: [web2py] Re: Trouble migrating databases

 

Hello David,

 

glad to know this was resolved. I was looking into it on my side and I do not 
know what may have caused it. My guess is that you had migrations off, you 
upgraded and auth needed to add some fields but migrations where off. What 
happened after that I do not know.

 

About export/import. Are you doing it for one table at the time or for all 
tables are once? Can you show us some code?

 

Massimo

On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:

Some minor breakthru.  I have fixed "most" (that I know of)  of the migration 
errors - Manually.

I was successful at using the DAL option fake_migrate_all = True and 
migrate_enabled = True which created some of the *.Table files - (but not all, 
also this did not seem to do anything to help except for refresh the SQL.LOG)

I then compared the structure in the SQL.LOG file to each table and added some 
missing fields directly to the sqllite database using a slqlite editor.

I am back to where I need to be on the migration, but have no real idea what 
went wrong or if it will happen again. Needless to say this should be less 
complex and more transparent - even better if it "JUST WORKS, ALL THE TIME"

 

One open question remains about Export_to_CSV,and import_from_CSV screwing up 
the relationships between records.any insight would be much appreciated

 

 



[web2py] Re: smartgrid and unsupported query error

2012-06-03 Thread weheh
Hmm, from researching the forum on the topic and reading the doc I could 
have sworn that smartgrid supported left. In fact, I believe in my testing 
I have seen it respond appropriately to the left argument. Nevertheless, I 
changed my code back to grid (I had started out with grid and moved to 
smartgrid). Now it looks like this, but produces the same "unsupported 
query" error message:
grid = SQLFORM.grid(
query,
left=db.brand.on(
(auth.accessible_query('read', db.brand, auth.user_id)) 
&
(db.brand.id == db.url_queue.brand_id)
),
fields=[
db.url_queue.brand_id,
db.url_queue.host_id,
db.url_queue.mail_cnt,
db.url_queue.url,
db.url_queue.status,
],
headers={
'url_queue.brand_id': 'Brand',
'url_queue.host_id': 'Host',
'url_queue.mail_cnt': 'Mail Count',
'url_queue.url': 'URL',
'url_queue.status': 'Status',
},
paginate=20,
maxtextlength=100,
searchable=True,
deletable=True,
editable=False,
details=False,
create=False,
ui='web2py',
)




On Monday, June 4, 2012 12:40:49 AM UTC+8, Massimo Di Pierro wrote:
>
> Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense 
> that it displays only one table at the time but knows how to link other 
> tables automatically.
>
> In principle it should be possible to make left joins work. Please open a 
> suggestion for improvement with an example on google issues
>
> Massimo
>
> On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>>
>> I'm running SQLFORM.smartgrid with a left= join as follows:
>>
>> grid = SQLFORM.smartgrid(
>>db.url_queue,
>>constraints=dict(url_queue=query),
>>left=db.brand.on(
>>(auth.accessible_query('read', db.brand, auth.user_id
>> )) &
>>(db.brand.id == db.url_queue.brand_id)
>>),
>>fields=[...],
>>headers={...},
>>paginate=20,
>>maxtextlength=100,
>>searchable=True,
>>deletable=True,
>>editable=False,
>>details=False,
>>create=False,
>>ui='web2py',
>>linked_tables=[],
>>)
>> The left join is causing smartgrid to give me an "unsupported query"error 
>> message
>> . If I comment out the left= arg, the error message goes away but the 
>> query returns the wrong data, as expected. Any help would be appreciated. 
>> Thanks.
>>
>
On Monday, June 4, 2012 12:40:49 AM UTC+8, Massimo Di Pierro wrote:
>
> Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense 
> that it displays only one table at the time but knows how to link other 
> tables automatically.
>
> In principle it should be possible to make left joins work. Please open a 
> suggestion for improvement with an example on google issues
>
> Massimo
>
> On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>>
>> I'm running SQLFORM.smartgrid with a left= join as follows:
>>
>> grid = SQLFORM.smartgrid(
>>db.url_queue,
>>constraints=dict(url_queue=query),
>>left=db.brand.on(
>>(auth.accessible_query('read', db.brand, auth.user_id
>> )) &
>>(db.brand.id == db.url_queue.brand_id)
>>),
>>fields=[...],
>>headers={...},
>>paginate=20,
>>maxtextlength=100,
>>searchable=True,
>>deletable=True,
>>editable=False,
>>details=False,
>>create=False,
>>ui='web2py',
>>linked_tables=[],
>>)
>> The left join is causing smartgrid to give me an "unsupported query"error 
>> message
>> . If I comment out the left= arg, the error message goes away but the 
>> query returns the wrong data, as expected. Any help would be appreciated. 
>> Thanks.
>>
>

Re: [web2py] Re: return from model

2012-06-03 Thread weheh

>
> How about this: can I raise HTTP 200 from a model, and supply a simple 
> string response?
>
 
I do this in one of my web2py apps and it works fine. 


[web2py] Django CRM + Commerce

2012-06-03 Thread pbreit
Good model. Mezzanine + Cartridge:
https://groups.google.com/forum/?fromgroups#!topic/django-users/5_VcKbID514


[web2py] Re: Dynamic model creation

2012-06-03 Thread pbreit
My guess is it's NoSQL, probably Mongo which seems to be the preferred DB 
behind a lot of these "real-time" JavaScript frameworks.


On Sunday, June 3, 2012 2:35:34 AM UTC-7, Christian wrote:
>
> Hello group,
>
> I found a backend service, mostly for mobile apps, called parse.com. 
> Looking at their REST documentation (https://parse.com/docs/rest), it 
> looks like one can e.g. dynamically generate different kind of objects, 
> which get persistet (see "creating objects" in the docs to see what I 
> mean). These objects can get relationships to other objects and can also be 
> queried. So if the client posts GameScore or GameScores, both are valid 
> (but different) objects (in different tables?)  and get persisted,
> My questions: how looks sth. like this on the model side? How is this 
> done? How to model general tables and still make them queryable. Or does 
> the model generate tables dynamically? Could something like this be modeled 
> with DAL? 
> On the controller side: could such a dynamic model be made available via 
> sth like @request.restful?
>
> I would be happy for any hint, as I have no idea, how this is done!
>
> Thanks and regards,
> Christian
>
> P.S.: I also found a open source clone, which rebuilds the iOS client 
> library and the server with node and MongoDB, if this might be of any help. 
> I do not speak JS and have no clue about mongo. 
> https://github.com/eaigner/DataKit
>
>

Re: [web2py] Re: Trouble migrating databases

2012-06-03 Thread Ovidio Marinho
I'm following the discussion and would like it because it really
worked for me is the third time I have to migrate sqlite to postgres
and options listed do not work, at least in large applications in a
small application that can work, but when you have many relationships
and diversity of types of attributes, the scripts always generate
errors. I am again having to do the procedure manual.



       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2012/6/3 David Waldrop :
> Massimo,  I am basically using the examples right form the book.  I am
> deleting the local SQLlite database and the tables (now that I have a handle
> on the migration stuff) and would like to copy the current postgress
> production database to the local sqlite version.  I tried at 1st with
> meeting monkey and noted the relationships between records in different
> tables is not preserved. I also trued with COPSIS and have a similar
> situation.  Does Import/Export know how to maintain relationships across
> tables using the original primary and foreign keys?
>
>
>
> Code from book I am using ->
>
>
>
> def dumpdb():
>
>
> #download(db.export_to_csv_file(open('c:/meetingmonkey_back_up.csv','w')))
>
>     import StringIO
>
>     s = StringIO.StringIO()
>
>     db.export_to_csv_file(s)
>
>     response.headers['Content-Type'] = 'text/csv'
>
>     return s.getvalue()
>
>
>
>
>
> def loaddb():
>
>     form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))
>
>     if form.process(session=None).accepted:
>
>     db.import_from_csv_file(form.vars.data.file,unique=False)
>
>     # for every table
>
>     #for table in db.tables:
>
>     #    # for every uuid, delete all but the latest
>
>     #    items = db(db[table]).select(db[table].id,
>
>     #   db[table].uuid,
>
>     #   orderby=db[table].modified_on,
>
>     #   groupby=db[table].uuid)
>
>     #    for item in items:
>
>     #    db((db[table].uuid==item.uuid)&\
>
>     #   (db[table].id!=item.id)).delete()
>
>     return dict(form=form)
>
>
>
> From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of
> Massimo Di Pierro
> Sent: Sunday, June 03, 2012 12:11 PM
> To: web2py@googlegroups.com
> Subject: [web2py] Re: Trouble migrating databases
>
>
>
> Hello David,
>
>
>
> glad to know this was resolved. I was looking into it on my side and I do
> not know what may have caused it. My guess is that you had migrations off,
> you upgraded and auth needed to add some fields but migrations where off.
> What happened after that I do not know.
>
>
>
> About export/import. Are you doing it for one table at the time or for all
> tables are once? Can you show us some code?
>
>
>
> Massimo
>
> On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:
>
> Some minor breakthru.  I have fixed "most" (that I know of)  of the
> migration errors - Manually.
>
> I was successful at using the DAL option fake_migrate_all = True and
> migrate_enabled = True which created some of the *.Table files - (but not
> all, also this did not seem to do anything to help except for refresh the
> SQL.LOG)
>
> I then compared the structure in the SQL.LOG file to each table and added
> some missing fields directly to the sqllite database using a slqlite editor.
>
> I am back to where I need to be on the migration, but have no real idea what
> went wrong or if it will happen again. Needless to say this should be less
> complex and more transparent - even better if it "JUST WORKS, ALL THE TIME"
>
>
>
> One open question remains about Export_to_CSV,and import_from_CSV screwing
> up the relationships between records.any insight would be much
> appreciated
>
>
>
>


[web2py] Authentication failed & ajax call

2012-06-03 Thread Paolo

Hi all,
I've just figured out that on_failed_authentication works only when 
requests are not ajax calls. It would be nice to have a custom method 
even if request.ajax is True, what about to add a new method (i.e., 
on_failed_authentication_ajax) to auth settings?
Otherwise how I can redirect to the login page even when the 
request.ajax is True?


Regards,
--
 Paolo


[web2py] Re: smartgrid and unsupported query error

2012-06-03 Thread Massimo Di Pierro
Then perhaps I am wrong. Still open a ticket about this. I will debug it 
asap but I do not want to forget about this.

On Sunday, 3 June 2012 11:56:19 UTC-5, weheh wrote:
>
> Hmm, from researching the forum on the topic and reading the doc I could 
> have sworn that smartgrid supported left. In fact, I believe in my testing 
> I have seen it respond appropriately to the left argument. Nevertheless, I 
> changed my code back to grid (I had started out with grid and moved to 
> smartgrid). Now it looks like this, but produces the same "unsupported 
> query" error message:
> grid = SQLFORM.grid(
> query,
> left=db.brand.on(
> (auth.accessible_query('read', db.brand, 
> auth.user_id)) &
> (db.brand.id == db.url_queue.brand_id)
> ),
> fields=[
> db.url_queue.brand_id,
> db.url_queue.host_id,
> db.url_queue.mail_cnt,
> db.url_queue.url,
> db.url_queue.status,
> ],
> headers={
> 'url_queue.brand_id': 'Brand',
> 'url_queue.host_id': 'Host',
> 'url_queue.mail_cnt': 'Mail Count',
> 'url_queue.url': 'URL',
> 'url_queue.status': 'Status',
> },
> paginate=20,
> maxtextlength=100,
> searchable=True,
> deletable=True,
> editable=False,
> details=False,
> create=False,
> ui='web2py',
> )
>
>
>
>
> On Monday, June 4, 2012 12:40:49 AM UTC+8, Massimo Di Pierro wrote:
>>
>> Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense 
>> that it displays only one table at the time but knows how to link other 
>> tables automatically.
>>
>> In principle it should be possible to make left joins work. Please open a 
>> suggestion for improvement with an example on google issues
>>
>> Massimo
>>
>> On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>>>
>>> I'm running SQLFORM.smartgrid with a left= join as follows:
>>>
>>> grid = SQLFORM.smartgrid(
>>>db.url_queue,
>>>constraints=dict(url_queue=query),
>>>left=db.brand.on(
>>>(auth.accessible_query('read', db.brand, auth.user_id
>>> )) &
>>>(db.brand.id == db.url_queue.brand_id)
>>>),
>>>fields=[...],
>>>headers={...},
>>>paginate=20,
>>>maxtextlength=100,
>>>searchable=True,
>>>deletable=True,
>>>editable=False,
>>>details=False,
>>>create=False,
>>>ui='web2py',
>>>linked_tables=[],
>>>)
>>> The left join is causing smartgrid to give me an "unsupported query"error 
>>> message
>>> . If I comment out the left= arg, the error message goes away but the 
>>> query returns the wrong data, as expected. Any help would be appreciated
>>> . Thanks.
>>>
>>
> On Monday, June 4, 2012 12:40:49 AM UTC+8, Massimo Di Pierro wrote:
>>
>> Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense 
>> that it displays only one table at the time but knows how to link other 
>> tables automatically.
>>
>> In principle it should be possible to make left joins work. Please open a 
>> suggestion for improvement with an example on google issues
>>
>> Massimo
>>
>> On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>>>
>>> I'm running SQLFORM.smartgrid with a left= join as follows:
>>>
>>> grid = SQLFORM.smartgrid(
>>>db.url_queue,
>>>constraints=dict(url_queue=query),
>>>left=db.brand.on(
>>>(auth.accessible_query('read', db.brand, auth.user_id
>>> )) &
>>>(db.brand.id == db.url_queue.brand_id)
>>>),
>>>fields=[...],
>>>headers={...},
>>>paginate=20,
>>>maxtextlength=100,
>>>searchable=True,
>>>deletable=True,
>>>editable=False,
>>>details=False,
>>>create=False,
>>>ui='web2py',
>>>linked_tables=[],
>>>)
>>> The left join is causing smartgrid to give me an "unsupported query"error 
>>> message
>>> . If I comment out the left= arg, the error message goes away but the 
>>> query returns the wrong data, as expected. Any help would be appreciated
>>> . Thanks.
>>>
>>

Re: [web2py] Re: Trouble migrating databases

2012-06-03 Thread Massimo Di Pierro
Can you privately email me the model and the data you are trying import? I 
guess some recent patch must have broken the import. 

On Sunday, 3 June 2012 11:42:56 UTC-5, david.waldrop wrote:
>
> Massimo,  I am basically using the examples right form the book.  I am 
> deleting the local SQLlite database and the tables (now that I have a 
> handle on the migration stuff) and would like to copy the current postgress 
> production database to the local sqlite version.  I tried at 1st with 
> meeting monkey and noted the relationships between records in different 
> tables is not preserved. I also trued with COPSIS and have a similar 
> situation.  Does Import/Export know how to maintain relationships across 
> tables using the original primary and foreign keys?
>
>  
>
> Code from book I am using ->
>
>  
>
> def dumpdb():
>
> 
> #download(db.export_to_csv_file(open('c:/meetingmonkey_back_up.csv','w')))
>
> import StringIO
>
> s = StringIO.StringIO()
>
> db.export_to_csv_file(s)
>
> response.headers['Content-Type'] = 'text/csv'
>
> return s.getvalue()
>
>  
>
>  
>
> def loaddb():
>
> form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))
>
> if form.process(session=None).accepted:
>
> db.import_from_csv_file(form.vars.data.file,unique=False)
>
> # for every table
>
> #for table in db.tables:
>
> ## for every uuid, delete all but the latest
>
> #items = db(db[table]).select(db[table].id,
>
> #   db[table].uuid,
>
> #   orderby=db[table].modified_on,
>
> #   groupby=db[table].uuid)
>
> #for item in items:
>
> #db((db[table].uuid==item.uuid)&\
>
> #   (db[table].id!=item.id)).delete()
>
> return dict(form=form)
>
>  
>
> *From:* web2py@googlegroups.com [mailto:web2py@googlegroups.com] *On 
> Behalf Of *Massimo Di Pierro
> *Sent:* Sunday, June 03, 2012 12:11 PM
> *To:* web2py@googlegroups.com
> *Subject:* [web2py] Re: Trouble migrating databases
>
>  
>
> Hello David,
>
>  
>
> glad to know this was resolved. I was looking into it on my side and I do 
> not know what may have caused it. My guess is that you had migrations off, 
> you upgraded and auth needed to add some fields but migrations where off. 
> What happened after that I do not know.
>
>  
>
> About export/import. Are you doing it for one table at the time or for all 
> tables are once? Can you show us some code?
>
>  
>
> Massimo
>
> On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:
>
> Some minor breakthru.  I have fixed "most" (that I know of)  of the 
> migration errors - Manually.
>
> I was successful at using the DAL option fake_migrate_all = True and 
> migrate_enabled = True which created some of the *.Table files - (but not 
> all, also this did not seem to do anything to help except for refresh the 
> SQL.LOG)
>
> I then compared the structure in the SQL.LOG file to each table and added 
> some missing fields directly to the sqllite database using a slqlite editor.
>
> I am back to where I need to be on the migration, but have no real idea 
> what went wrong or if it will happen again. Needless to say this should be 
> less complex and more transparent - even better if it "JUST WORKS, ALL THE 
> TIME"
>
>  
>
> *One open question remains about Export_to_CSV,and import_from_CSV 
> screwing up the relationships between records.any insight would be much 
> appreciated*
>
>  
>
>  
>


[web2py] Re: Authentication failed & ajax call

2012-06-03 Thread Massimo Di Pierro
Good point. This is a complicated issue because it depends on the 
client-side app details. Anyway, please open a ticket about this.

On Sunday, 3 June 2012 15:30:05 UTC-5, Gabriella Canavesi wrote:
>
> Hi all, 
> I've just figured out that on_failed_authentication works only when 
> requests are not ajax calls. It would be nice to have a custom method 
> even if request.ajax is True, what about to add a new method (i.e., 
> on_failed_authentication_ajax) to auth settings? 
> Otherwise how I can redirect to the login page even when the 
> request.ajax is True? 
>
> Regards, 
> -- 
>   Paolo 
>


Re: [web2py] Re: Trouble migrating databases

2012-06-03 Thread Ovidio Marinho
Perhaps this can explain something, I have it on my definition:
   db.define_table('t_indicadores_estado',
Field('f_ano', 'integer',label=T('Ano')),
Field('f_taxa', 'integer', label=T('Taxa')),
Field('f_numero', 'integer', label=T('Numero')),
Field('f_nome', 'string',label=T('Nome')),
Field('f_categoria', 'string', label=T('Categoria')),
Field('f_mapa', 'upload',label=T('Mapa')),
auth.signature,
format='%(f_nome)s',
)

me and postgres generates this:

   postgres.png

Como o utilitario de importar csv pode fazer a alocaçao correta. tem
algum bug nisto, eu ainda nao descobri qual.mas estamos trabalhando.

       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2012/6/3 Ovidio Marinho :
> I'm following the discussion and would like it because it really
> worked for me is the third time I have to migrate sqlite to postgres
> and options listed do not work, at least in large applications in a
> small application that can work, but when you have many relationships
> and diversity of types of attributes, the scripts always generate
> errors. I am again having to do the procedure manual.
>
>
>
>        Ovidio Marinho Falcao Neto
>                 Web Developer
>              ovidio...@gmail.com
>           ovidiomari...@itjp.net.br
>                  ITJP - itjp.net.br
>                83   8826 9088 - Oi
>                83   9334 0266 - Claro
>                         Brasil
>
>
>
> 2012/6/3 David Waldrop :
>> Massimo,  I am basically using the examples right form the book.  I am
>> deleting the local SQLlite database and the tables (now that I have a handle
>> on the migration stuff) and would like to copy the current postgress
>> production database to the local sqlite version.  I tried at 1st with
>> meeting monkey and noted the relationships between records in different
>> tables is not preserved. I also trued with COPSIS and have a similar
>> situation.  Does Import/Export know how to maintain relationships across
>> tables using the original primary and foreign keys?
>>
>>
>>
>> Code from book I am using ->
>>
>>
>>
>> def dumpdb():
>>
>>
>> #download(db.export_to_csv_file(open('c:/meetingmonkey_back_up.csv','w')))
>>
>>     import StringIO
>>
>>     s = StringIO.StringIO()
>>
>>     db.export_to_csv_file(s)
>>
>>     response.headers['Content-Type'] = 'text/csv'
>>
>>     return s.getvalue()
>>
>>
>>
>>
>>
>> def loaddb():
>>
>>     form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))
>>
>>     if form.process(session=None).accepted:
>>
>>     db.import_from_csv_file(form.vars.data.file,unique=False)
>>
>>     # for every table
>>
>>     #for table in db.tables:
>>
>>     #    # for every uuid, delete all but the latest
>>
>>     #    items = db(db[table]).select(db[table].id,
>>
>>     #   db[table].uuid,
>>
>>     #   orderby=db[table].modified_on,
>>
>>     #   groupby=db[table].uuid)
>>
>>     #    for item in items:
>>
>>     #    db((db[table].uuid==item.uuid)&\
>>
>>     #   (db[table].id!=item.id)).delete()
>>
>>     return dict(form=form)
>>
>>
>>
>> From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of
>> Massimo Di Pierro
>> Sent: Sunday, June 03, 2012 12:11 PM
>> To: web2py@googlegroups.com
>> Subject: [web2py] Re: Trouble migrating databases
>>
>>
>>
>> Hello David,
>>
>>
>>
>> glad to know this was resolved. I was looking into it on my side and I do
>> not know what may have caused it. My guess is that you had migrations off,
>> you upgraded and auth needed to add some fields but migrations where off.
>> What happened after that I do not know.
>>
>>
>>
>> About export/import. Are you doing it for one table at the time or for all
>> tables are once? Can you show us some code?
>>
>>
>>
>> Massimo
>>
>> On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:
>>
>> Some minor breakthru.  I have fixed "most" (that I know of)  of the
>> migration errors - Manually.
>>
>> I was successful at using the DAL option fake_migrate_all = True and
>> migrate_enabled = True which created some of the *.Table files - (but not
>> all, also this did not seem to do anything to help except for refresh the
>> SQL.LOG)
>>
>> I then compared the structure in the SQL.LOG file to each table and added
>> some missing fields directly to the sqllite database using a slqlite editor.
>>
>> I am back to where I need to be on the migration, but have no real idea what
>> went wrong or if it will happen again. Needless to say this should be less
>> complex and more transparent - even better if it "JUST WORKS, ALL THE TIME"
>>
>>
>>
>> One open question remains about Export_to_CSV,and import_from_CSV screwing
>> up the relationships between re

Re: [web2py] Re: Trouble migrating databases

2012-06-03 Thread Ovidio Marinho
I have many tables, but I will send one as this happening to all.



db.define_table('t_macro',
Field('f_codigo', 'integer', label=T('Codigo')),
auth.signature,
format='%(f_codigo)s',
 )

db.define_table('t_indicadores_macro',
Field('f_macro', db.t_macro,label=T('Macro')),
Field('f_2006', 'integer',label=T('2006')),
Field('f_2007', 'integer',label=T('2007')),
Field('f_2008', 'integer',label=T('2008')),
Field('f_2009', 'integer',label=T('2009')),
Field('f_2010', 'integer',label=T('2010')),
Field('f_2011', 'integer',label=T('2011')),
Field('f_2012', 'integer',label=T('2012')),
Field('f_nome', 'string',label=T('Nome')),
Field('f_categoria', 'string',label=T('Categoria')),
Field('f_mapa', 'upload',label=T('Mapa')),
auth.signature,
format='%(f_nome)s',
 )


postgres returns me this

postgres.png ( annex)



How to import csv utility can make the correct allocation. it has a
bug, I have not yet discovered qual.mas are working.

Massimo, there is some time ago I did a conversion and at least the
definition of the bank was transferred sqlite identical, the same
sequence. ta problem with this now. I do not know why but I hope that
we find the problem.


       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2012/6/3 Massimo Di Pierro :
> Can you privately email me the model and the data you are trying import? I
> guess some recent patch must have broken the import.
>
>
> On Sunday, 3 June 2012 11:42:56 UTC-5, david.waldrop wrote:
>>
>> Massimo,  I am basically using the examples right form the book.  I am
>> deleting the local SQLlite database and the tables (now that I have a handle
>> on the migration stuff) and would like to copy the current postgress
>> production database to the local sqlite version.  I tried at 1st with
>> meeting monkey and noted the relationships between records in different
>> tables is not preserved. I also trued with COPSIS and have a similar
>> situation.  Does Import/Export know how to maintain relationships across
>> tables using the original primary and foreign keys?
>>
>>
>>
>> Code from book I am using ->
>>
>>
>>
>> def dumpdb():
>>
>>
>> #download(db.export_to_csv_file(open('c:/meetingmonkey_back_up.csv','w')))
>>
>>     import StringIO
>>
>>     s = StringIO.StringIO()
>>
>>     db.export_to_csv_file(s)
>>
>>     response.headers['Content-Type'] = 'text/csv'
>>
>>     return s.getvalue()
>>
>>
>>
>>
>>
>> def loaddb():
>>
>>     form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))
>>
>>     if form.process(session=None).accepted:
>>
>>     db.import_from_csv_file(form.vars.data.file,unique=False)
>>
>>     # for every table
>>
>>     #for table in db.tables:
>>
>>     #    # for every uuid, delete all but the latest
>>
>>     #    items = db(db[table]).select(db[table].id,
>>
>>     #   db[table].uuid,
>>
>>     #   orderby=db[table].modified_on,
>>
>>     #   groupby=db[table].uuid)
>>
>>     #    for item in items:
>>
>>     #    db((db[table].uuid==item.uuid)&\
>>
>>     #   (db[table].id!=item.id)).delete()
>>
>>     return dict(form=form)
>>
>>
>>
>> From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf
>> Of Massimo Di Pierro
>> Sent: Sunday, June 03, 2012 12:11 PM
>> To: web2py@googlegroups.com
>> Subject: [web2py] Re: Trouble migrating databases
>>
>>
>>
>> Hello David,
>>
>>
>>
>> glad to know this was resolved. I was looking into it on my side and I do
>> not know what may have caused it. My guess is that you had migrations off,
>> you upgraded and auth needed to add some fields but migrations where off.
>> What happened after that I do not know.
>>
>>
>>
>> About export/import. Are you doing it for one table at the time or for all
>> tables are once? Can you show us some code?
>>
>>
>>
>> Massimo
>>
>> On Sunday, 3 June 2012 09:45:00 UTC-5, david.waldrop wrote:
>>
>> Some minor breakthru.  I have fixed "most" (that I know of)  of the
>> migration errors - Manually.
>>
>> I was successful at using the DAL option fake_migrate_all = True and
>> migrate_enabled = True which created some of the *.Table files - (but not
>> all, also this did not seem to do anything to help except for refresh the
>> SQL.LOG)
>>
>> I then compared the structure in the SQL.LOG file to each table and added
>> some missing fields directly to the sqllite database using a slqlite editor.
>>
>> I am back to where I need to be on the migration, but have no real idea
>> what went wrong or if it will happen again. Needless to say this should be
>> less complex and more transparent - even better if it "JUST WORKS, ALL THE
>> TIME"
>>
>>
>>
>>

[web2py] w2p_tvseries: a new web2py app

2012-06-03 Thread Niphlod
hey, I finally managed to push my app to github, with some sweat involved

I haven't packaged an app and released to the public before, let's hope 
nobody has problems installing it :P

Let's cut to the chase, w2p_tvseries, as the name may suggest, is an app to 
organize tv shows on the disk.

It uses web2py, obviously, and as you'll read on github, I had a precise 
agenda for it:
- use as much web2py codebase as possible
- use extensively the scheduler
- test if Twitter Bootstrap (as opposed to jquery-ui that I used for all my 
previous projects) is "enough" for all the functionality required
- use AJAX wherever is possible: async stuff will take place probably in 
places where it was not necessary, but I decided to give it a shot whenever 
(and wherever) possible
- make it a multi-platform app
- combine some useful piece of scripts lying around my machine
- play and test the requests (https://github.com/kennethreitz/requests) 
library for all the HTTP communications


Some goodies:
- twitter bootstrap form serialization
- integration with jquery fullcalendar (someone asked a while ago about the 
implementation)
- play with webservices, namely tvdb.com and opensubtitles.org
- pagescraping of italiansubs.net
- async task scheduling with task reporting
- internal documentation written in MARKMIN
- a nasty multiform page, on this group is quite a recurring question 
(check series_settings() in controllers/manage.py)

I'm happy with some pieces of implementations, let's say the 80% of it 
modules singletons maybe account for a 10% I'm not happy about, and the 
last 10% is some pieces of code repeated.
This app 1 month ago looked like a puzzle (trying to piece together scripts 
ranging from 2 years ago to now ). It's in alpha stage, things can go 
wrong but nothing irreversible will be done ;-)

Please, web2py developers, feel free to install, review, propose patches 
and features, etc.



[web2py] Re: w2p_tvseries: a new web2py app

2012-06-03 Thread Niphlod
yes, you're right, where is the github url ??

https://github.com/niphlod/w2p_tvseries




Re: [web2py] failures

2012-06-03 Thread Ezugworie Ikechukwu
I just love the attitude (web2pytitude) with which you guys respond to
issues. Its very encouraging and reassuring.

On Sat, Jun 2, 2012 at 8:38 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Thank you Ricardo. I really need help with time. Do you need my help to
> create the mirrors? What should I do?
>
>
> On Saturday, 2 June 2012 10:49:20 UTC-5, strusberg wrote:
>>
>> Hi Massimo,
>>
>> I can give you web2py mirrors in some Latin America countries (CO, CL,
>> PA, PE, MX and VE) using the LatinuxORG infraestructure. Also in Europe,
>> France.
>>
>> Regards
>>
>> Ricardo Strusberg
>>
>> 2012/6/1 Massimo Di Pierro 
>>
>>> Today the VPS that hosts web2py.com failed (not sure what but I can no
>>> longer ssh into it). Is to happens that yesterday the HD of my laptop
>>> failed. My office mac is no longer syncing emails with outlook and gmail. A
>>> few other random and independent things have been failing on me in the last
>>> few days. I just wanted to reassure you that things will be taken care of
>>> and web2py.com is a priority. I may be a little slow on this list as a
>>> result.
>>>
>>> Massimo
>>>
>>
>>


Re: [web2py] Re: w2p_tvseries: a new web2py app

2012-06-03 Thread Ovidio Marinho
Very Well, congratulations!



       Ovidio Marinho Falcao Neto
                Web Developer
             ovidio...@gmail.com
          ovidiomari...@itjp.net.br
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil



2012/6/3 Niphlod :
> yes, you're right, where is the github url ??
>
> https://github.com/niphlod/w2p_tvseries
>
>


[web2py] Re: w2p_tvseries: a new web2py app

2012-06-03 Thread Massimo Di Pierro
No screenshots? :-(

On Sunday, 3 June 2012 18:05:22 UTC-5, Niphlod wrote:
>
> yes, you're right, where is the github url ??
>
> https://github.com/niphlod/w2p_tvseries
>
>
>

Re: [web2py] Twitter OAuth lib

2012-06-03 Thread Udi Milo
can you point me to an example or where can I find the code?

On Sunday, June 3, 2012 4:35:57 AM UTC-4, mcm wrote:
>
> Twitter oauth is supported by web2py natively.
>
> mic
> Il giorno 03/giu/2012 02:37, "Udi Milo"  ha scritto:
>
>> I want to allow my users to connect a Twitter account to their account.
>> Which python lib do you recommend using?
>>
>> Twython uses requests which I'm having difficulty running on 2.5.4 and I 
>> have not tried any other yet.
>>
>>  

[web2py] web2py on HelioHost

2012-06-03 Thread palomar
HI!
I'm a newbie and I would like to try web2py on a free hosting. I found 
Heliohost  but, after installation and 
following thist 
post,
 
I have "500 Internal Server Error". 
Somebody have already used heliohost? Or somebody can help me with the 
configuration?
Thanks (and sorry for my english...)
palomar


[web2py] Re: smartgrid and unsupported query error

2012-06-03 Thread weheh
Posted as  http://code.google.com/p/web2py/issues/detail?id=831 

[web2py]

2012-06-03 Thread yanqing zhang



[web2py] Decoupling web2py templates

2012-06-03 Thread Alec Taylor
Would it be possible to decouple web2py templates to use REST
(HTTP)[XML, CSV, JSON] or RPC (XML, JSON)?

The primary advantages I see for this is in the simplification for the
creation of:
- Mobile apps (using PhoneGap)
- Easy JavaScript widget extrapolation (Facebook/DISQUS/Twitter style)

Please tell me if it's possible to decouple the templates, and if so, how.

Thanks for all information,

Alec Taylor

PS: If it's not possible with web2py templates, is there a different
Python template library which makes this possible?


[web2py] Re: w2p_tvseries: a new web2py app

2012-06-03 Thread Massimo Di Pierro
:-)

On Sunday, 3 June 2012 21:14:10 UTC-5, Niphlod wrote:
>
> whoa, you're right 
> did I mention I'm not a web designer and that there are a few corners 
> where I could use some help with javascript ? If someone is interested 
> please let me know.
>
>
> Il giorno lunedì 4 giugno 2012 02:26:56 UTC+2, Massimo Di Pierro ha 
> scritto:
>>
>> No screenshots? :-(
>>
>> On Sunday, 3 June 2012 18:05:22 UTC-5, Niphlod wrote:
>>>
>>> yes, you're right, where is the github url ??
>>>
>>> https://github.com/niphlod/w2p_tvseries
>>>
>>>
>>>

[web2py] Re: Decoupling web2py templates

2012-06-03 Thread Massimo Di Pierro
If I understand your question. You can do 

return response.render(view, context=dict())

On Sunday, 3 June 2012 21:57:59 UTC-5, Alec Taylor wrote:
>
> Would it be possible to decouple web2py templates to use REST 
> (HTTP)[XML, CSV, JSON] or RPC (XML, JSON)? 
>
> The primary advantages I see for this is in the simplification for the 
> creation of: 
> - Mobile apps (using PhoneGap) 
> - Easy JavaScript widget extrapolation (Facebook/DISQUS/Twitter style) 
>
> Please tell me if it's possible to decouple the templates, and if so, how. 
>
> Thanks for all information, 
>
> Alec Taylor 
>
> PS: If it's not possible with web2py templates, is there a different 
> Python template library which makes this possible? 
>


[web2py] "Add a user" only showing logged in user.

2012-06-03 Thread Jason Brower

I have been trying to add a user and all I get is my current user.
I want the form so I am the one creating a new user while logged in.
I started with:
form = auth.register()
With shows my existing profile. And then:
form = crud.create(db.auth_user)
Which seems to do the same thing.
Any way I can do this without a manual form?

BR,
Jason Brower


[web2py] Fwd: "Add a user" only showing logged in user.

2012-06-03 Thread Jason Brower

Shizzle, ok, dumb typo on my part.  Works fine now.
BR,
Jason

 Original Message 
Subject:"Add a user" only showing logged in user.
Date:   Mon, 04 Jun 2012 06:35:06 +0300
From:   Jason Brower 
To: web2py@googlegroups.com



I have been trying to add a user and all I get is my current user.
I want the form so I am the one creating a new user while logged in.
I started with:
form = auth.register()
With shows my existing profile. And then:
form = crud.create(db.auth_user)
Which seems to do the same thing.
Any way I can do this without a manual form?

BR,
Jason Brower



[web2py] Re: smartgrid and unsupported query error [open]

2012-06-03 Thread weheh



Re: [web2py] Re: Decoupling web2py templates

2012-06-03 Thread Alec Taylor
I'm intrigued... you've piqued my interest.

Can you show me an example with a few more lines so I can see where
you were going with this?

Thanks

On Mon, Jun 4, 2012 at 1:34 PM, Massimo Di Pierro
 wrote:
> If I understand your question. You can do
>
> return response.render(view, context=dict())
>
>
> On Sunday, 3 June 2012 21:57:59 UTC-5, Alec Taylor wrote:
>>
>> Would it be possible to decouple web2py templates to use REST
>> (HTTP)[XML, CSV, JSON] or RPC (XML, JSON)?
>>
>> The primary advantages I see for this is in the simplification for the
>> creation of:
>> - Mobile apps (using PhoneGap)
>> - Easy JavaScript widget extrapolation (Facebook/DISQUS/Twitter style)
>>
>> Please tell me if it's possible to decouple the templates, and if so, how.
>>
>> Thanks for all information,
>>
>> Alec Taylor
>>
>> PS: If it's not possible with web2py templates, is there a different
>> Python template library which makes this possible?


Re: [web2py] Re: Authentication failed & ajax call

2012-06-03 Thread Paolo
Grazie Massimo, I've just opened an issue on google code, 
http://code.google.com/p/web2py/issues/detail?id=832

Regards,
paolo

Il 03.06.2012 21:05 Massimo Di Pierro ha scritto:

Good point. This is a complicated issue because it depends on the
client-side app details. Anyway, please open a ticket about this.

On Sunday, 3 June 2012 15:30:05 UTC-5, Gabriella Canavesi wrote:


Hi all,
I've just figured out that on_failed_authentication works only when
requests are not ajax calls. It would be nice to have a custom
method
even if request.ajax is True, what about to add a new method (i.e.,
on_failed_authentication_ajax) to auth settings?
Otherwise how I can redirect to the login page even when the
request.ajax is True?

Regards,
--
Paolo