Re: [web2py] Several controllers inserting and updating one row via forms

2013-08-30 Thread shapovalovdenis
Thanks, I indeed missed that hidden field with record id. From the book: "Edit 
forms also contain a hidden INPUT field with name="id" which is used to 
identify the record. "

Though I don't really understand why we need that field as record id is 
kept server-side anyway.

On Thursday, August 29, 2013 4:32:52 PM UTC+3, viniciusban wrote:
>
> It would be nice if you show your view. 
>
> Probably you're missing a hidden field in second form with the record id. 
>
> On Thu, Aug 29, 2013 at 10:12 AM,  > 
> wrote: 
> > Hi! 
> > 
> > I have an issue with UPDATE form. I'm trying to implement something like 
> > enrollment form that has man field beyond standard name, email, etc. For 
> the 
> > sake of usability I've decided to split it to two steps (i.e. 
> controllers - 
> > pages): first asks user for name and email, and after user submits it, 
> > he/she gets redirected to the second controller with UPDATE form for the 
> > same record, inserted with previous form. 
> > 
> > Btw, at first I thought of having a one page form and presenting it in 
> parts 
> > with help of JS, but I've decided to go with back end, to have even 
> > partially submitted data in database. 
> > 
> > def firstform(): 
> > form = SQLFORM(db.person, fields = ['email','name']) 
> > if form.process(session=None, formname='begin_form').accepted: 
> > session.person_id = form.vars.id 
> > session.flash = 'form accepted' 
> > redirect(URL('endjoin')) 
> > elif form.errors: 
> > response.flash = 'form has errors' 
> > else: 
> > response.flash = 'please fill the form' 
> > return dict() 
> > 
> > # and 
> > def secondform(): 
> > record = db.person(session.person_id) or redirect(URL('index')) 
> > form = SQLFORM(db.person, record, fields = 
> > ['address','phone','many_more_fields']) 
> > if form.process(session=None, formname='end_form').accepted: 
> > response.flash = 'form accepted' 
> > elif form.errors: 
> > response.flash = 'form has errors' 
> > else: 
> > response.flash = 'please fill the form' 
> > return dict() 
> > 
> > The problems is that second action 'firstform' makes insert, instead of 
> > update to the record inserted by first action 'secondform'. Though 
> 'record' 
> > contains reference to last add row, which should be updated(completed). 
> I'm 
> > not passing form to the view, I use custom html to present my forms, 
> because 
> > I didn't find a way to make helpers specify input type='email', 
> placeholder, 
> > size and other HTML5 form parts attributes. 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "web2py-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to web2py+un...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Using "external" database join with DAL

2013-08-30 Thread Gallien Labeyrie

Thanks for answering my question ! :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Link with cid not working properly in Chrome.

2013-08-30 Thread hiro
I am having problems getting this code to work i Chorme, it works correctly 
in IE and Firefox, but in Chrome the form opens in a new window instead of 
the div tag.

If I use Putty to connect to the server in order to use the admin 
interface, the code works correctly when I connect using localhost, but not 
when connect directly using the external IP.

in controller my_controller:
def crud_update():
from gluon.tools import Crud
crud = Crud(db)
crud.settings.controller = 'my_controller'
form = crud()
if form.accepted:
return 'Updated!'
return form



in view:
{{for thing in things:}}
{{=thing.name}} -
{{=A(
  'edit',
  _href=URL('crud_update', args=['update','things', thing.id]),
  cid='from_div'
)}}


Have I missed something, or is this some security feature or bu in Chrome?

Version 2.6.0-development+timestamp.2013.08.29.08.21.46

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] update_or_insert with Expressions

2013-08-30 Thread frasse
Hi 
I like to use  following update_or_insert example  with "db.myproperty.quantity 
 + 1" as you see in example

db.myproperty.update_or_insert(
(db.myproperty.userId == 1 ) & (db.myproperty.product == 'tree') , 
userId = 1,
price = 10, 
quantity =  db.myproperty.quantity  + 1 , product = 'tree', 
marketType = 'seller')


