[web2py] forms

2015-07-19 Thread Ramchandra Sharma
I am trying something with form in which on selecting some thing in select 
tag i should get some data from database based on select tag value.So on 
select tag i used ajax call but the ajax response text is difficult to 
parse is there any other way?
Thanks in advance :)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] forms and lists

2011-03-26 Thread niknok
I'm trying to go through two lists using a form but I could make the
form move "forward" and "backward" through the list.

The tables are essentially the same except for the language used.

Could someone give me a nudge to the right direction? :)
Here's my code:

db.define_table('questionnaire',
Field('dialog_id', 'integer', unique=True),
Field('dialog', 'string'),
Field('choices', 'list:string'),
Field('category_2', 'boolean', default=False),
Field('key', 'string'),
Field('active', 'boolean', default=False))

db.define_table('questionnaire_l2',
Field('dialog_id', 'integer', unique=True),
Field('dialog', 'string'),
Field('choices', 'list:string'),
Field('key', 'string'))

def quiz_master():
query = db(db.questionnaire.id>0).select(orderby='')
query_t = db(db.questionnaire_l2.id>0).select()

for i in range(0, len(query)):
print i
quiz(query[i], query_t[i-1]['dialog'], query_t[i-1]['choices'])
return

def quiz(query,translation,choices):
item_id =int(request.args(0) or 0)

form = SQLFORM.factory(
Field('national', 'text', writable=False, default=query),
Field('locale', 'text', writable=False, default=translation),
Field('answer', 'list:string', requires=IS_IN_SET(choices,
zero=None)))

if form.accepts(request.vars,session):
redirect(r=request,args=(form.vars.id,page+1))
return dict(form=form)


[web2py] forms and validators

2011-11-18 Thread Jimmy Stewpot
Hello,

I am trying to figure out a way which I can have a select (drop down menu) 
form, where based on the option that is selected the rest of the form 
validators change. To try and explain it better here's the "example" I am 
trying to work on.

I am working on a web2py powerdns front end (to learn web2py).. In the type 
form field I have

TR("Type:", SELECT('A', 'CNAME', '', 'MX', 'NS', 'TXT', _name='type', 
value='yes', requires=IS_IN_SET(['A', 'CNAME', '', 'MX', 'NS', 'TXT']))),

If the user selects A from the drop down menu I would like to have 
requires=IS_IPV4() for the record type validator.

Is it possible to do that?

Thanks

Jimmy.





[web2py] CUSTOMIZING WEB2PY FORMS

2018-09-07 Thread elisha bere
Hie guys,

how do i customize the buttons on the forms if i add =form to my web page?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Forms - MVC model

2012-06-27 Thread Pedro Casalinho
This may be a dumb question but, should forms be created in controllers and 
passed to the view or should they be created in the view, taking into 
consideration the MVC model

-- 





[web2py] Forms and their customisation

2010-11-29 Thread Emceha
Here is my controller code:

def dodaj_artykul():
form=crud.create(db.artykuly,next='pokaz_artykul/[id]')
return dict(form=form)

I see that textarea always has cols=40 and rows=10 - I wanted to
change that value but I haven't found any straight forward example to
do it using CRUD only?

Should I use SQLFORM?

Thanks


[web2py] Forms with hidden fields

2010-09-17 Thread Fabio Alessandro Locati
Hi,
I'm trying to make a form with a hidden field, but I haven't found the way
to do it :(.

I have a table:
db.define_table('partners',
Field('name','string'),
Field('out','boolean'))

I want to ask to the user the name of the partner and, based on the name of
the page, the value of 'out'. I was thinking into making two different pages
one that has - at code level - out=1 and the other one that had out=0. How
can I do this, without showing to the user the existence of the 'out' field?

Thanks :)


[web2py] Forms with horizontal fields

2012-05-25 Thread orsomannaro

I'm starting with Web2Py.

I have a model with a large number of fields and I need to display them 
all together in the view.


To arrange/group them logically I need to display them in a horizontal way.

In some cases I need to hide some of these fields, depending on users 
rights.



How can I do this?


Is there a way to create different custom div-based forms layout for a 
single model and let the controller to decide which one to use in the views?



Thank you


[web2py] Forms in multiple windows

2012-06-04 Thread Jim Karsten
Could we get a discussion going about web2py handling forms in multiple 
windows? A form may not submit as expected if a second window or tab is 
opened with the same form. Here are steps to reproduce the issue.

1. Create a page with a form. The form can be created by Crud or SQLFORM.
2. Open the page in a window. Open the page in a second window.
3. Submit the form in the second window. This works fine.
4. Go back to the first window. Submit the form. The input is not saved.

I produced a ticket for this problem (Issue 825 
http://code.google.com/p/web2py/issues/detail?id=825) with a suggestion for 
a solution based on the discussion in this thread: 
https://groups.google.com/d/topic/web2py/X-GGxuvea-g/discussion

Massimo pointed out a flaw in my solution in that it would create an
ever-growing number of session variables and would be vulnerable to a DoS
attack.

While maybe not a common problem, opening a page in a second window does 
not seem to be something all that unusual. Should web2py forms be expected 
to handle this? 


[web2py] forms and bootstrap modals

2014-05-25 Thread weheh
Bootstrap modals have header, body and footer sections. I haven't figured 
this out, yet, but is there a way to get formstyle='bootstrap' to send the 
submit button to the footer, the form contents to the body and maybe a 
title to the header sections? Obviously, this can be done with custom 
forms, but it seems like the bootstrap form is already pretty good, just 
needs the above tweak to make it perfect for my app.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Web2py Forms and Javascript

2014-07-18 Thread Jesse Ferguson
This is kind of two questions but I would like to build a app to handle 
Invoicing, We have some "satellite" offices in other towns and it would be nice 
to get rid of our hand written paper forms and faxing(FORM 
https://drive.google.com/file/d/0BydRLdL9cc4mNzhjR1U3MHVPVjA/edit?usp=sharing 
). I would like to know whats the best practice for building the data model on 
large forms? Should the form be all one table? There's about 35 items, which 20 
or so would just be integers (amounts of item).. below I have an example of 
what I'm thinking of going with. Finally I would like to implement a 
auto-filling form, for example if the user types in a location that has already 
been put in once before it will automatically fill in the mileage and person to 
attn to, would this be best handled with a javascript framework? If so could 
you push me towards one to learn? (my javascript is weak but I'm working on it 
:))

Thanks in advance!
Jesse Ferguson

EXAMPLE MODEL

db.define_table('invoice',
Field('price_list', 'integer'),
Field('account_code','string'),
Field('company', 'string'),
Field('attn', 'string'),
Field('customer_order_number', 'string'),
Field('ccc_so_num', 'string'),
Field('date_of_work', 'date'),
Field('wo_location', 'string'),
Field('lease', 'string'),
Field('details', 'list:reference'),
)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Forms suddenly not working!

2017-01-31 Thread Andrew Buchan
Hi, I just updated an application hosted on pythonanywhere, and the forms
are no longer working.

Even the login form (default, unaltered), doesn't seem to work. When I hit
submit the page simply reloads, with no error messages. Same goes for all
my very simple forms.

- There are no errors in the logs.
- The same app running locally against an sqlite database works fine.
- I'm thinking it may be a database issue, but I can write to the db fine
from the admin app.
- The appconfig.ini does point to the correct database, as it reads data
fine to display in the view
- The flash messages div is there and works, but the code never gets to
that when submitting a form.

Running 2.12.1

Any ideas on what it could be?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Forms with readonly fields

