[web2py] Re: Uploading multiple images in web2py

2016-07-06 Thread Massimo Di Pierro
Mind that with modern browsers (tested on chrome), dropzone is not 
necessary as it is the default behavior. All you need to do is use CSS to 
style the  to make it clear to users they can drop 
files there.

On Tuesday, 5 July 2016 16:28:11 UTC-5, Fabio Ceccarani wrote:
>
> I'm trying with dropzone.js but I have some difficult to integrate it in 
> sqlform. Someone has used it with sqlform?
> Thanks
> Fabio

-- 
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: Use a controller with upload and auth.wiki, page is unresponsive

2016-07-06 Thread Daniel Vogel
Hi Anthony

Thanks for the hint.

If I use a URL instead the component, it should work.
I tried with a Link on the wiki page and it works.

[[Edit Picture [Edit] @//picture/form_a.html]]


Daniel

On Saturday, July 2, 2016 at 3:18:33 PM UTC+2, Daniel Vogel wrote:
>
> Hi
>
> I use a controller to upload files.
> - If I use the function native (without auth.wiki), it works
> - If I use the function inside the auth.wiki to extend my wiki pages and I 
> don't use the upload field, it works
> - If I use the function inside the auth.wiki to extend my wiki pages and I 
> use the upload field, it dos not works, page unresponsive
>
> I tried the newest web2py, but the problem exist as well with version 
> 2.12.3-stable+timestamp.2015.08.19.00.18.03.
>
> db.define_table('picture1',
> Field('serie', requires=IS_IN_SET(['tsm01', 
> 'tsm02','supm01','supm02'],zero=None)),
> Field('titel', requires=IS_NOT_EMPTY()),
> Field('aktion'),
> Field('image','upload'),
> Field('name'),
> Field('bemerkung'),
>)
>
> Controller picture:
> def manage():
> response.subtitle = 'Bearbeiten Picture'
> grid = SQLFORM.grid(db.picture1)
> return locals()
>
> View picture/manage.load:
> {{=H3(response.subtitle)}}
> {{=HR()}}
>
> {{=grid}}
>
>
> Wiki Page:
> @{component:picture/manage.load}
>
>
>
>
> Any ideas?
>
> Thanks, Daniel
>
>

-- 
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: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Marlysson Silva
Great funcionality!!

Em terça-feira, 5 de julho de 2016 15:20:06 UTC-3, Massimo Di Pierro 
escreveu:
>
> db = DAL()
>
> db.define_table('person',Field('name'))
>
> db.define_table('thing',Field('name'),Field('owner','reference person'))
>
>
> for name in ('Max','Tim','Jim'):
>
> i = db.person.insert(name=name)
>
> for thing in ('Chair','Table','Bike'):
>
> db.thing.insert(owner=i, name=name+"'s "+thing)
>
>
> rows = db(db.thing).select().join(db.person.id)
>
> print(rows.as_json())
>
>
> """   
> 
>  
>
> [{"owner": {"id": 1, "name": "Max"}, "id": 1, "name": "Max's Chair"}, 
> 
>  
>
>  {"owner": {"id": 1, "name": "Max"}, "id": 2, "name": "Max's Table"}, 
> 
>  
>
>  {"owner": {"id": 1, "name": "Max"}, "id": 3, "name": "Max's Bike"},  
> 
>  
>
>  {"owner": {"id": 2, "name": "Tim"}, "id": 4, "name": "Tim's Chair"}, 
> 
>  
>
>  {"owner": {"id": 2, "name": "Tim"}, "id": 5, "name": "Tim's Table"}, 
> 
>  
>
>  {"owner": {"id": 2, "name": "Tim"}, "id": 6, "name": "Tim's Bike"},  
> 
>  
>
>  {"owner": {"id": 3, "name": "Jim"}, "id": 7, "name": "Jim's Chair"}, 
> 
>  
>
>  {"owner": {"id": 3, "name": "Jim"}, "id": 8, "name": "Jim's Table"}, 
> 
>  
>
>  {"owner": {"id": 3, "name": "Jim"}, "id": 9, "name": "Jim's Bike"}]  
> 
>  
>
> """
>
>
>
> rows = db(db.person).select().join(db.thing.owner, name="owns", fields=[
> db.thing.id, db.thing.name])
>
> print(rows.as_json())
>
>
> """   
> 
>  
>
> [{"id": 1, "name": "Max", "owns": [   
> 
>  
>
> {"id": 1, "name": "Max's Chair"}, 
> 
>  
>
> {"id": 2, "name": "Max's Table"}, 
> 
>  
>
> {"id": 3, "name": "Max's Bike"}]},
> 
>  
>
>  {"id": 2, "name": "Tim", "owns": [   
> 
>  
>
> {"id": 4, "name": "Tim's Chair"}, 
> 
>  
>
> {"id": 5, "name": "Tim's Table"}, 
> 
>  
>
> {"id": 6, "name": "Tim's Bike"}]},
> 
>  
>
>  {"id": 3, "name": "Jim", "owns": [   
> 
>  
>
> {"id": 7, "name": "Jim's Chair"}, 
> 
>  
>
> {"id": 8, "name": "Jim's Table"}, 
> 
>

[web2py] Re: Bootstrap datepicker plugin

2016-07-06 Thread Donald McClymont
This is nice and a great improvement for dates.  I thought I could easily 
replicate for datetime by using this which seems to be a fork of the 
original to allow time input as well

http://www.malot.fr/bootstrap-datetimepicker/demo.php?utm_source=siteweb&utm_medium=demo&utm_campaign=Site%2BWeb

https://github.com/smalot/bootstrap-datetimepicker

however it seems to not be formatting the time selection correctly for some 
reason and may well need some adjustment to update with the script.  I will 
continue to look at getting working but if anyone else can provide some 
hints on how to do this then would be good to have both options available 
in some manner.

Donald


On Tuesday, July 5, 2016 at 5:10:44 PM UTC+1, Ron Chatterjee wrote:
>
> I had my fair share of evaluation. Which looks better?
>
>
>
> On Monday, May 11, 2015 at 5:01:36 PM UTC-4, villas wrote:
>>
>> Thanks Leonel.
>>
>> BTW in your first post you said:   
>> Field('birthdate', 'date', widget=bsdatepicker_widget) 
>>
>> It should be with brackets at the end:
>> Field('birthdate', 'date', widget=bsdatepicker_widget()) 
>>
>

-- 
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] Re: Identifyng Relationship

2016-07-06 Thread Carlos Cesar Caballero Díaz
Hi Anthony, that's exactly what I need, because (among other things) 
when the parent key is part of the child primary key I can do something 
like child.parent_id, and it works the same with a relationship of depth 
n, for example in the relation author-book-page-sentence-word, I can ask 
what author wrote a word just saying word.author_id without need to join 
word with sentence with page with book to get the author id.


Greetings.

El 05/07/16 a las 16:58, Anthony escribió:
On Tuesday, July 5, 2016 at 2:10:19 PM UTC-4, Carlos Cesar Caballero 
wrote:


Hi Antony, tough day with me no?

You not need a join to get the id of any of the related tables,
but if you need only the top-table data, you only need one join,
not n (you can look the diagrams)


Not sure I follow. As I understand it, an identifying relationship is 
one where the foreign key from the child to the parent is also part of 
the primary key of the child. In the DAL, you still have the foreign 
key, but the DAL also includes a unique primary key (i.e., a 
"surrogate"), so there is no need for the foreign key to serve as part 
of the primary key. The structure of the table and logic of the 
relationship remains the same in either case, though, no?


It would help to clarify if you could specify the schema of a set of 
tables and explain what you can do with your proposed schema that you 
cannot easily do via the DAL.


Anthony
--
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.




--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Ron Chatterjee
I am not too familiar with python way of looping since I come from 
traditional coding background. How would this for loop be implemented? in 
terms of.

persons = {'Max','Tim','Jim'};
item = {'Chair','Table','Bike''};

#nested for loop.

for i in range of len(persons):
ii = db.person.insert(name=persons[i]);
 for j in range of len(item):
db.thing.insert(owner=ii, name=persons[i]+"'s "+item[j]);

#no end needed for the loop to finish.

rows = db(db.thing).select().join(db.person.id)

print(rows.as_json())
Am I correct?


  
  

On Wednesday, July 6, 2016 at 7:24:53 AM UTC-4, Marlysson Silva wrote:
>
> Great funcionality!!
>
> Em terça-feira, 5 de julho de 2016 15:20:06 UTC-3, Massimo Di Pierro 
> escreveu:
>>
>> db = DAL()
>>
>> db.define_table('person',Field('name'))
>>
>> db.define_table('thing',Field('name'),Field('owner','reference person'))
>>
>>
>> for name in ('Max','Tim','Jim'):
>>
>> i = db.person.insert(name=name)
>>
>> for thing in ('Chair','Table','Bike'):
>>
>> db.thing.insert(owner=i, name=name+"'s "+thing)
>>
>>
>> rows = db(db.thing).select().join(db.person.id)
>>
>> print(rows.as_json())
>>
>>
>> """   
>> 
>>  
>>
>> [{"owner": {"id": 1, "name": "Max"}, "id": 1, "name": "Max's Chair"}, 
>> 
>>  
>>
>>  {"owner": {"id": 1, "name": "Max"}, "id": 2, "name": "Max's Table"}, 
>> 
>>  
>>
>>  {"owner": {"id": 1, "name": "Max"}, "id": 3, "name": "Max's Bike"},  
>> 
>>  
>>
>>  {"owner": {"id": 2, "name": "Tim"}, "id": 4, "name": "Tim's Chair"}, 
>> 
>>  
>>
>>  {"owner": {"id": 2, "name": "Tim"}, "id": 5, "name": "Tim's Table"}, 
>> 
>>  
>>
>>  {"owner": {"id": 2, "name": "Tim"}, "id": 6, "name": "Tim's Bike"},  
>> 
>>  
>>
>>  {"owner": {"id": 3, "name": "Jim"}, "id": 7, "name": "Jim's Chair"}, 
>> 
>>  
>>
>>  {"owner": {"id": 3, "name": "Jim"}, "id": 8, "name": "Jim's Table"}, 
>> 
>>  
>>
>>  {"owner": {"id": 3, "name": "Jim"}, "id": 9, "name": "Jim's Bike"}]  
>> 
>>  
>>
>> """
>>
>>
>>
>> rows = db(db.person).select().join(db.thing.owner, name="owns", fields=[
>> db.thing.id, db.thing.name])
>>
>> print(rows.as_json())
>>
>>
>> """   
>> 
>>  
>>
>> [{"id": 1, "name": "Max", "owns": [   
>> 
>>  
>>
>> {"id": 1, "name": "Max's Chair"}, 
>> 
>>  
>>
>> {"id": 2, "name": "Max's Table"}, 
>> 
>>  
>>
>> {"id": 3, "name": "Max's Bike"}]},
>> 
>>  
>>
>>  {"id": 2, "name": "Tim", "owns": [   
>> 
>>  
>>
>> {"id": 4, "name": "Tim's Chair"}, 
>> 
>>  
>>
>> {"id": 5, "name": "Tim's Table"}, 
>> 
>>  
>>
>> {"id":

[web2py] Re: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Anthony
It's not quite clear what you are asking. It looks like you are 
implementing the same looping as in Massimo's original example -- what was 
wrong with that code? Anyway, if you want to use an index in the loop, it 
would be range(len(persons)).

Anthony

On Wednesday, July 6, 2016 at 11:12:27 AM UTC-4, Ron Chatterjee wrote:
>
> I am not too familiar with python way of looping since I come from 
> traditional coding background. How would this for loop be implemented? in 
> terms of.
>
> persons = {'Max','Tim','Jim'};
> item = {'Chair','Table','Bike''};
>
> #nested for loop.
>
> for i in range of len(persons):
> ii = db.person.insert(name=persons[i]);
>  for j in range of len(item):
> db.thing.insert(owner=ii, name=persons[i]+"'s "+item[j]);
>
> #no end needed for the loop to finish.
>
> rows = db(db.thing).select().join(db.person.id)
>
> print(rows.as_json())
> Am I correct?
>
>
>   
>   
>
> On Wednesday, July 6, 2016 at 7:24:53 AM UTC-4, Marlysson Silva wrote:
>>
>> Great funcionality!!
>>
>> Em terça-feira, 5 de julho de 2016 15:20:06 UTC-3, Massimo Di Pierro 
>> escreveu:
>>>
>>> db = DAL()
>>>
>>> db.define_table('person',Field('name'))
>>>
>>> db.define_table('thing',Field('name'),Field('owner','reference person'))
>>>
>>>
>>> for name in ('Max','Tim','Jim'):
>>>
>>> i = db.person.insert(name=name)
>>>
>>> for thing in ('Chair','Table','Bike'):
>>>
>>> db.thing.insert(owner=i, name=name+"'s "+thing)
>>>
>>>
>>> rows = db(db.thing).select().join(db.person.id)
>>>
>>> print(rows.as_json())
>>>
>>>
>>> """ 
>>> 
>>>
>>>
>>> [{"owner": {"id": 1, "name": "Max"}, "id": 1, "name": "Max's Chair"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 1, "name": "Max"}, "id": 2, "name": "Max's Table"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 1, "name": "Max"}, "id": 3, "name": "Max's Bike"},
>>> 
>>>
>>>
>>>  {"owner": {"id": 2, "name": "Tim"}, "id": 4, "name": "Tim's Chair"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 2, "name": "Tim"}, "id": 5, "name": "Tim's Table"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 2, "name": "Tim"}, "id": 6, "name": "Tim's Bike"},
>>> 
>>>
>>>
>>>  {"owner": {"id": 3, "name": "Jim"}, "id": 7, "name": "Jim's Chair"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 3, "name": "Jim"}, "id": 8, "name": "Jim's Table"},   
>>> 
>>>
>>>
>>>  {"owner": {"id": 3, "name": "Jim"}, "id": 9, "name": "Jim's Bike"}]
>>> 
>>>
>>>
>>> """
>>>
>>>
>>>
>>> rows = db(db.person).select().join(db.thing.owner, name="owns", fields=[
>>> db.thing.id, db.thing.name])
>>>
>>> print(rows.as_json())
>>>
>>>
>>> """ 
>>> 
>>>
>>>
>>> [{"id": 1, "name": "Max", "owns": [ 
>>> 
>>>
>>>
>>> {"id": 1, "name": "Max's Chair"},   
>>> 
>>>
>>>
>>> {"id": 2, "name": "Max's Table"},   
>>> 
>>>
>>>
>>> {"id": 3, "name": "Max's Bike"}]},  
>>> 
>>>
>>>
>>>  {"id": 2, "name": "Tim", "owns": [ 
>>>  

Re: [web2py] Re: Identifyng Relationship

2016-07-06 Thread Anthony
On Wednesday, July 6, 2016 at 8:39:57 AM UTC-4, Carlos Cesar Caballero 
wrote:
>
> Hi Anthony, that's exactly what I need, because (among other things) when 
> the parent key is part of the child primary key I can do something like 
> child.parent_id, and it works the same with a relationship of depth n, for 
> example in the relation author-book-page-sentence-word, I can ask what 
> author wrote a word just saying word.author_id without need to join word 
> with sentence with page with book to get the author id.
>

Yes, but nothing stops you from doing that with the DAL:

db.define_table('word',
Field('sentence_id', 'reference sentence'),
Field('page_id', 'reference page'),
Field('book_id', 'reference book'),
Field('author_id', 'reference author'),
Field('word'))

word = db.word(1)
author_id = word.author_id

In the above, db.word.author_id is not part of the primary key of the 
db.word table, but it is still a foreign key to the db.author table.

But keep in mind that this is not that useful, as all you have is the 
record ID of the author -- if you want any details about the author, you 
still need to do a join or an additional query.

Anthony

-- 
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: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Ron Chatterjee
range (0, len (item)). a define incremental value defaulted as 1. I am saying 
there is another way to write the same. But you are right Anthony.  Its same. 

-- 
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: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Anthony
On Wednesday, July 6, 2016 at 1:21:33 PM UTC-4, Ron Chatterjee wrote:
>
> range (0, len (item))


That's the same as range(len(item)).

Anthony

-- 
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] Re: new experimental feature in trunk - rows.join(...)

2016-07-06 Thread Marlysson Silva
To get the index of list , too could use "for index, value in
enumerate(list)" .



2016-07-06 14:24 GMT-03:00 Anthony :

> On Wednesday, July 6, 2016 at 1:21:33 PM UTC-4, Ron Chatterjee wrote:
>>
>> range (0, len (item))
>
>
> That's the same as range(len(item)).
>
> Anthony
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/_xQUWYXZG54/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/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] How can I keep the user input value in form after user submit the form?

2016-07-06 Thread Jing Lu
Dear Web2Py developers,

Is there any way that I can keep the user input value in the form using 
SQLFORM?



Thanks,
Jing 

-- 
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 can I keep the user input value in form after user submit the form?

2016-07-06 Thread isi_jca
Hi!!!

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


Sometime you want an insert form that, upon submission and after the 
insert, retains the preceding values to help the user insert a new record. 
This can be done:

db=SQLDB('sqlite://db.db')
db.define_table('user', SQLField('name','string'))

And in controller

def test():
form=SQLFORM(db.user)
if form.accepts(request.vars,session,keepvalues=True):
response.flash="record inserted"
return dict(form=form)

Notice the keepvalues=True argument of the accepts method.


http://www.web2py.com/AlterEgo/default/show/46


Regards.

El miércoles, 6 de julio de 2016, 17:38:49 (UTC-3), Jing Lu escribió:
>
> Dear Web2Py developers,
>
> Is there any way that I can keep the user input value in the form using 
> SQLFORM?
>
>
>
> Thanks,
> Jing 
>

-- 
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: Bootstrap datepicker plugin

2016-07-06 Thread Donald McClymont
This now seems to be along the correct lines  - the issue I had was a 
styling conflict with calendar.css file in web2py for the hour class being 
set to 2em and my hack for now to fix was to append the following to the 
std datetimepicker.css that can  be downloaded however not sure if there is 
a better way.

/* To revernt font 2em in web2py calendar component */
.hour, .minute {font-size: 14px;}




On Wednesday, July 6, 2016 at 1:17:59 PM UTC+1, Donald McClymont wrote:
>
> This is nice and a great improvement for dates.  I thought I could easily 
> replicate for datetime by using this which seems to be a fork of the 
> original to allow time input as well
>
>
> http://www.malot.fr/bootstrap-datetimepicker/demo.php?utm_source=siteweb&utm_medium=demo&utm_campaign=Site%2BWeb
>
> https://github.com/smalot/bootstrap-datetimepicker
>
> however it seems to not be formatting the time selection correctly for 
> some reason and may well need some adjustment to update with the script.  I 
> will continue to look at getting working but if anyone else can provide 
> some hints on how to do this then would be good to have both options 
> available in some manner.
>
> Donald
>
>
> On Tuesday, July 5, 2016 at 5:10:44 PM UTC+1, Ron Chatterjee wrote:
>>
>> I had my fair share of evaluation. Which looks better?
>>
>>
>>
>> On Monday, May 11, 2015 at 5:01:36 PM UTC-4, villas wrote:
>>>
>>> Thanks Leonel.
>>>
>>> BTW in your first post you said:   
>>> Field('birthdate', 'date', widget=bsdatepicker_widget) 
>>>
>>> It should be with brackets at the end:
>>> Field('birthdate', 'date', widget=bsdatepicker_widget()) 
>>>
>>

-- 
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.
# -*- coding: utf-8 -*-
"""
Integrates bootstrap-datepicker nicely into web2py.
"""

__author__ = 'Leonel Câmara'
__email__ = 'leonel.cam...@i-am.pt leonelcam...@gmail.com'
__copyright__ = 'Copyright(c) 2014 Leonel Câmara'
__license__ = 'BEER-WARE'
__version__ = '0.11'
__status__ = 'Development'  # possible options: Prototype, Development, Production


from gluon import *
from gluon.sqlhtml import FormWidget



def bsdatepicker_widget(**settings):
"""
Usage:

from plugin_bs_datepicker import bsdatepicker_widget
db.table.field.widget = bsdatepicker_widget()

Another example:

db.table.field.widget = bsdatepicker_widget(startView=2)

Possible settings:
weekStart -- defaults to 0, day of the week start. 0 for Sunday - 6 for Saturday
startView  -- defaults to  0 = 'days'  set the start view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years.
minViewMode -- defaults to 0 = 'days'  set a limit for view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years.
"""

def widget(field, value, **attributes):
default = {'value': value}

attributes = FormWidget._attributes(field, default, **attributes)
attributes['_class'] = 'form-control datepicker'

dateinput = INPUT(**attributes)
settings_str = ',\n'.join(item[0] + ':' + str(item[1]) for item in settings.iteritems()) if settings else ''
javascript = SCRIPT("""
$('head').append($(''));
$.getScript('%(scripturl)s').done(function(){
$('#%(_id)s').datepicker({
format: w2p_ajax_date_format.replace('%%Y', '').replace('%%m', 'mm').replace('%%d', 'dd'),
%(settings)s
})
});
""" % {
'cssurl': URL('static', 'plugin_bs_datepicker/datepicker.css'),
'scripturl': URL('static', 'plugin_bs_datepicker/bootstrap-datepicker.js'),
'_id': dateinput.attributes['_id'],
'settings': settings_str
})
return CAT(dateinput, javascript)

return widget


def bsdatetimepicker_widget(**settings):
"""
Usage:

from plugin_bs_datepicker import bsdatepicker_widget
db.table.field.widget = bsdatepicker_widget()

Another example:

db.table.field.widget = bsdatepicker_widget(startView=2)

Possible settings:
weekStart -- defaults to 0, day of the week start. 0 for Sunday - 6 for Saturday
startView  -- defaults to  0 = 'days'  set the start view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years.
minViewMode -- defaults to 0 = 'days'  set a limit for view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years.
"""

def widget(field, va

[web2py] Re: How can I keep the user input value in form after user submit the form?

2016-07-06 Thread Jing Lu
Thanks!


That works perfectly.


Best,
Jing

On Wednesday, July 6, 2016 at 6:33:35 PM UTC-4, isi_jca wrote:
>
> Hi!!!
>
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#keepvalues
>
>
> Sometime you want an insert form that, upon submission and after the 
> insert, retains the preceding values to help the user insert a new record. 
> This can be done:
>
> db=SQLDB('sqlite://db.db')
> db.define_table('user', SQLField('name','string'))
>
> And in controller
>
> def test():
> form=SQLFORM(db.user)
> if form.accepts(request.vars,session,keepvalues=True):
> response.flash="record inserted"
> return dict(form=form)
>
> Notice the keepvalues=True argument of the accepts method.
>
>
> http://www.web2py.com/AlterEgo/default/show/46
>
>
> Regards.
>
> El miércoles, 6 de julio de 2016, 17:38:49 (UTC-3), Jing Lu escribió:
>>
>> Dear Web2Py developers,
>>
>> Is there any way that I can keep the user input value in the form using 
>> SQLFORM?
>>
>>
>>
>> Thanks,
>> Jing 
>>
>

-- 
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] choosing radio and submit inputs in view

2016-07-06 Thread lucas
hello one and all,

i'm asking for the best way to chose the single radio input under the view 
when you setup the field with widget=SQLFORM.widgets.radio.widget.

so i know that under the view you would setup something like:

{{=form.custom.begin}}
{{=form.custom.widget.report_default_report['something specific here for 
the radio choice']}}
{{=form.custom.end}}

and also, right now i am choosing submit buttons like:

form.custom.submit[3] or form.custom.submit[5]

is there a way to choose it more descriptively, like by button name, 
perhaps?

thank you in advance, lucas

-- 
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.