but I am geting following error 
TypeError(\"unsupported operand type(s) for *: 'float' and 'Expression'\",)


Can I use update_or_insert as I use update statement ?
Regards
/Frasse

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: update_or_insert with Expressions

2013-08-30 Thread Massimo Di Pierro
This is not supported. Please open a ticket. We can this feature

On Friday, 30 August 2013 07:11:29 UTC-5, frasse wrote:
>
> Hi 
> I like to use  following update_or_insert example  with 
> "db.myproperty.quantity 
>  + 1" as you see in example
>
> db.myproperty.update_or_insert(
> (db.myproperty.userId == 1 ) & (db.myproperty.product == 'tree') , 
> userId = 1,
> price = 10, 
> quantity =  db.myproperty.quantity  + 1 , product = 'tree', 
> marketType = 'seller')
>
>
> but I am geting following error 
> TypeError(\"unsupported operand type(s) for *: 'float' and 
> 'Expression'\",)
>
>
> Can I use update_or_insert as I use update statement ?
> Regards
> /Frasse
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: crud forms and layout

2013-08-30 Thread hiro
Long time since last post, but i had to do this and a small modification of 
mdipierros 
code worked for me

fields = form[0].components
n_fields = len(fields) 
bot_half = fields[n_fields/2:] 
top_half = fields[:n_fields/2] 
form[0]=TABLE(TR(
 TD(TABLE(*top_half)),TD(TABLE(*bot_half))
))

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Several controllers inserting and updating one row via forms

2013-08-30 Thread Vinicius Assef
Because SQLFORM uses this field to know you're editing not inserting a record.

On Fri, Aug 30, 2013 at 5:27 AM,   wrote:
> Thanks, I indeed missed that hidden field with record id. From the book:
> "Edit forms also contain a hidden INPUT field with name="id" which is used
> to identify the record. "
>
> Though I don't really understand why we need that field as record id is kept
> server-side anyway.
>
>
> On Thursday, August 29, 2013 4:32:52 PM UTC+3, viniciusban wrote:
>>
>> It would be nice if you show your view.
>>
>> Probably you're missing a hidden field in second form with the record id.
>>
>> On Thu, Aug 29, 2013 at 10:12 AM,   wrote:
>> > Hi!
>> >
>> > I have an issue with UPDATE form. I'm trying to implement something like
>> > enrollment form that has man field beyond standard name, email, etc. For
>> > the
>> > sake of usability I've decided to split it to two steps (i.e.
>> > controllers -
>> > pages): first asks user for name and email, and after user submits it,
>> > he/she gets redirected to the second controller with UPDATE form for the
>> > same record, inserted with previous form.
>> >
>> > Btw, at first I thought of having a one page form and presenting it in
>> > parts
>> > with help of JS, but I've decided to go with back end, to have even
>> > partially submitted data in database.
>> >
>> > def firstform():
>> > form = SQLFORM(db.person, fields = ['email','name'])
>> > if form.process(session=None, formname='begin_form').accepted:
>> > session.person_id = form.vars.id
>> > session.flash = 'form accepted'
>> > redirect(URL('endjoin'))
>> > elif form.errors:
>> > response.flash = 'form has errors'
>> > else:
>> > response.flash = 'please fill the form'
>> > return dict()
>> >
>> > # and
>> > def secondform():
>> > record = db.person(session.person_id) or redirect(URL('index'))
>> > form = SQLFORM(db.person, record, fields =
>> > ['address','phone','many_more_fields'])
>> > if form.process(session=None, formname='end_form').accepted:
>> > response.flash = 'form accepted'
>> > elif form.errors:
>> > response.flash = 'form has errors'
>> > else:
>> > response.flash = 'please fill the form'
>> > return dict()
>> >
>> > The problems is that second action 'firstform' makes insert, instead of
>> > update to the record inserted by first action 'secondform'. Though
>> > 'record'
>> > contains reference to last add row, which should be updated(completed).
>> > I'm
>> > not passing form to the view, I use custom html to present my forms,
>> > because
>> > I didn't find a way to make helpers specify input type='email',
>> > placeholder,
>> > size and other HTML5 form parts attributes.
>> >
>> > --
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "web2py-users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to web2py+un...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Several controllers inserting and updating one row via forms

2013-08-30 Thread Denis Sh
Hm, I thought that form = SQLFORM(db.person, record) , i.e. parameter
'record' indicates that, so why duplicate that in view?


On Fri, Aug 30, 2013 at 3:43 PM, Vinicius Assef wrote:

> Because SQLFORM uses this field to know you're editing not inserting a
> record.
>
> On Fri, Aug 30, 2013 at 5:27 AM,   wrote:
> > Thanks, I indeed missed that hidden field with record id. From the book:
> > "Edit forms also contain a hidden INPUT field with name="id" which is
> used
> > to identify the record. "
> >
> > Though I don't really understand why we need that field as record id is
> kept
> > server-side anyway.
> >
> >
> > On Thursday, August 29, 2013 4:32:52 PM UTC+3, viniciusban wrote:
> >>
> >> It would be nice if you show your view.
> >>
> >> Probably you're missing a hidden field in second form with the record
> id.
> >>
> >> On Thu, Aug 29, 2013 at 10:12 AM,   wrote:
> >> > Hi!
> >> >
> >> > I have an issue with UPDATE form. I'm trying to implement something
> like
> >> > enrollment form that has man field beyond standard name, email, etc.
> For
> >> > the
> >> > sake of usability I've decided to split it to two steps (i.e.
> >> > controllers -
> >> > pages): first asks user for name and email, and after user submits it,
> >> > he/she gets redirected to the second controller with UPDATE form for
> the
> >> > same record, inserted with previous form.
> >> >
> >> > Btw, at first I thought of having a one page form and presenting it in
> >> > parts
> >> > with help of JS, but I've decided to go with back end, to have even
> >> > partially submitted data in database.
> >> >
> >> > def firstform():
> >> > form = SQLFORM(db.person, fields = ['email','name'])
> >> > if form.process(session=None, formname='begin_form').accepted:
> >> > session.person_id = form.vars.id
> >> > session.flash = 'form accepted'
> >> > redirect(URL('endjoin'))
> >> > elif form.errors:
> >> > response.flash = 'form has errors'
> >> > else:
> >> > response.flash = 'please fill the form'
> >> > return dict()
> >> >
> >> > # and
> >> > def secondform():
> >> > record = db.person(session.person_id) or redirect(URL('index'))
> >> > form = SQLFORM(db.person, record, fields =
> >> > ['address','phone','many_more_fields'])
> >> > if form.process(session=None, formname='end_form').accepted:
> >> > response.flash = 'form accepted'
> >> > elif form.errors:
> >> > response.flash = 'form has errors'
> >> > else:
> >> > response.flash = 'please fill the form'
> >> > return dict()
> >> >
> >> > The problems is that second action 'firstform' makes insert, instead
> of
> >> > update to the record inserted by first action 'secondform'. Though
> >> > 'record'
> >> > contains reference to last add row, which should be
> updated(completed).
> >> > I'm
> >> > not passing form to the view, I use custom html to present my forms,
> >> > because
> >> > I didn't find a way to make helpers specify input type='email',
> >> > placeholder,
> >> > size and other HTML5 form parts attributes.
> >> >
> >> > --
> >> >
> >> > ---
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "web2py-users" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to web2py+un...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to web2py+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/ns0C3Upvd_c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Several controllers inserting and updating one row via forms