2017-03-31 Thread Joe Barnhart


I'm going a little nuts with forms that have readonly fields.  Examples are 
forms where some fields are shown to the user so they can see the contents, 
but they aren't allowed to change them.  For example, an "expiration date" 
for a subscription.  They can see when it expires, but they can't just edit 
it.  They have to go thru an ordering process for that.

The Field flag of writable=False has not proved useful.  It changes the 
field to a simple piece of text and thus breaks any custom formstyle I'm 
using.  The simple text without an input field looks ugly and doesn't match 
spacing, fonts, or any of the other myriad styles used in the read/write 
fields.  Sad to say, writable=False just is not useful.

I have created an alternative that creates the fields as usual, but marks 
them with a "readonly" attribute.  Javascript can then be used to ensure 
the contents are not modified, even for tricky fields like date selectors 
and list box widgets.  But now we get to the underlying problem -- the form 
validator fails when I take this approach.

Because the readonly fields are readonly, they do not show up in the 
request.vars when the form is submitted.  But since the SQLFORM knows 
nothing of this, it just sees null values for the fields and throws a 
validation error for elements like list boxes (which can't be empty).

It's almost like I want to change the SQLFORM definition after the form is 
created (with the readonly list boxes) and then remove those fields from 
the SQLFORM when it does its validate processing, so it would just ignore 
the missing fields and not try to update the record with empty values.

Here's an example.  You can see the cursor which tells the user the field 
is not editable.  On this view the expire date, the season, the age, and 
the US Swim ID are all non-editable fields.  But the season is an example 
of an option list which causes the form processing to throw an error and 
fail.

Just looking for some ideas.

Joe



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] CUSTOMIZING WEB2PY FORMS

2018-09-07 Thread Javier Pepe
In docs you have example.

http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms

El vie., 7 de sep. de 2018 a la(s) 07:02, elisha bere (elishabe...@gmail.com)
escribió:

> Hie guys,
>
> how do i customize the buttons on the forms if i add =form to my web page?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] CUSTOMIZING WEB2PY FORMS

2018-09-24 Thread elisha bere
i am not understanding it

On Fri, 7 Sep 2018 at 20:07, Javier Pepe  wrote:

> In docs you have example.
>
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms
>
> El vie., 7 de sep. de 2018 a la(s) 07:02, elisha bere (
> elishabe...@gmail.com) escribió:
>
>> Hie guys,
>>
>> how do i customize the buttons on the forms if i add =form to my web page?
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> 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/d/optout.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Forms - MVC model

2012-06-27 Thread Alec Taylor
Create them in the controller, call them from the template (view).

Example:

# controllers\default.py
def index():
return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL)))

# views\default\index.html
{{if 'authed_users' in globals():}}
{{=T('Registered users:')}}
{{=authed_users}}
{{else:}}
{{=BEAUTIFY(response._vars)}}
{{pass}}

On Wed, Jun 27, 2012 at 9:08 PM, Pedro Casalinho
 wrote:
> This may be a dumb question but, should forms be created in controllers and
> passed to the view or should they be created in the view, taking into
> consideration the MVC model
>
> --
>
>
>

-- 





Re: [web2py] Forms - MVC model

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote:
> This may be a dumb question but, should forms be created in controllers and 
> passed to the view or should they be created in the view, taking into 
> consideration the MVC model
> 
> 

MVC is a pretty leaky abstraction, especially in the context of web2py, where 
you start creating the view in your model (with explicit or implicit control 
over the representation of fields). 

At any rate, create your forms in the controller, because you need to deal with 
their submission there.

-- 





Re: [web2py] Forms - MVC model

2012-06-27 Thread Anthony

>
> # controllers\default.py 
> def index(): 
> return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL))) 
>
> # views\default\index.html 
> {{if 'authed_users' in globals():}} 
> {{=T('Registered users:')}} 
> {{=authed_users}} 
>

This example does not show a form -- it shows a table with the results of a 
select.

Anthony 

-- 





Re: [web2py] Forms - MVC model

2012-06-27 Thread Jason Brower

On 06/27/2012 07:30 PM, Jonathan Lundell wrote:

On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote:
This may be a dumb question but, should forms be created in 
controllers and passed to the view or should they be created in the 
view, taking into consideration the MVC model





MVC is a pretty leaky abstraction, especially in the context of 
web2py, where you start creating the view in your model (with explicit 
or implicit control over the representation of fields).


At any rate, create your forms in the controller, because you need to 
deal with their submission there.

--



OK, hate to nag about it, but your declaring a type of field in the 
model.  Sometimes you have to make your own type of field. If you create 
your field types correctly in the model, then web2py knows what to do 
when creating the view. :) That's one thing about Web2py I go giddy over. :)

BR,
Jason

--





Re: [web2py] Forms and their customisation

2010-11-29 Thread Daniel Gonzalez
Hi, 

Checkout the chapter 7 of the book, specially this part:
http://web2py.com/book/default/chapter/07#Custom-forms

Regards
Daniel

El lun, 29-11-2010 a las 02:11 -0800, Emceha escribió:
> Here is my controller code:
> 
> def dodaj_artykul():
> form=crud.create(db.artykuly,next='pokaz_artykul/[id]')
> return dict(form=form)
> 
> I see that textarea always has cols=40 and rows=10 - I wanted to
> change that value but I haven't found any straight forward example to
> do it using CRUD only?
> 
> Should I use SQLFORM?
> 
> Thanks




[web2py] Forms, radio boxes, options, etc.

2010-12-04 Thread VP
I'd like to use FORM(...) to create forms with radio boxes, drop-down
options, etc.  But I can't find any document on how to do this.

For example, if I'd like a drop-down option for 'red', 'green',
'blue', how do I do this using FORM?

Thanks.


Re: [web2py] Web2py Forms and Javascript

2014-07-18 Thread Richard Vézina
For the prefilled data you have this :
db.invoice.fieldname.default = your previous predefined form data

For your model, I think it is much more complex then that... For instance,
what's happen when there is new Items? You add new column to your model
each time? (bad idea). Also storing company in the invoice table is a bad
idea (denormalized) because you will have to input each time company name
and address in you company field. For this you may consider to add a
company table and change your company string field like that :

 Field('company', 'reference company'),

You will have to populate company table first with another form then select
the new inserted company after in your invoice form.

The same goes for the items they should go in an item/product table and you
should have a items_id field that could be of time list:reference where you
select the item, though you will not be able to precise the quantity that
way.

There is tonnes of schema design for invoice app :

Here some UML :

https://www.google.ca/search?q=invoice+database+schema&espv=2&tbm=isch&imgil=j-vKuBZKWTALKM%253A%253Bhttps%253A%252F%252Fencrypted-tbn2.gstatic.com%252Fimages%253Fq%253Dtbn%253AANd9GcRrkWvL-9FvYRH5sr5lgH6QWiut3gK4MfVzMP26BcvCI2rV7x-u%253B503%253B285%253B2YNCt_eklOX5dM%253Bhttps%25253A%25252F%25252Fpeople.ok.ubc.ca%25252Frlawrenc%25252Fteaching%25252F304%25252FNotes%25252F&source=iu&usg=__q2COFwdJchOn1mZeO6vYLLlpjHk%3D&sa=X&ei=wnXJU-T3D8SUyASKs4CgBQ&ved=0CB4Q9QEwAA&biw=1920&bih=995#facrc=_&imgrc=j-vKuBZKWTALKM%253A%3B2YNCt_eklOX5dM%3Bhttps%253A%252F%252Fpeople.ok.ubc.ca%252Frlawrenc%252Fteaching%252F304%252FNotes%252FER%252FInvoice.png%3Bhttps%253A%252F%252Fpeople.ok.ubc.ca%252Frlawrenc%252Fteaching%252F304%252FNotes%252F%3B503%3B285