2013-08-30 Thread Vinicius Assef
Because if the hidden id field is in your request.post_vars, the
record's new data was submitted.

On Fri, Aug 30, 2013 at 10:43 AM, Denis Sh  wrote:
> Hm, I thought that form = SQLFORM(db.person, record) , i.e. parameter
> 'record' indicates that, so why duplicate that in view?
>
>
> On Fri, Aug 30, 2013 at 3:43 PM, Vinicius Assef 
> wrote:
>>
>> Because SQLFORM uses this field to know you're editing not inserting a
>> record.
>>
>> On Fri, Aug 30, 2013 at 5:27 AM,   wrote:
>> > Thanks, I indeed missed that hidden field with record id. From the book:
>> > "Edit forms also contain a hidden INPUT field with name="id" which is
>> > used
>> > to identify the record. "
>> >
>> > Though I don't really understand why we need that field as record id is
>> > kept
>> > server-side anyway.
>> >
>> >
>> > On Thursday, August 29, 2013 4:32:52 PM UTC+3, viniciusban wrote:
>> >>
>> >> It would be nice if you show your view.
>> >>
>> >> Probably you're missing a hidden field in second form with the record
>> >> id.
>> >>
>> >> On Thu, Aug 29, 2013 at 10:12 AM,   wrote:
>> >> > Hi!
>> >> >
>> >> > I have an issue with UPDATE form. I'm trying to implement something
>> >> > like
>> >> > enrollment form that has man field beyond standard name, email, etc.
>> >> > For
>> >> > the
>> >> > sake of usability I've decided to split it to two steps (i.e.
>> >> > controllers -
>> >> > pages): first asks user for name and email, and after user submits
>> >> > it,
>> >> > he/she gets redirected to the second controller with UPDATE form for
>> >> > the
>> >> > same record, inserted with previous form.
>> >> >
>> >> > Btw, at first I thought of having a one page form and presenting it
>> >> > in
>> >> > parts
>> >> > with help of JS, but I've decided to go with back end, to have even
>> >> > partially submitted data in database.
>> >> >
>> >> > def firstform():
>> >> > form = SQLFORM(db.person, fields = ['email','name'])
>> >> > if form.process(session=None, formname='begin_form').accepted:
>> >> > session.person_id = form.vars.id
>> >> > session.flash = 'form accepted'
>> >> > redirect(URL('endjoin'))
>> >> > elif form.errors:
>> >> > response.flash = 'form has errors'
>> >> > else:
>> >> > response.flash = 'please fill the form'
>> >> > return dict()
>> >> >
>> >> > # and
>> >> > def secondform():
>> >> > record = db.person(session.person_id) or redirect(URL('index'))
>> >> > form = SQLFORM(db.person, record, fields =
>> >> > ['address','phone','many_more_fields'])
>> >> > if form.process(session=None, formname='end_form').accepted:
>> >> > response.flash = 'form accepted'
>> >> > elif form.errors:
>> >> > response.flash = 'form has errors'
>> >> > else:
>> >> > response.flash = 'please fill the form'
>> >> > return dict()
>> >> >
>> >> > The problems is that second action 'firstform' makes insert, instead
>> >> > of
>> >> > update to the record inserted by first action 'secondform'. Though
>> >> > 'record'
>> >> > contains reference to last add row, which should be
>> >> > updated(completed).
>> >> > I'm
>> >> > not passing form to the view, I use custom html to present my forms,
>> >> > because
>> >> > I didn't find a way to make helpers specify input type='email',
>> >> > placeholder,
>> >> > size and other HTML5 form parts attributes.
>> >> >
>> >> > --
>> >> >
>> >> > ---
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "web2py-users" group.
>> >> > To unsubscribe from this group and stop receiving emails from it,
>> >> > send
>> >> > an
>> >> > email to web2py+un...@googlegroups.com.
>> >> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> > --
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "web2py-users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to web2py+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/ns0C3Upvd_c/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails

[web2py] Janrain/RPX widget migration

2013-08-30 Thread molhokwai
Hi,

The janrain/rpx widget is no longer supported since July (
http://developers.janrain.com/documentation/widgets/legacy-sign-in-widget/) 
and I am wondering if there are plans to upgrade the integrated rpx login 
method accordingly... (
http://developers.janrain.com/documentation/widgets/legacy-sign-in-widget/social-sign-in-migration-guide/
)...

Thanks.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Load every 5 seconds

2013-08-30 Thread Javier Pepe
Hi

I need load SQLFOM.grid every 5 seconds, try whith autorefresh, but load
all page.

I need help to create javascript to load only a SQLFROM.grid.

Thanks

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Load every 5 seconds

2013-08-30 Thread Paolo Valleri
Have a look at 
http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components
Paolo
On Friday, August 30, 2013 7:50:10 PM UTC+2, Javier Pepe wrote:
>
> Hi
>
> I need load SQLFOM.grid every 5 seconds, try whith autorefresh, but load 
> all page.
>
> I need help to create javascript to load only a SQLFROM.grid.
>
> Thanks
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Document for Fedora Deployment

2013-08-30 Thread dhmorgan
please also post on web2pyslices.com

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Adding files casually

2013-08-30 Thread wiel

I tried to add a bulk of .js files to my static folder without using the 
admin interface. the files  are not showing up in the admin interface and a 
couple of these files are giving a 404 not found error. how can I remedy 
this?

here is a sample of the view file. I placed the .js files in a sub folder












-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Load every 5 seconds

2013-08-30 Thread Javier Pepe
Thanks

works better than expected


On Fri, Aug 30, 2013 at 2:53 PM, Paolo Valleri wrote:

> Have a look at
> http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components
> Paolo
>
> On Friday, August 30, 2013 7:50:10 PM UTC+2, Javier Pepe wrote:
>>
>> Hi
>>
>> I need load SQLFOM.grid every 5 seconds, try whith autorefresh, but load
>> all page.
>>
>> I need help to create javascript to load only a SQLFROM.grid.
>>
>> Thanks
>>
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Adding files casually

2013-08-30 Thread Paolo Caruccio
from the book http://web2py.com/book/default/chapter/04#URL

For the reasons mentioned above, you should always use the URL function to 
generate URLs of static files for your applications. Static files are 
stored in the application's static subfolder (that's where they go when 
uploaded using the administrative interface). web2py provides a virtual 
'static' controller whose job is to retrieve files from the static subfolder, 
determine their content-type, and stream the file to the client. The 
following example generates the URL for the static file "image.png":