Richard




On Fri, Jul 18, 2014 at 2:57 PM, Jesse Ferguson  wrote:

> This is kind of two questions but I would like to build a app to handle
> Invoicing, We have some "satellite" offices in other towns and it would be
> nice to get rid of our hand written paper forms and faxing(FORM
> https://drive.google.com/file/d/0BydRLdL9cc4mNzhjR1U3MHVPVjA/edit?usp=sharing
> ). I would like to know whats the best practice for building the data model
> on large forms? Should the form be all one table? There's about 35 items,
> which 20 or so would just be integers (amounts of item).. below I have an
> example of what I'm thinking of going with. Finally I would like to
> implement a auto-filling form, for example if the user types in a location
> that has already been put in once before it will automatically fill in the
> mileage and person to attn to, would this be best handled with a javascript
> framework? If so could you push me towards one to learn? (my javascript is
> weak but I'm working on it :))
>
> Thanks in advance!
> Jesse Ferguson
>
> EXAMPLE MODEL
>
> db.define_table('invoice',
> Field('price_list', 'integer'),
> Field('account_code','string'),
> Field('company', 'string'),
> Field('attn', 'string'),
> Field('customer_order_number', 'string'),
> Field('ccc_so_num', 'string'),
> Field('date_of_work', 'date'),
> Field('wo_location', 'string'),
> Field('lease', 'string'),
> Field('details', 'list:reference'),
> )
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-07-18 Thread 黄祥
for autofiling please check it on the book about dal default or ajax 
autocompletion
ref:
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Auto-completion
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer

as richard said : please have normalization on your table.
e.g.
# create table : invoice_header
db.define_table('invoice_header', 
Field('invoice_no'), 
Field('invoice_date', 'date'), 
Field('customer', 'reference customer'), 
Field('grand_total', 'integer'), 
auth.signature )

# create table : invoice_detail
db.define_table('invoice_detail', 
Field('invoice_no', 'reference invoice_header'), 
Field('product', 'reference product'), 
Field('quantity', 'integer'), 
Field('price', 'integer'), 
Field('total_price', 'integer'), 
Field('grand_total', 'integer'), 
auth.signature )

for company info, i usually have a query from created_on field, that refer 
to auth_user table and show it when print the invoice, you can also learn 
from web2py appliances, estore and pos online store.

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-07-18 Thread Jesse Ferguson
 I think this would work better however I am not sure about the items.. is 
the item_entry table how its normally done? Examples online vary... 
A completed Service order would have multiple Item_entry references... Just 
doesn't seem like the right way to do it.. 


db.define_table('company',
>
> Field('name', 'string'))
>
>
>> db.define_table('lease',
>
> Field('name', 'string'),
>
> Field('attn', 'string'),
>
> Field('location', 'string'))
>
>
>> db.define_table('account_code',
>
> Field('code','string'))
>
>
>> db.define_table('item',
>
> Field('name', 'string'),
>
> Field('pl_no', 'integer'),
>
> Field('cost', 'double'))
>
>
>> db.define_table('item_entry',
>
> Field('item', 'reference item'),
>
> Field('amount', 'double'))
>
>
>> db.define_table('service_order',
>
> Field('so_date', 'date'),
>
> Field('so_num', 'integer'),
>
> Field('so_hours', 'double'),
>
> Field('total_cost', 'double'),
>
> Field('notes', 'text'),
>
> Field('company', 'reference company'),
>
> Field('lease', 'reference lease'),
>
> Field('acct_code', 'reference account_code'),
>
> Field('items', 'list:reference item_entry')
>
> )
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-04 Thread Richard Vézina
Why item and item_entry, I don't understand the utility of item_entry and
where's the invoice table (service-order is invoice?)?

To me the cost and amount field of item and item_entry are going in the
service_order table since they deserve the purpose of indicating the price
paid for this item in the particular invoice record context. Why storing
the total_cost you can compute it as need (it is a matter of choice). I
would not use list-reference field type for items since you can't be
specific.

Here section invoice is the proper way to do it :

http://www.jbilling.com/documentation/developers/database-model

I think I understand you item_entry table in the example above your table
is called "invoice_line". Each items of you invoice (or service order) is
represented by a record in that table. Each records reference the invoice
(or service_order) id.

Now if you use this schema, we can help you create the complex form you
need with web2py to achieve this. If you don't use client side framework
like AngularJS, you will maybe have more then one form in a single page,
but it works just fine and in AngularJS you will have many form anyway. One
form for the invoice and an component form for invoice-line, I can provide
the piece of code you will need to be able to add as many items (form) you
need. It is easy you just have to iterate over the invoice_line of an
invoice and create a form for each, then with Javascript you enable or
desable the update form of a give form.

Hope it helps

Richard






On Fri, Jul 18, 2014 at 8:14 PM, Jesse Ferguson  wrote:

>  I think this would work better however I am not sure about the items.. is
> the item_entry table how its normally done? Examples online vary...
> A completed Service order would have multiple Item_entry references...
> Just doesn't seem like the right way to do it..
>
>
> db.define_table('company',
>>
>> Field('name', 'string'))
>>
>>
>>> db.define_table('lease',
>>
>> Field('name', 'string'),
>>
>> Field('attn', 'string'),
>>
>> Field('location', 'string'))
>>
>>
>>> db.define_table('account_code',
>>
>> Field('code','string'))
>>
>>
>>> db.define_table('item',
>>
>> Field('name', 'string'),
>>
>> Field('pl_no', 'integer'),
>>
>> Field('cost', 'double'))
>>
>>
>>> db.define_table('item_entry',
>>
>> Field('item', 'reference item'),
>>
>> Field('amount', 'double'))
>>
>>
>>> db.define_table('service_order',
>>
>> Field('so_date', 'date'),
>>
>> Field('so_num', 'integer'),
>>
>> Field('so_hours', 'double'),
>>
>> Field('total_cost', 'double'),
>>
>> Field('notes', 'text'),
>>
>> Field('company', 'reference company'),
>>
>> Field('lease', 'reference lease'),
>>
>> Field('acct_code', 'reference account_code'),
>>
>> Field('items', 'list:reference item_entry')
>>
>> )
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Jesse Ferguson
I am working to move the company from paper to electronic, I work in a remote 
office and have to fax all of this right now.

basic workflow:
   Service Orders Created in the field at Job site get delivered to me every 
day.
   I take the service order and create a workup (basically an invoice) using a 
rolodex of company/location details (Price List, ACCCODE, ATTN TO, PO#, ETC..)
   I then fax all the service orders and workups at the end of the week to our 
main office.

I think I have figured out the schema but if you could take a look and see if 
you can find any obvious errors please let me know.. I will attach code in next 
reply



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Richard Vézina
Could you explain the 3 differents part of the paperwork... There the
invoice at the right but what is the listing in the lower left...

Richard


On Tue, Aug 5, 2014 at 2:57 PM, Jesse Ferguson  wrote:

> here is the paperwork
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Jesse Ferguson
The service order on the right is what is completed in the field by the 
techs. (The part they bring me). The form on the left is what our company 
calls a Work-Up. The work up Is created by me by taking the service orders 
information and the information from a rolodex card. The rolodex card (not 
pictured) contains just basic information about the company and location 
(mileage to charge and hours). then i scan them both just as pictured and 
send them to main office.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-06 Thread Richard Vézina
Ok, so the list is a should be a dropbox in your app where you can pick the
service or the pieces in you invoice? I guess it is now an kind of check
list you receive to create the invoice?

There is a lot of wording in your business you could start by simplifying
all the concept the use and figure out what it refer to in a simple invoice
app, like invoice and item, etc.

To me you need a invoice table structure for your service order, you need
item table for all the service your business provide that will serve as a
lookup table to make sure employee don't spell service or product
differently from time to time. Then you need to a complex form to make all
this working together with consumer table, etc.

Some time you don't want to make a system so custom that only well trained
person can understand. Paper system tend to be not well organize and
thought because relation between stuff wrote there is just the sheet of
paper, no multiplicity and well define relation with the rest of the thing.
Things get added overtime and they just add a check box for instance and
when you try to deconstruct all this you discover that there is many
missleading practices that you should not allow in a computing system. I
would not try to make my system do the exact workflow process then the
paper because it will surely lead to a poor db and app design.

It is difficult to help you with the design because there a lot of work
that I can really do for you (missing info and lack of knowledge of you
organisation). But you should start by create a db schema that is
normalized and follow invoice system best practices before the thinking to
your app. Don't think how you will implement you app at first because it
will bring you to make mistake in you db schema. Once you have a good db
schema (that you can pick on the web directly, they are mostly good because
invoice systeme is a big classic) you can start to implement the app and
start feelling nervous because you don't know how to do it :)

When there is only to find a way to create a complex form, if you ask the
right question here you will get the exact pieces of code you need. There
is also the web2py slices that are really good.

Richard




On Tue, Aug 5, 2014 at 3:27 PM, Jesse Ferguson  wrote:

> The service order on the right is what is completed in the field by the
> techs. (The part they bring me). The form on the left is what our company
> calls a Work-Up. The work up Is created by me by taking the service orders
> information and the information from a rolodex card. The rolodex card (not
> pictured) contains just basic information about the company and location
> (mileage to charge and hours). then i scan them both just as pictured and
> send them to main office.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Web2py Forms and Javascript

2014-08-18 Thread Richard Vézina
Don't know where you get so far, but I post the code example I talked about
on this thread :
https://groups.google.com/d/msg/web2py/oiyOIC0IH04/6-NvVOJECU8J

The example is for phone numbers, but you can reuse it for anything else.

I use that code for one to many relation with normalized db schema.

Richard


On Wed, Aug 6, 2014 at 10:13 AM, Richard Vézina  wrote:

> Ok, so the list is a should be a dropbox in your app where you can pick
> the service or the pieces in you invoice? I guess it is now an kind of
> check list you receive to create the invoice?
>
> There is a lot of wording in your business you could start by simplifying
> all the concept the use and figure out what it refer to in a simple invoice
> app, like invoice and item, etc.
>
> To me you need a invoice table structure for your service order, you need
> item table for all the service your business provide that will serve as a
> lookup table to make sure employee don't spell service or product
> differently from time to time. Then you need to a complex form to make all
> this working together with consumer table, etc.
>
> Some time you don't want to make a system so custom that only well trained
> person can understand. Paper system tend to be not well organize and
> thought because relation between stuff wrote there is just the sheet of
> paper, no multiplicity and well define relation with the rest of the thing.
> Things get added overtime and they just add a check box for instance and
> when you try to deconstruct all this you discover that there is many
> missleading practices that you should not allow in a computing system. I
> would not try to make my system do the exact workflow process then the
> paper because it will surely lead to a poor db and app design.
>
> It is difficult to help you with the design because there a lot of work
> that I can really do for you (missing info and lack of knowledge of you
> organisation). But you should start by create a db schema that is
> normalized and follow invoice system best practices before the thinking to
> your app. Don't think how you will implement you app at first because it
> will bring you to make mistake in you db schema. Once you have a good db
> schema (that you can pick on the web directly, they are mostly good because
> invoice systeme is a big classic) you can start to implement the app and
> start feelling nervous because you don't know how to do it :)
>
> When there is only to find a way to create a complex form, if you ask the
> right question here you will get the exact pieces of code you need. There
> is also the web2py slices that are really good.
>
> Richard
>
>
>
>
> On Tue, Aug 5, 2014 at 3:27 PM, Jesse Ferguson  wrote:
>
>> The service order on the right is what is completed in the field by the
>> techs. (The part they bring me). The form on the left is what our company
>> calls a Work-Up. The work up Is created by me by taking the service orders
>> information and the information from a rolodex card. The rolodex card (not
>> pictured) contains just basic information about the company and location
>> (mileage to charge and hours). then i scan them both just as pictured and
>> send them to main office.
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> 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/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Forms removing data on errors...

2012-09-22 Thread Jason Brower

I am trying to fix a bug in InterestID.  http://interestid.com
The issue is that the form looses the data you enter if there is an 
error in the form.
Any ideas why?  In particular the invitation and event texts are not 
staying if there is some kind of error.

You can try it on out testing server all you like.
http://testing.interestid.com
Hope you can help.
You can use this use if you like.
U:testing_user
P:testinguser
BR,
Jason Brower

--





Re: [web2py] Forms, radio boxes, options, etc.

2010-12-04 Thread Richard Vézina
Here you will find some answers :

http://wiki.web2py.com/Form_Select_Options_from_DB

For your drop down you
have to define : requires=IS_IN_SET(['red',
'green', 'blue']) instead of requires=IS_IN_SET(['Non-Fiction',
'Fiction', 'Childrens'])

Hope this help!

Richard

On Sat, Dec 4, 2010 at 6:23 PM, VP  wrote:

> I'd like to use FORM(...) to create forms with radio boxes, drop-down
> options, etc.  But I can't find any document on how to do this.
>
> For example, if I'd like a drop-down option for 'red', 'green',
> 'blue', how do I do this using FORM?
>
> Thanks.


[web2py] embedding web2py forms in static websites

2012-02-13 Thread Richard Penman
I want to embed web2py forms in a static website (same domain) and keep the 
static part as simple as possible.

Currently I have this in the static website:

$("#form").load("path/to/web2py/app");


And this in the web2py app:
def email():
script = """
$("#contact_form").submit(function(event) {
$.post(this.action, $(this).serialize(), function(response) {
$("#contact_form").replaceWith(response);
});
return false;
});"""

form = FORM(
SCRIPT(script),
TABLE(
TR('Message:', TEXTAREA(_name='message', 
requires=IS_NOT_EMPTY())),
TR('', INPUT(_type='submit')),
), 
_action=URL(), 
_id='contact_form'
)
if form.accepts(request):
# process result ...
return 'Message received'
else:
return form.xml()


The key part is: $("#contact_form").replaceWith(response);
Each AJAX request the form is replaced with the latest response, which is 
either a form with errors or the success message.

This works as expected, but is there a better way to do this? 

Richard


[web2py] forms redirect and verification doesn't work

2012-12-02 Thread jonas
Hi.

when using the code below redirect and verification doesn't work:

def comment():

""" create comment form """

post=db(db.blog.id==request.args(0)).select().first()
db.comments.post_id.default=post.id
form=crud.create(db.comments)

if form.process().accepted:
session.flash = T('yes yes')
redirect(URL('index.html'))
else:
print "error"
session.flash = T('no no')
raise HTTP(400, "no form validation")

return dict(form=form)

when I remove the if form... else... clause verification works but I don't 
have the redirect anymore:

def comment():

""" create comment form """

post=db(db.blog.id==request.args(0)).select().first()
db.comments.post_id.default=post.id
form=crud.create(db.comments)

return dict(form=form)

Have no clue why. please help. 

-- 





[web2py] Forms with clienttools? or Forms in jquiDialog

2011-04-28 Thread james c.
Trying to use SQLFORM forms with Mr. Freeze's web2pyslices clienttools
(which is very easy to use). The resulting clienttools html is
identical to html for the app admin form for the same, the only
difference _id='dialog' is set for use with clienttools . There
appears to be jquery/javascript trapping form posts from #dialog.The
form is displayed in the dialog, as expected with clienttools. When
"submit" I can see a post occur with Firebug but nothing happens on
the controller side. The same was happening just using jqueryui Dialog
without clienttools. Does any on have any experience with the same or
an idea what is happening. The controller looks like:


def add_groups():

form = SQLFORM(db.groups, _id='dialog', submit_button='Add',
_method='post', _action='')
if form.accepts(request.vars, session):
response.flash = 'form accepted'
records=SQLTABLE(db().select(db.groups.ALL))

return jq("#clckAddGroups").append(DIV(_id="dialog"))() + \
   jq("#dialog").html(form)() + \
   jq("#dialog").dialog(dict(title="Name of Group",
modal="True", height="400", width="900"))()

Thanks in advance, for any tips or advice. James C.


[web2py] Forms partly filled with data from tables.

2010-06-25 Thread Johann Spies
I suppose I will have to find a way to combine SQLTable and SQLForm :)

Example

Table A:

Surname  |   Name |  School |  someotherdata...

a   |   b|c| ...
d   |  e |f | ...

These people attend courses.  Another table (say B)  contains the
attendance lists.

What the customer wants is that when course "somecourse"  is selected
with the purpose of filling in the attendance the form (which will
populate table B)
 should  be prepopulated from Table A and look like this :

Course: Somecourse

Teachers present:

Surname  |  Name |  School | Time in  | Time out
 a  |b  |  c   | [to be filled in]   | [to
be filled in]
 d |e  |  f| [to be filled in]   | [to
be filled in]

Each row in this form will be a new record in Table B. The customer
wants the form to look like a paper form with the list of names of
attendees thereon.

Now my question:  How would you do this in the most efficient way?

A Grid?
Regards
Johann

-- 
-- 
"Finally, brethren, whatsoever things are true,  whatsoever things are
honest, whatsoever things are  just, whatsoever things are pure,
whatsoever things are lovely, whatsoever things are of good report; if
there be any virtue, and if there be any praise, think on these
things."Philippians 4:8


[web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Sameh Khalil


I'm new to web2py and following the book, I'm trying to follow along with 
the 3rd Chapter building the images application 
http://web2py.com/books/default/chapter/29/3#An-image-blog, I'm faced with 
a problem after building the model and trying to add uploads using the 
database administration, it doesn't work in chrome, after filling the form 
and clicking submit, the page refreshes with cleared inputs as new. The 
form works with other browsers as expected (Firefox, Opera, IE) I'm running 
on Windows 7.

Anybody knows what is causing such problem ??


Re: [web2py] forms redirect and verification doesn't work

2012-12-02 Thread Ovidio Marinho
forehead so:
  form=crud.create(db.comments)
  post=db(db.blog.id==request.args(0)).select().first()
  db.comments.post_id.default=post.id


return dict(post=post,form=form)



   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/12/2 jonas 

> Hi.
>
> when using the code below redirect and verification doesn't work:
>
> def comment():
>
> """ create comment form """
>
> post=db(db.blog.id==request.args(0)).select().first()
> db.comments.post_id.default=post.id
> form=crud.create(db.comments)
>
> if form.process().accepted:
> session.flash = T('yes yes')
> redirect(URL('index.html'))
> else:
> print "error"
> session.flash = T('no no')
> raise HTTP(400, "no form validation")
>
> return dict(form=form)
>
> when I remove the if form... else... clause verification works but I don't
> have the redirect anymore:
>
> def comment():
>
> """ create comment form """
>
> post=db(db.blog.id==request.args(0)).select().first()
> db.comments.post_id.default=post.id
> form=crud.create(db.comments)
>
> return dict(form=form)
>
> Have no clue why. please help.
>
> --
>
>
>
>

-- 





[web2py] Forms field spaced by option in db model?

2010-06-26 Thread Giuseppe Luca Scrofani
Hi, something like this is possible? Automatic generation of forms by
db is just too lazy and beautiful to make me manually construct them
just for some space in between fields...

db.define_table('example',
Field('one'),
Field('two'),
Field('three'),
(insert a br here),
Field('for'),
Field('five'),
Field('six'),
(inser another br here),
Field('seven'))

This or something like css trick...

gls


Re: [web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Bruno Rocha
check if you have any link with an empty href or any image with an empty src

 and  cause problems with form submission.

On Thu, Feb 16, 2012 at 3:52 PM, Sameh Khalil  wrote:

> I'm new to web2py and following the book, I'm trying to follow along with
> the 3rd Chapter building the images application
> http://web2py.com/books/default/chapter/29/3#An-image-blog, I'm faced
> with a problem after building the model and trying to add uploads using the
> database administration, it doesn't work in chrome, after filling the form
> and clicking submit, the page refreshes with cleared inputs as new. The
> form works with other browsers as expected (Firefox, Opera, IE) I'm running
> on Windows 7.
>
> Anybody knows what is causing such problem ??
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Forms not working with web2py in Chrome

2012-02-16 Thread Sameh Khalil
The forms page is created by web2py in the database administration page, 
and I checked the source and it contains no empty hrefs or src

[web2py] How do I apply placeholder text to web2py forms?

2011-06-23 Thread Carl
I'm using custom forms in my views using this format:
{{=form.custom.widget.first_name}}

I'd like to use HTML's placeholder attribute to input tags: e.g.,


Today: what are the ways to enable this? Obviously happy to drop the
{{=form.custom.widget.first_name}} format and use something else.

Tomorrow: might it be a good idea to add placeholder attribute to
db.Field() in a similar fashion to how 'label' has already been added?


[web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Massimo Di Pierro
form.element(_id='...')['_placeholder']='...'

On Jun 23, 9:24 am, Carl  wrote:
> I'm using custom forms in my views using this format:
> {{=form.custom.widget.first_name}}
>
> I'd like to use HTML's placeholder attribute to input tags: e.g.,
> 
>
> Today: what are the ways to enable this? Obviously happy to drop the
> {{=form.custom.widget.first_name}} format and use something else.
>
> Tomorrow: might it be a good idea to add placeholder attribute to
> db.Field() in a similar fashion to how 'label' has already been added?


[web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Anthony
A couple other methods:
 
1. In the controller or view:
 
form.custom.widget.first_name.update(_placeholder="first name")
 
or
 
2. Customize the db.yourtable.first_name widget:
 
db.define_table('yourtable', Field('first_name',
widget=lambda field,value: SQLFORM.widgets.string.widget(field, value, 
_placeholder='first name')),
[rest of table definition])
 
or specify it after table definition via 
db.yourtable.first_name.widget=lambda...
 
Method #2 will apply the change to all forms that include that field.
 
There should probably be an easier/more straightforward way to do this, 
though. All the widgets take keyword arguments, but it doesn't look like 
there's an easy way to pass them in when the widgets are associated with db 
table fields.
 
Anthony
 

On Thursday, June 23, 2011 10:55:19 AM UTC-4, Massimo Di Pierro wrote:

> form.element(_id='...')['_placeholder']='...' 
>
> On Jun 23, 9:24 am, Carl  wrote: 
> > I'm using custom forms in my views using this format: 
> > {{=form.custom.widget.first_name}} 
> > 
> > I'd like to use HTML's placeholder attribute to input tags: e.g., 
> >  
> > 
> > Today: what are the ways to enable this? Obviously happy to drop the 
> > {{=form.custom.widget.first_name}} format and use something else. 
> > 
> > Tomorrow: might it be a good idea to add placeholder attribute to 
> > db.Field() in a similar fashion to how 'label' has already been added?



[web2py] Re: How do I apply placeholder text to web2py forms?

2013-07-28 Thread davedigerati
Been banging my head against the wall with this, trying to move from a 
simple form to a sqlform, and placeholder is not working:
in my view this works fine:
{{=form.custom.widget.tm_home}}
but
{{=form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
or
{{=form.custom.widget.tm_home['_placeholder] = 'Home Team Name'}}
gives
 keyword can't be an expression 
(newGame.html, line 99)
and
{{=form.custom.widget.tm_home(_placeholder = "Home Team Name")}}
gives
 'INPUT' object is not callable

I'm assuming this is a formatting problem in my code (hence the variations 
above I scraped from google and this thread) but what exactly?
Thanks!

(And +1 for more input 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How do I apply placeholder text to web2py forms?

2013-07-28 Thread Anthony
Should be:

{{form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
{{=form.custom.widget.tm_home}}

You can move that first line into the controller if you like.

Anthony

On Sunday, July 28, 2013 1:41:22 PM UTC-4, davedigerati wrote:
>
> Been banging my head against the wall with this, trying to move from a 
> simple form to a sqlform, and placeholder is not working:
> in my view this works fine:
> {{=form.custom.widget.tm_home}}
> but
> {{=form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
> or
> {{=form.custom.widget.tm_home['_placeholder] = 'Home Team Name'}}
> gives
>  keyword can't be an expression 
> (newGame.html, line 99)
> and
> {{=form.custom.widget.tm_home(_placeholder = "Home Team Name")}}
> gives
>  'INPUT' object is not callable
>
> I'm assuming this is a formatting problem in my code (hence the variations 
> above I scraped from google and this thread) but what exactly?
> Thanks!
>
> (And +1 for more input 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How do I apply placeholder text to web2py forms?

2013-07-28 Thread davedigerati
Thank you Anthony- U nailed it.

But can I say GR!?
I had tried that but copy/pasted the lines so the placeholder still had an 
= to output and I'm guessing that was what it barfed on

Is there a good, short/sweet reference for format of single vs double 
quotes, parentheses vs brackets?  I notice differences in the answers above 
and would like to understand convention better.
Again, thank you!

On Sunday, July 28, 2013 1:56:24 PM UTC-4, Anthony wrote:
>
> Should be:
>
> {{form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
> {{=form.custom.widget.tm_home}}
>
> You can move that first line into the controller if you like.
>
> Anthony
>
> On Sunday, July 28, 2013 1:41:22 PM UTC-4, davedigerati wrote:
>>
>> Been banging my head against the wall with this, trying to move from a 
>> simple form to a sqlform, and placeholder is not working:
>> in my view this works fine:
>> {{=form.custom.widget.tm_home}}
>> but
>> {{=form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
>> or
>> {{=form.custom.widget.tm_home['_placeholder] = 'Home Team Name'}}
>> gives
>>  keyword can't be an expression 
>> (newGame.html, line 99)
>> and
>> {{=form.custom.widget.tm_home(_placeholder = "Home Team Name")}}
>> gives
>>  'INPUT' object is not callable
>>
>> I'm assuming this is a formatting problem in my code (hence the 
>> variations above I scraped from google and this thread) but what exactly?
>> Thanks!
>>
>> (And +1 for more input 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How do I apply placeholder text to web2py forms?

2013-07-28 Thread Anthony
No difference between single and double quotes, though you typically use 
single quotes unless you are quoting something that contains single quotes, 
in which case you may use double quotes (or triple single/double quotes -- 
''' or """).

Parentheses are used when calling functions or methods, and brackets are 
used for specifying keys of dictionaries or slicing lists.

All of this is just standard Python, so any Python reference should cover 
this.

Anthony

On Sunday, July 28, 2013 2:07:18 PM UTC-4, davedigerati wrote:
>
> Thank you Anthony- U nailed it.
>
> But can I say GR!?
> I had tried that but copy/pasted the lines so the placeholder still had an 
> = to output and I'm guessing that was what it barfed on
>
> Is there a good, short/sweet reference for format of single vs double 
> quotes, parentheses vs brackets?  I notice differences in the answers above 
> and would like to understand convention better.
> Again, thank you!
>
> On Sunday, July 28, 2013 1:56:24 PM UTC-4, Anthony wrote:
>>
>> Should be:
>>
>> {{form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
>> {{=form.custom.widget.tm_home}}
>>
>> You can move that first line into the controller if you like.
>>
>> Anthony
>>
>> On Sunday, July 28, 2013 1:41:22 PM UTC-4, davedigerati wrote:
>>>
>>> Been banging my head against the wall with this, trying to move from a 
>>> simple form to a sqlform, and placeholder is not working:
>>> in my view this works fine:
>>> {{=form.custom.widget.tm_home}}
>>> but
>>> {{=form.custom.widget.tm_home["_placeholder"] = "Home Team Name"}}
>>> or
>>> {{=form.custom.widget.tm_home['_placeholder] = 'Home Team Name'}}
>>> gives
>>>  keyword can't be an expression 
>>> (newGame.html, line 99)
>>> and
>>> {{=form.custom.widget.tm_home(_placeholder = "Home Team Name")}}
>>> gives
>>>  'INPUT' object is not callable
>>>
>>> I'm assuming this is a formatting problem in my code (hence the 
>>> variations above I scraped from google and this thread) but what exactly?
>>> Thanks!
>>>
>>> (And +1 for more input 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How do I apply placeholder text to web2py forms?

2014-08-21 Thread Giacomo Dorigo
Method 1 can be easily generalized in a function that set the placeholder 
for all sqlform fields and strip away all labels and comments:

def autoset_form_placeholders(form, form_labels=False, form_comments=False):
for f in form.fields:
if f == 'id':
pass
else:
form.custom.widget[f].update(_placeholder=f)
if not form_labels:
form.elements('.w2p_fl', replace=None)
if not form_comments:
form.elements('.w2p_fc', replace=None)




On Thursday, June 23, 2011 6:04:55 PM UTC+2, Anthony wrote:
>
> A couple other methods:
>  
> 1. In the controller or view:
>  
> form.custom.widget.first_name.update(_placeholder="first name")
>  
> or
>  
> 2. Customize the db.yourtable.first_name widget:
>  
> db.define_table('yourtable', Field('first_name',
> widget=lambda field,value: SQLFORM.widgets.string.widget(field, value, 
> _placeholder='first name')),
> [rest of table definition])
>  
> or specify it after table definition via 
> db.yourtable.first_name.widget=lambda...
>  
> Method #2 will apply the change to all forms that include that field.
>  
> There should probably be an easier/more straightforward way to do this, 
> though. All the widgets take keyword arguments, but it doesn't look like 
> there's an easy way to pass them in when the widgets are associated with db 
> table fields.
>  
> Anthony
>  
>
> On Thursday, June 23, 2011 10:55:19 AM UTC-4, Massimo Di Pierro wrote:
>
>> form.element(_id='...')['_placeholder']='...' 
>>
>> On Jun 23, 9:24 am, Carl  wrote: 
>> > I'm using custom forms in my views using this format: 
>> > {{=form.custom.widget.first_name}} 
>> > 
>> > I'd like to use HTML's placeholder attribute to input tags: e.g., 
>> >  
>> > 
>> > Today: what are the ways to enable this? Obviously happy to drop the 
>> > {{=form.custom.widget.first_name}} format and use something else. 
>> > 
>> > Tomorrow: might it be a good idea to add placeholder attribute to 
>> > db.Field() in a similar fashion to how 'label' has already been added?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: How do I apply placeholder text to web2py forms?

2014-08-24 Thread Joe Barnhart
If you're using SQLFORM, I did come up with a cute little trick that uses a 
lambda to add placeholders to a custom formstyle definition.

https://groups.google.com/d/msg/web2py/VSr2oLNnozg/jlbbYPaAoiMJ

-- Joe

On Thursday, June 23, 2011 7:24:44 AM UTC-7, Carl Hunter Roach wrote:
>
> I'm using custom forms in my views using this format: 
> {{=form.custom.widget.first_name}} 
>
> I'd like to use HTML's placeholder attribute to input tags: e.g., 
>  
>
> Today: what are the ways to enable this? Obviously happy to drop the 
> {{=form.custom.widget.first_name}} format and use something else. 
>
> Tomorrow: might it be a good idea to add placeholder attribute to 
> db.Field() in a similar fashion to how 'label' has already been added?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-30 Thread Pystar
I have a form that includes a "tweet this" select box option. I would like 
to tweet the contents of the textarea which is the only form field and at 
the same time submit the form to a database. I am at a loss on how to 
develop this. Is it possible with web2py. Considering the fact that I am 
only using the inbuilt auth for user authentication.

-- 





Re: [web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Carl Roach
thanks.

feels right to have this data in the view but I can see the advantage
of 'declare once' in the model.
I agree Anthony, a solution could be baked into web2py as 'label'
already has been. html5 is here and adoption is pretty good thanks in
large part to webkit.

On 23 June 2011 17:04, Anthony  wrote:
> A couple other methods:
>
> 1. In the controller or view:
>
> form.custom.widget.first_name.update(_placeholder="first name")
>
> or
>
> 2. Customize the db.yourtable.first_name widget:
>
> db.define_table('yourtable', Field('first_name',
>     widget=lambda field,value: SQLFORM.widgets.string.widget(field, value,
> _placeholder='first name')),
>     [rest of table definition])
>
> or specify it after table definition via
> db.yourtable.first_name.widget=lambda...
>
> Method #2 will apply the change to all forms that include that field.
>
> There should probably be an easier/more straightforward way to do this,
> though. All the widgets take keyword arguments, but it doesn't look like
> there's an easy way to pass them in when the widgets are associated with db
> table fields.
>
> Anthony
>
> On Thursday, June 23, 2011 10:55:19 AM UTC-4, Massimo Di Pierro wrote:
>>
>> form.element(_id='...')['_placeholder']='...'
>>
>> On Jun 23, 9:24 am, Carl  wrote:
>> > I'm using custom forms in my views using this format:
>> > {{=form.custom.widget.first_name}}
>> >
>> > I'd like to use HTML's placeholder attribute to input tags: e.g.,
>> > 
>> >
>> > Today: what are the ways to enable this? Obviously happy to drop the
>> > {{=form.custom.widget.first_name}} format and use something else.
>> >
>> > Tomorrow: might it be a good idea to add placeholder attribute to
>> > db.Field() in a similar fashion to how 'label' has already been added?


Re: [web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Anthony
On Thursday, June 23, 2011 12:19:06 PM UTC-4, Carl wrote: 
>
> I agree Anthony, a solution could be baked into web2py as 'label'
> already has been. html5 is here and adoption is pretty good thanks in
> large part to webkit.
>
Rather than a specific argument just for 'placeholder', it should be 
possible to specify any arbitrary  tag attribute (e.g., there are 
lots of them) -- the widgets accept such attributes via a **attributesargument, 
but doesn't look like there's an easy way to pass them in for 
widgets associated with db table fields.
 
Anthony


Re: [web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Anthony
On Thursday, June 23, 2011 12:19:06 PM UTC-4, Carl wrote: 
>
> I agree Anthony, a solution could be baked into web2py as 'label'
> already has been. html5 is here and adoption is pretty good thanks in
> large part to webkit.
>
Rather than a specific argument just for 'placeholder', it should be 
possible to specify any arbitrary  tag attribute (there are lots of 
them) -- the widgets accept such attributes via a **attributes argument, but 
doesn't look like there's an easy way to pass them in for widgets associated 
with db table fields.
 
Anthony


Re: [web2py] Re: How do I apply placeholder text to web2py forms?

2011-06-23 Thread Carl Roach
gotcha. something more open-ended.

On 23 June 2011 17:29, Anthony  wrote:
> On Thursday, June 23, 2011 12:19:06 PM UTC-4, Carl wrote:
>>
>> I agree Anthony, a solution could be baked into web2py as 'label'
>> already has been. html5 is here and adoption is pretty good thanks in
>> large part to webkit.
>
> Rather than a specific argument just for 'placeholder', it should be
> possible to specify any arbitrary  tag attribute (there are lots of
> them) -- the widgets accept such attributes via a **attributes argument, but
> doesn't look like there's an easy way to pass them in for widgets associated
> with db table fields.
>
> Anthony


Re: [web2py] Re: How do I apply placeholder text to web2py forms?

2013-07-29 Thread Richard Vézina
I already suggest this... But we could make a Field() methode that let
insert HTML attribute to a field like html5 attributes or any other
attribute without the obligation to create a custom widget or manipulate a
generated form, etc.

Ex.:

Field('input', 'type', ..., html_attr=dict('_placeholder'='my place holder
text...'),

The html_attr should be smart and not set wrong attr to a given html tag if
this property is not a member of the tag attributes...

Not sure how it could be done, but it could be really usefull to help
improve form with new html5 attributes...

Thanks

Richard


On Sun, Jul 28, 2013 at 9:05 PM, Anthony  wrote:

> No difference between single and double quotes, though you typically use
> single quotes unless you are quoting something that contains single quotes,
> in which case you may use double quotes (or triple single/double quotes --
> ''' or """).
>
> Parentheses are used when calling functions or methods, and brackets are
> used for specifying keys of dictionaries or slicing lists.
>
> All of this is just standard Python, so any Python reference should cover
> this.
>
> Anthony
>
>
> On Sunday, July 28, 2013 2:07:18 PM UTC-4, davedigerati wrote:
>>
>> Thank you Anthony- U nailed it.
>>
>> But can I say GR!?
>> I had tried that but copy/pasted the lines so the placeholder still had
>> an = to output and I'm guessing that was what it barfed on
>>
>> Is there a good, short/sweet reference for format of single vs double
>> quotes, parentheses vs brackets?  I notice differences in the answers above
>> and would like to understand convention better.
>> Again, thank you!
>>
>> On Sunday, July 28, 2013 1:56:24 PM UTC-4, Anthony wrote:
>>>
>>> Should be:
>>>
>>> {{form.custom.widget.tm_home["**_placeholder"] = "Home Team Name"}}
>>> {{=form.custom.widget.tm_home}**}
>>>
>>> You can move that first line into the controller if you like.
>>>
>>> Anthony
>>>
>>> On Sunday, July 28, 2013 1:41:22 PM UTC-4, davedigerati wrote:

 Been banging my head against the wall with this, trying to move from a
 simple form to a sqlform, and placeholder is not working:
 in my view this works fine:
 {{=form.custom.widget.tm_home}**}
 but
 {{=form.custom.widget.tm_home[**"_placeholder"] = "Home Team Name"}}
 or
 {{=form.custom.widget.tm_home[**'_placeholder] = 'Home Team Name'}}
 gives
  keyword can't be an expression
 (newGame.html, line 99)
 and
 {{=form.custom.widget.tm_home(**_placeholder = "Home Team Name")}}
 gives
  'INPUT' object is not callable

 I'm assuming this is a formatting problem in my code (hence the
 variations above I scraped from google and this thread) but what exactly?
 Thanks!

 (And +1 for more input 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+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] "Tweet this" and web2py forms. How do I design this?

2012-08-30 Thread Bruno Rocha
Without OAuth and permissions I only can see one way.

The twitter url for tweets is:

def tweet():
tweet_url =
"https://twitter.com/intent/tweet?original_referer=%(referer)s&related=%(related)s&source=%(source)s&text=%(text)s"
form = SQLFORM(db.tweets)
if form.process().accepted:
if form.vars.tweetthis:
data = dict(referer="mysiteurl.com",
related="mytwittername",
source="myappname",
text=form.vars.tweet_text)
redirect(tweet_url % data)  # here you can choose to use
Javascript and open in a popup (aditional logic needed)
return dict(form=form)


On Thu, Aug 30, 2012 at 4:17 PM, Pystar  wrote:
>
> I have a form that includes a "tweet this" select box option. I would like to 
> tweet the contents of the textarea which is the only form field and at the 
> same time submit the form to a database. I am at a loss on how to develop 
> this. Is it possible with web2py. Considering the fact that I am only using 
> the inbuilt auth for user authentication.
>
> --
>
>
>

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-30 Thread Pystar
I guess I didnt pass my point across well enough. Would it be possible if I 
could access the content of a form and call a function that would tweet the 
content of that form before inserting the content into a database? i.e. if 
form.accept(request.vars, session, onvalidation=tweet())
or something similar?

On Thursday, August 30, 2012 9:04:22 PM UTC+1, rochacbruno wrote:
>
> Without OAuth and permissions I only can see one way. 
>
> The twitter url for tweets is: 
>
> def tweet(): 
> tweet_url = 
> "
> https://twitter.com/intent/tweet?original_referer=%(referer)s&related=%(related)s&source=%(source)s&text=%(text)s"
>  
>
> form = SQLFORM(db.tweets) 
> if form.process().accepted: 
> if form.vars.tweetthis: 
> data = dict(referer="mysiteurl.com", 
> related="mytwittername", 
> source="myappname", 
> text=form.vars.tweet_text) 
> redirect(tweet_url % data)  # here you can choose to use 
> Javascript and open in a popup (aditional logic needed) 
> return dict(form=form) 
>
>
> On Thu, Aug 30, 2012 at 4:17 PM, Pystar > 
> wrote: 
> > 
> > I have a form that includes a "tweet this" select box option. I would 
> like to tweet the contents of the textarea which is the only form field and 
> at the same time submit the form to a database. I am at a loss on how to 
> develop this. Is it possible with web2py. Considering the fact that I am 
> only using the inbuilt auth for user authentication. 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-30 Thread Bruno Rocha
It is only possible if you have implemented OAuth and user gave access
permission for your application.

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-30 Thread Pystar
But I am only using web2py inbuilt Auth. Can I use Auth and still allow 
users grant permission to my app using OAuth? And does the twitter API cap 
limit of 100k users count if I do?


On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>
> It is only possible if you have implemented OAuth and user gave access 
> permission for your application. 

-- 





[web2py] Re: "Tweet this" and web2py forms. How do I design this?

2012-08-31 Thread Pystar
question still not answered


On Thursday, August 30, 2012 8:17:23 PM UTC+1, Pystar wrote:
>
> I have a form that includes a "tweet this" select box option. I would like 
> to tweet the contents of the textarea which is the only form field and at 
> the same time submit the form to a database. I am at a loss on how to 
> develop this. Is it possible with web2py. Considering the fact that I am 
> only using the inbuilt auth for user authentication.

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-31 Thread Massimo Di Pierro
web2py has an Oauth 1 and Oauth 2 consumer, not a provider. It includes a 
CAS provider. not sure if this answers your question.


On Thursday, 30 August 2012 15:42:56 UTC-5, Pystar wrote:
>
> But I am only using web2py inbuilt Auth. Can I use Auth and still allow 
> users grant permission to my app using OAuth? And does the twitter API cap 
> limit of 100k users count if I do?
>
>
> On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>>
>> It is only possible if you have implemented OAuth and user gave access 
>> permission for your application. 
>
>

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-09-04 Thread Alec Taylor
Maybe what you're looking for is a self-populating javascript modal with a
"tweet this button".

That should be trivial to implement by appending the write information to
the twitter URL. (see share code for correct URL)
On 31/08/2012 6:42 AM, "Pystar"  wrote:

> But I am only using web2py inbuilt Auth. Can I use Auth and still allow
> users grant permission to my app using OAuth? And does the twitter API cap
> limit of 100k users count if I do?
>
>
> On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>>
>> It is only possible if you have implemented OAuth and user gave access
>> permission for your application.
>
>  --
>
>
>
>

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-09-04 Thread Pystar
can you point me to any tips or hints? I really appreciate

On Tuesday, September 4, 2012 8:03:08 AM UTC+1, Alec Taylor wrote:
>
> Maybe what you're looking for is a self-populating javascript modal with a 
> "tweet this button".
>
> That should be trivial to implement by appending the write information to 
> the twitter URL. (see share code for correct URL)
> On 31/08/2012 6:42 AM, "Pystar" > wrote:
>
>> But I am only using web2py inbuilt Auth. Can I use Auth and still allow 
>> users grant permission to my app using OAuth? And does the twitter API cap 
>> limit of 100k users count if I do?
>>
>>
>> On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>>>
>>> It is only possible if you have implemented OAuth and user gave access 
>>> permission for your application. 
>>
>>  -- 
>>  
>>  
>>  
>>
>

-- 





[web2py] Forms working as expected most of the time but occasionally they simply clears

2011-09-13 Thread Lennon
I have a few forms in a web2py shopping cart that I built from
scratch. Most of the time the forms are working fine but once in
awhile on submission a form will neither submit and redirect to the
next page of the cart nor return any form errors as it usually does
when there is a form error.

Instead it simply refreshes the page and clears the form. What's
really frustrating about this bug is that the same user will have this
bug and when they try again with the same browser and same data it
will work fine.

In fact, none of my team has been able to reproduce it but three of
our users have reported it so I'm inclined to think something is
wrong.

One thing the forms all in common is that they all add session as an
argument for form.accepts:

if form.accepts(request.vars, session):

Perhaps if something was screwy in my session it might cause this
behavior? Although when I looked in the gluon/sqlhtml web2py file it
didn't seem to use session for much of anything.

The various forms and models are all very long so before posting all
of that code, I was wondering if anybody simply had some thoughts on
what might be causing this and/or could point me in the right
direction.

I'll be happy to post any part of the code that would help shed some
light on the matter. Let me know, thanks.