URL('static', 'image.png')

is mapped into

/[application]/static/image.png

If the static file is in a subfolder within the static folder, you can 
include the subfolder(s) as part of the filename. For example, to generate:

/[application]/static/images/icons/arrow.png

one should use:

URL('static', 'images/icons/arrow.png')


Il giorno venerdì 30 agosto 2013 21:29:28 UTC+2, wiel ha scritto:
>
>
> I tried to add a bulk of .js files to my static folder without using the 
> admin interface. the files  are not showing up in the admin interface and a 
> couple of these files are giving a 404 not found error. how can I remedy 
> this?
>
> here is a sample of the view file. I placed the .js files in a sub folder
>
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.iframe-transport.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-fp.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-ui.js')}}"
> >
> 
> 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Reddit development using web2py

2013-08-30 Thread naman9t3
I want to develop replica of Reddit Website 
http://www.reddit.com/
using web2py framework.
Can anyone please provide me with its source code so that i can study the 
web2py code and understand, it will help me understand the concepts well
Thanks in advance

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Navbar auth

2013-08-30 Thread Federico Ferraro
How to disable auth.navbar for some funtions ?

- I need to create a different layout.
Tried to create a function in the model:

navbar_disable = False
onavbar = auth.navbar
def nav_bar(**kargs):
  if navbar_disable:
 return False
  else:
 return onavbar(**kargs)

   auth.navbar =  nav_bar

In the controler :

navbar_disable = True


But it did not work ...


-- 
--
Federico Ferraro
Usuario Linux : 482533.
--

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] scheduler - Get task id for current task

2013-08-30 Thread Manoj Kumar M
Is it possible to get the task id of the current task from within the task?

for example:
def task_add(a,b):
task_id = scheduler.my_id() # get current task id
return a+b

scheduler = Scheduler(db, tasks=dict(demo1=task_add))

scheduler.queue_task('demo1', pvars=dict(a=1,b=2),
 repeats = 0, period = 180)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Logged in dropdown links

2013-08-30 Thread Johan Englund
Yes, write your own navbar function and use that instead, or take a look at 
& modify navbar() in gluon/tools.py (You will need source code for that)
Also I did a rewrite of navbar in the repo, should make it much easier to 
write your own navbar imo.

On Wednesday, August 28, 2013 8:19:28 PM UTC+2, dirman wrote:
>
> is it posible to add another link to the logged in dropdown in adding to 
> the profile,password and logout links?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Why is the plugins list empty in the wizard?

2013-08-30 Thread Alan Etkin

>
> Can you show me an example?
>

Not a working one :/. First we would need to enable the json package list 
controller at web2pyslices. I thought I had implemented it but currently it 
doesn't seem to work (returns null where it should return a json list of 
packages).

Actually, I don't know what code is necessary to fix the plugin automation, 
I'm just saying we could use web2pyslices as plugin database. If that's ok, 
then I can work in an admin patch


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] web2py newbie question

2013-08-30 Thread Mirko
Hi all,
I am really new to web2py and I find this python framework really exciting.

I am currently reading the whole online book chapter database validators, 
and while I was reading at the example given, I was wondering if there is a 
difference between this :

db.define_table('person', Field('name', unique=True))
db.define_table('dog', Field('name'), Field('owner', db.person))
db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s')

and this :

db.define_table('person', Field('name', unique=True), format='%(name)s')
db.define_table('dog', Field('name'), Field('owner', type='reference 
person', required=True))

Thanks a lot,

Mirko

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Webhosts for Web2py

2013-08-30 Thread samuel bonill
I use *Amazon EC2* and 
*rackspace*


El martes, 27 de agosto de 2013 16:11:22 UTC-5, Vivek Jha escribió:
>
> I am new in web development and I have started with web2py and have almost 
> copleted reading the web2py book.
>
> Now few practical issues are coming up about which I don't have any 
> experience and that is chosing the right economical webhost.
>
> I think following suits my pocket:
> 1. Bluehost
> 2. Hostgator (mainly becuase they have presence in India as well)
> 3. Justhost.
>
> Do any of guys have any experience with these web hosts. As most of the 
> webhosts are still not able to see the world beyond PHP and wordpress they 
> have not mentioned python support specifically though they may be 
> supporting Python based applications internally.
>
> Questions:
> 1. Do the above webhosts will be able to support Web2Py with FastCGI.
> 2. Is having shell access a must for running web2py.
> 3. Will it be possible to run Web2Py on the main domain and Wordpress on 
> subdomain or vice versa with them.
> 4. Whom to ask about WSGI setup? Is this a webshost specific question or 
> Web2Py specific.
>
> If you think I have not asked the right questions, then please assume me 
> as a beginner in the hosting world and let me if there are any catches 
> about which I should be careful of.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Janrain/RPX widget migration

2013-08-30 Thread Massimo Di Pierro
Please open a ticket. We will do that asap.

On Friday, 30 August 2013 12:54:06 UTC-5, molhokwai wrote:
>
> Hi,
>
> The janrain/rpx widget is no longer supported since July (
> http://developers.janrain.com/documentation/widgets/legacy-sign-in-widget/) 
> and I am wondering if there are plans to upgrade the integrated rpx login 
> method accordingly... (
> http://developers.janrain.com/documentation/widgets/legacy-sign-in-widget/social-sign-in-migration-guide/
> )...
>
> Thanks.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py newbie question

2013-08-30 Thread Massimo Di Pierro
No it is the same.

This 

Field('owner', 'reference person')

is the same as 

Field('owner', db.person)

If the reference field has a format='...' than you get the default 
validator:

db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s')




On Friday, 30 August 2013 02:51:41 UTC-5, Mirko wrote:
>
> Hi all,
> I am really new to web2py and I find this python framework really exciting.
>
> I am currently reading the whole online book chapter database validators, 
> and while I was reading at the example given, I was wondering if there is a 
> difference between this :
>
> db.define_table('person', Field('name', unique=True))
> db.define_table('dog', Field('name'), Field('owner', db.person))
> db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s')
>
> and this :
>
> db.define_table('person', Field('name', unique=True), format='%(name)s')
> db.define_table('dog', Field('name'), Field('owner', type='reference 
> person', required=True))
>
> Thanks a lot,
>
> Mirko
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py newbie question

2013-08-30 Thread Anthony
There are two distinctions here. First:

Field('owner', db.person)

is equivalent to:

Field('owner', 'reference person')

However, the latter is generally preferred because if you are using lazy 
table definitions, the former method triggers the full definition of 
db.person, so you lose the benefit of the lazy definition.

Second:

db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s')

is equivalent to:

Field('owner', 'reference person', requires=IS_IN_DB(db, 'person.id', 
'%(name)s'))

Again, though, the latter is preferable in the case of lazy tables because 
the former will trigger the full db.dog table definition. Of course, as 
Massimo pointed out, neither of the above are really necessary if you 
specify the "format" argument in the db.person table definition, as that 
will result in a default validator equivalent to the above.

Anthony

On Friday, August 30, 2013 12:51:41 AM UTC-7, Mirko wrote:
>
> Hi all,
> I am really new to web2py and I find this python framework really exciting.
>
> I am currently reading the whole online book chapter database validators, 
> and while I was reading at the example given, I was wondering if there is a 
> difference between this :
>
> db.define_table('person', Field('name', unique=True))
> db.define_table('dog', Field('name'), Field('owner', db.person))
> db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s')
>
> and this :
>
> db.define_table('person', Field('name', unique=True), format='%(name)s')
> db.define_table('dog', Field('name'), Field('owner', type='reference 
> person', required=True))
>
> Thanks a lot,
>
> Mirko
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Reddit development using web2py

2013-08-30 Thread Martin Barnard
Reddit does not run on web2py. It runs on python and (I think pylons?). 
However, if you do wish to peruse the reddit's source code, you could try 
their github repo:

https://github.com/reddit



On Thursday, August 29, 2013 6:18:30 PM UTC+3, nama...@gmail.com wrote:
>
> I want to develop replica of Reddit Website 
> http://www.reddit.com/
> using web2py framework.
> Can anyone please provide me with its source code so that i can study the 
> web2py code and understand, it will help me understand the concepts well
> Thanks in advance
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Adding files casually

2013-08-30 Thread wiel
this was a permission problem. the sub folder was owned by root and not by 
the user that i created for web2py

On Friday, August 30, 2013 2:29:28 PM UTC-5, wiel wrote:
>
>
> I tried to add a bulk of .js files to my static folder without using the 
> admin interface. the files  are not showing up in the admin interface and a 
> couple of these files are giving a 404 not found error. how can I remedy 
> this?
>
> here is a sample of the view file. I placed the .js files in a sub folder
>
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.iframe-transport.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-fp.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-ui.js')}}"
> >
> 
> 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Reddit development using web2py

2013-08-30 Thread webpypy
Try this 

https://groups.google.com/forum/#!searchin/web2py/reddit%7Csort:date/web2py/0YlcTFegHCU/6_4LjWt0jYAJ




On Thursday, August 29, 2013 6:18:30 PM UTC+3, nama...@gmail.com wrote:
>
> I want to develop replica of Reddit Website 
> http://www.reddit.com/
> using web2py framework.
> Can anyone please provide me with its source code so that i can study the 
> web2py code and understand, it will help me understand the concepts well
> Thanks in advance
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Reddit development using web2py

2013-08-30 Thread Anthony
Also, https://github.com/mdipierro/web2py-appliances/tree/master/RedditClone
 and 
https://github.com/mdipierro/web2py-recipes-source/tree/master/source/02_building_your_first_applications/03_building_a_reddit_clone
.

Anthony

On Friday, August 30, 2013 8:57:26 PM UTC-7, webpypy wrote:
>
> Try this 
>
>
> https://groups.google.com/forum/#!searchin/web2py/reddit%7Csort:date/web2py/0YlcTFegHCU/6_4LjWt0jYAJ
>
>
>
>
> On Thursday, August 29, 2013 6:18:30 PM UTC+3, nama...@gmail.com wrote:
>>
>> I want to develop replica of Reddit Website 
>> http://www.reddit.com/
>> using web2py framework.
>> Can anyone please provide me with its source code so that i can study the 
>> web2py code and understand, it will help me understand the concepts well
>> Thanks in advance
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Reddit development using web2py

2013-08-30 Thread Anthony
Note, if you're thinking reddit.com was built with web2py, it was not -- 
the original reddit.com was built with Common Lisp and then migrated to 
Python, for which the web.py  framework was developed 
and eventually open sourced (web.py and web2py are often confused).

Anthony

On Thursday, August 29, 2013 8:18:30 AM UTC-7, nama...@gmail.com wrote:
>
> I want to develop replica of Reddit Website 
> http://www.reddit.com/
> using web2py framework.
> Can anyone please provide me with its source code so that i can study the 
> web2py code and understand, it will help me understand the concepts well
> Thanks in advance
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Reddit development using web2py

2013-08-30 Thread webpypy




 (web.py and web2py are often confused).
>
> Anthony
>
>
>>
example of confusion:

clicking on web2py   in https://www.openshift.com/developers/python

will go to web.py

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.