[web2py] Re: unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
Hi Anthony,

I fixed all things related to id and auth as you pointed and decided to use 
form with just name and subject. In the case of success in insert I used 
new id to update professor and institution information.

Tkx again for the support. I am enjoying pretty much web2py and I´ll used 
in all new projects.

Congrats for the robust framework and all the help.

Cheers  

Em quinta-feira, 12 de maio de 2016 22:41:31 UTC-3, Anthony escreveu:
>
> On Thursday, May 12, 2016 at 9:25:02 PM UTC-4, Sandro Javiel wrote:
>>
>> Thanks a lot for general comments regarding user validation. 
>>
>> User is not expected to edit professor_id neither institution_id. Anyway 
>> such information should be stored in classroom table. 
>>
>> I tried to use SQLFORM(db.classroom), but I don´t want to allow use 
>> choose both Ids. Is there an alternative way to deal with it?
>>
>
> That's odd given that the manual form you created does in fact include 
> both of those ID fields anyway.
>
> Anyway, to exclude fields from SQLFORM, just set the readable and writable 
> attributes of the database fields to False (or alternatively, SQLFORM takes 
> a "fields" argument, which is a list of the fields to include).
>
> 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: Scheduler - limit on how large the result can be?

2016-05-12 Thread Andre Kozaczka
Ah, well by "recently" I'm guessing you mean within the last 6 months. I 
just did an update and works now :)

Thanks for the additional advice - I will have the scheduled task return a 
TABLE(). Now I need to take a closer look at your w2p_tvseries code to get 
the PeriodicalUpdater to work.

-Andre

On Thursday, May 12, 2016 at 3:32:12 PM UTC-4, Niphlod wrote:
>
> this has been solved recently (the result couldn't be larger than 64k on 
> most platforms). Right now it has no limitations, although its surely 
> finite. 
> Please do keep in mind that (on top of your task being forced to pass 
> around big chunks of data) result is always json string. 
> Whenever you need to save and load a result, you convert back and forth 
> to/from json.
>
> If your "thing to do" its in the form of a series of zillions of rows that 
> needs to stored properly, you'd waste far less "energy" just making your 
> scheduled task saving the result in the "final" table rather than returning 
> the result and then having another piece that fetches the result from the 
> scheduled task and translates the result to the table.
>
> On Thursday, May 12, 2016 at 5:44:53 PM UTC+2, Alfonso Serra wrote:
>>
>> A Task's run_output and run_result fields types are mapped to LONGTEXT if 
>> you are using mysql, this is 4gb storage capacity. Python strings should be 
>> around 3Gb depending on your system's ram amount. 
>>
>>
>>

-- 
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: unexpected behavior on sqlite insert

2016-05-12 Thread Anthony
On Thursday, May 12, 2016 at 9:25:02 PM UTC-4, Sandro Javiel wrote:
>
> Thanks a lot for general comments regarding user validation. 
>
> User is not expected to edit professor_id neither institution_id. Anyway 
> such information should be stored in classroom table. 
>
> I tried to use SQLFORM(db.classroom), but I don´t want to allow use choose 
> both Ids. Is there an alternative way to deal with it?
>

That's odd given that the manual form you created does in fact include both 
of those ID fields anyway.

Anyway, to exclude fields from SQLFORM, just set the readable and writable 
attributes of the database fields to False (or alternatively, SQLFORM takes 
a "fields" argument, which is a list of the fields to include).

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: Grid remove class date/datetime

2016-05-12 Thread isi_jca
Hello!!!

In my particular case, I wrote this code in my view:



jQuery('input#tmatrizlaboral_fecingreso').removeClass('date form-control'); 


Greetings.

El jueves, 12 de mayo de 2016, 9:45:07 (UTC-3), isi_jca escribió:
>
> Hi!!!
>
> Is possible to remove class date/datetime from form Grid?.
>
> 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] Re: unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
Thanks a lot for general comments regarding user validation. 

User is not expected to edit professor_id neither institution_id. Anyway 
such information should be stored in classroom table. 

I tried to use SQLFORM(db.classroom), but I don´t want to allow use choose 
both Ids. Is there an alternative way to deal with it?



Em quinta-feira, 12 de maio de 2016 21:04:14 UTC-3, Anthony escreveu:
>
> Not sure what the problem is. How are you determining whether the insert 
> was successful? Do you flash message after submitting the form? What does 
> the view look like?
>
> Also, a few notes on your code:
>
> def new():
>> if(session.auth is not None and session.auth.user.id is not None):
>> user_id = session.auth.user.id
>>
>
> No need to refer to session.auth -- just use "auth". In fact, the first 
> line can be reduced to:
>
> if auth.user_id:
>
> auth.user_id will simply be None if the user is not logged in.
>  
>
>> professor_id = db(db.professor.id == user_id).select(
>> db.professor.id)[0]['id']
>>
>
> The above query doesn't make sense -- you are querying based on the "id" 
> of the db.professor table, but then extracting only the very "id" that you 
> used in the query. Furthermore, the IDs in the db.professor table will be 
> different from those in the db.auth_user table, so it doesn't make sense to 
> search for the db.professor record that happens to have the same "id" as 
> the currently logged in user (which will be an "id" from the db.auth_user 
> table).
>  
>
>> professor_inst_id = db(db.professor.id == 
>> professor_id).select(db.professor.institution)[0]['institution']
>>
>
> Same problem above.
>  
>
>> form=FORM('Nome da turma:', INPUT(_name='name', 
>> requires=IS_NOT_EMPTY()), 
>>   'Disciplina:',INPUT(_name='subject', 
>> requires=IS_NOT_EMPTY()), 
>>   T('Professor Id:') ,INPUT(_name='professor_id', 
>> _id='professor_id', value=professor_id), 
>>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
>> _id='professor_inst_id', value=professor_inst_id), 
>>   INPUT(_type='submit'))
>>
>
> Do you want the user to be able to change the professor_id and 
> professor_inst_id? Presumably not, as the user would have no idea what IDs 
> are associated with each professor and institution. So, don't bother 
> including those in the form (unless you're going to provide a way for the 
> user to make a selection based on names).
>  
>
>> if form.accepts(request,session):
>> 
>> 
>> db.classroom.insert(institution=request.vars.professor_inst_id, 
>> professor=request.vars.professor_id, subject=request.vars.subject, name=
>> request.vars.name)
>> response.flash = T('Nova turma criada')
>>
>
> Finally, why not just use SQLFORM(db.classroom)? It will handle everything 
> for you, including the database insert.
>
> 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: unexpected behavior on sqlite insert

2016-05-12 Thread Anthony
form.vars.professor_inst_id. But it should also be in 
request.vars.professor_inst_id.

On Thursday, May 12, 2016 at 8:17:43 PM UTC-4, Sandro Javiel wrote:
>
> I just figured out the problem is in 
> *request.vars.professor_inst_id* 
> and 
>
>
> *request.vars.professor_id*How should I access form field names 
> professor_inst_id for instance?
>
> Tkx
>
> Em quinta-feira, 12 de maio de 2016 21:00:09 UTC-3, Sandro Javiel escreveu:
>>
>> In fact form is processed and new classroom is created, however with 
>> insititution and professor equals None:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Em quinta-feira, 12 de maio de 2016 20:45:35 UTC-3, Sandro Javiel 
>> escreveu:
>>>
>>> HI Anthony,
>>>
>>> I have a function in controller group exposed using url group/new 
>>>
>>> def new():
>>> if(session.auth is not None and session.auth.user.id is not None):
>>> user_id = session.auth.user.id
>>> professor_id = db(db.professor.id == user_id).select(
>>> db.professor.id)[0]['id']
>>> professor_inst_id = db(db.professor.id == 
>>> professor_id).select(db.professor.institution)[0]['institution']
>>> form=FORM('Nome da turma:', INPUT(_name='name', 
>>> requires=IS_NOT_EMPTY()), 
>>>   'Disciplina:',INPUT(_name='subject', 
>>> requires=IS_NOT_EMPTY()), 
>>>   T('Professor Id:') ,INPUT(_name='professor_id', 
>>> _id='professor_id', value=professor_id), 
>>>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
>>> _id='professor_inst_id', value=professor_inst_id), 
>>>   INPUT(_type='submit'))
>>> if form.accepts(request,session):
>>> 
>>> 
>>> db.classroom.insert(institution=request.vars.professor_inst_id, 
>>> professor=request.vars.professor_id, subject=request.vars.subject, name=
>>> request.vars.name)
>>> response.flash = T('Nova turma criada')
>>>
>>>
>>>
>>> Em quinta-feira, 12 de maio de 2016 10:33:11 UTC-3, Anthony escreveu:

 How are you doing the insert? Is it via application code during an HTTP 
 request, or in the shell or a script. If the latter, you need to call 
 db.commit() to commit any changes to the database (this is done 
 automatically in the context of HTTP requests).

 Anthony

 On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Sandro Javiel wrote:
>
> Hi all,
>
> My app has model as shown below. If I use appadmin interface I can 
> insert on tables which have some onstraints like classroom (fk: 
> professor.id and institution.id). However using form 
>
> =FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
>   'Disciplina:',INPUT(_name='subject', 
> requires=IS_NOT_EMPTY()), 
>   T('Professor Id:') ,INPUT(_name='professor_id', 
> _id='professor_id', value=professor_id), 
>   T('Institution Id') 
> ,INPUT(_name='professor_inst_id', _id='professor_inst_id', 
> value=professor_inst_id), 
>   INPUT(_type='submit'))
>  
> The line
> db.classroom.insert(institution=request.vars.professor_inst_id, 
> professor=request.vars.professor_id, subject=request.vars.subject, name=
> request.vars.name)
> 
> produces no error but I have no effect in DB. I would like to 
> understand difference between appadmin inserts and the one I just 
> described. Is there some way to log every single sql execution? Any other 
> suggestion or complain about my code?
>
> Tkx in advance.
>
>  
> =
> db.define_table('institution',
> Field('image','blob'),
> Field('country', default='Brasil'),
> Field('name'))
>
> db.define_table('professor',
> Field('username'),
> Field('photo', 'upload'),
> Field('email'),
> Field('name'),
> Field('institution',db.institution))
>
> db.define_table('dog',
> Field('name'),
> Field('photo', 'upload'),
> Field('description', 'text'),
> Field('institution', db.institution),
> Field('professor',db.professor)) 
>
> db.define_table('config',
> Field('name'),
> Field('ssid'),
> Field('password'),
> Field('institution',db.institution ))
>
>
> db.define_table('classroom',
> Field('institution',db.institution),
> Field('professor', db.professor),
> Field('subject'),
> Field('dog_list'),
> Field('name'))
>
>
> db.define_table('bodypoint',
> Field('institution',db.institution),
> Field('classroom', db.classroom),
> Field('code', default='m'),
> Field('delimiter_chars', default='<>'),
> Field('description','text'),
> Field('name'))
>
> db.define_table('actions',
> 

[web2py] Re: How To Select Only The Latest Rows from a Table

2016-05-12 Thread PRACHI VAKHARIA



*Use the argument groupby instead of distinct, and you'll get the desired 
results.*

*so groupby fieldname2 and retrieve max(time).*


*What does groupby do exactly?*
1– Does it group rows by a certain column's values – *such that repeating 
values are hidden*?
2– Does it group rows by a certain column's values – *such that repeating 
values are grouped together*?

*How does it differ from distinct exactly, if answer is case 1?*


Thank you, sesenmaister and Niphlod.
*GroupBy works* for my requirements in this case!
So, thanks a lot for reading and helping me out.


*— PRACHI —*






-- 
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: unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
I just figured out the problem is in 
*request.vars.professor_inst_id* 
and 


*request.vars.professor_id*How should I access form field names 
professor_inst_id for instance?

Tkx

Em quinta-feira, 12 de maio de 2016 21:00:09 UTC-3, Sandro Javiel escreveu:
>
> In fact form is processed and new classroom is created, however with 
> insititution and professor equals None:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Em quinta-feira, 12 de maio de 2016 20:45:35 UTC-3, Sandro Javiel escreveu:
>>
>> HI Anthony,
>>
>> I have a function in controller group exposed using url group/new 
>>
>> def new():
>> if(session.auth is not None and session.auth.user.id is not None):
>> user_id = session.auth.user.id
>> professor_id = db(db.professor.id == user_id).select(
>> db.professor.id)[0]['id']
>> professor_inst_id = db(db.professor.id == 
>> professor_id).select(db.professor.institution)[0]['institution']
>> form=FORM('Nome da turma:', INPUT(_name='name', 
>> requires=IS_NOT_EMPTY()), 
>>   'Disciplina:',INPUT(_name='subject', 
>> requires=IS_NOT_EMPTY()), 
>>   T('Professor Id:') ,INPUT(_name='professor_id', 
>> _id='professor_id', value=professor_id), 
>>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
>> _id='professor_inst_id', value=professor_inst_id), 
>>   INPUT(_type='submit'))
>> if form.accepts(request,session):
>> 
>> 
>> db.classroom.insert(institution=request.vars.professor_inst_id, 
>> professor=request.vars.professor_id, subject=request.vars.subject, name=
>> request.vars.name)
>> response.flash = T('Nova turma criada')
>>
>>
>>
>> Em quinta-feira, 12 de maio de 2016 10:33:11 UTC-3, Anthony escreveu:
>>>
>>> How are you doing the insert? Is it via application code during an HTTP 
>>> request, or in the shell or a script. If the latter, you need to call 
>>> db.commit() to commit any changes to the database (this is done 
>>> automatically in the context of HTTP requests).
>>>
>>> Anthony
>>>
>>> On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Sandro Javiel wrote:

 Hi all,

 My app has model as shown below. If I use appadmin interface I can 
 insert on tables which have some onstraints like classroom (fk: 
 professor.id and institution.id). However using form 

 =FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
   'Disciplina:',INPUT(_name='subject', 
 requires=IS_NOT_EMPTY()), 
   T('Professor Id:') ,INPUT(_name='professor_id', 
 _id='professor_id', value=professor_id), 
   T('Institution Id') ,INPUT(_name='professor_inst_id', 
 _id='professor_inst_id', value=professor_inst_id), 
   INPUT(_type='submit'))
  
 The line
 db.classroom.insert(institution=request.vars.professor_inst_id, 
 professor=request.vars.professor_id, subject=request.vars.subject, name=
 request.vars.name)
 
 produces no error but I have no effect in DB. I would like to 
 understand difference between appadmin inserts and the one I just 
 described. Is there some way to log every single sql execution? Any other 
 suggestion or complain about my code?

 Tkx in advance.

  
 =
 db.define_table('institution',
 Field('image','blob'),
 Field('country', default='Brasil'),
 Field('name'))

 db.define_table('professor',
 Field('username'),
 Field('photo', 'upload'),
 Field('email'),
 Field('name'),
 Field('institution',db.institution))

 db.define_table('dog',
 Field('name'),
 Field('photo', 'upload'),
 Field('description', 'text'),
 Field('institution', db.institution),
 Field('professor',db.professor)) 

 db.define_table('config',
 Field('name'),
 Field('ssid'),
 Field('password'),
 Field('institution',db.institution ))


 db.define_table('classroom',
 Field('institution',db.institution),
 Field('professor', db.professor),
 Field('subject'),
 Field('dog_list'),
 Field('name'))


 db.define_table('bodypoint',
 Field('institution',db.institution),
 Field('classroom', db.classroom),
 Field('code', default='m'),
 Field('delimiter_chars', default='<>'),
 Field('description','text'),
 Field('name'))

 db.define_table('actions',
 Field('institution',db.institution),
 Field('classroom',db.classroom),
 Field('professor', db.professor),   
 Field('dog', db.dog),
 Field('query_string'),
 Field('is_active', 'boolean', default=True))

 db.professor.institution.requires = IS_IN_DB(db,'institution.id', 
 '%(name)s')
 

[web2py] Re: unexpected behavior on sqlite insert

2016-05-12 Thread Anthony
Not sure what the problem is. How are you determining whether the insert 
was successful? Do you flash message after submitting the form? What does 
the view look like?

Also, a few notes on your code:

def new():
> if(session.auth is not None and session.auth.user.id is not None):
> user_id = session.auth.user.id
>

No need to refer to session.auth -- just use "auth". In fact, the first 
line can be reduced to:

if auth.user_id:

auth.user_id will simply be None if the user is not logged in.
 

> professor_id = db(db.professor.id == user_id).select(
> db.professor.id)[0]['id']
>

The above query doesn't make sense -- you are querying based on the "id" of 
the db.professor table, but then extracting only the very "id" that you 
used in the query. Furthermore, the IDs in the db.professor table will be 
different from those in the db.auth_user table, so it doesn't make sense to 
search for the db.professor record that happens to have the same "id" as 
the currently logged in user (which will be an "id" from the db.auth_user 
table).
 

> professor_inst_id = db(db.professor.id == 
> professor_id).select(db.professor.institution)[0]['institution']
>

Same problem above.
 

> form=FORM('Nome da turma:', INPUT(_name='name', 
> requires=IS_NOT_EMPTY()), 
>   'Disciplina:',INPUT(_name='subject', 
> requires=IS_NOT_EMPTY()), 
>   T('Professor Id:') ,INPUT(_name='professor_id', 
> _id='professor_id', value=professor_id), 
>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
> _id='professor_inst_id', value=professor_inst_id), 
>   INPUT(_type='submit'))
>

Do you want the user to be able to change the professor_id and 
professor_inst_id? Presumably not, as the user would have no idea what IDs 
are associated with each professor and institution. So, don't bother 
including those in the form (unless you're going to provide a way for the 
user to make a selection based on names).
 

> if form.accepts(request,session):
> 
> 
> db.classroom.insert(institution=request.vars.professor_inst_id, 
> professor=request.vars.professor_id, subject=request.vars.subject, name=
> request.vars.name)
> response.flash = T('Nova turma criada')
>

Finally, why not just use SQLFORM(db.classroom)? It will handle everything 
for you, including the database insert.

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: unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
In fact form is processed and new classroom is created, however with 
insititution and professor equals None:














Em quinta-feira, 12 de maio de 2016 20:45:35 UTC-3, Sandro Javiel escreveu:
>
> HI Anthony,
>
> I have a function in controller group exposed using url group/new 
>
> def new():
> if(session.auth is not None and session.auth.user.id is not None):
> user_id = session.auth.user.id
> professor_id = db(db.professor.id == user_id).select(
> db.professor.id)[0]['id']
> professor_inst_id = db(db.professor.id == 
> professor_id).select(db.professor.institution)[0]['institution']
> form=FORM('Nome da turma:', INPUT(_name='name', 
> requires=IS_NOT_EMPTY()), 
>   'Disciplina:',INPUT(_name='subject', 
> requires=IS_NOT_EMPTY()), 
>   T('Professor Id:') ,INPUT(_name='professor_id', 
> _id='professor_id', value=professor_id), 
>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
> _id='professor_inst_id', value=professor_inst_id), 
>   INPUT(_type='submit'))
> if form.accepts(request,session):
> 
> 
> db.classroom.insert(institution=request.vars.professor_inst_id, 
> professor=request.vars.professor_id, subject=request.vars.subject, name=
> request.vars.name)
> response.flash = T('Nova turma criada')
>
>
>
> Em quinta-feira, 12 de maio de 2016 10:33:11 UTC-3, Anthony escreveu:
>>
>> How are you doing the insert? Is it via application code during an HTTP 
>> request, or in the shell or a script. If the latter, you need to call 
>> db.commit() to commit any changes to the database (this is done 
>> automatically in the context of HTTP requests).
>>
>> Anthony
>>
>> On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Sandro Javiel wrote:
>>>
>>> Hi all,
>>>
>>> My app has model as shown below. If I use appadmin interface I can 
>>> insert on tables which have some onstraints like classroom (fk: 
>>> professor.id and institution.id). However using form 
>>>
>>> =FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
>>>   'Disciplina:',INPUT(_name='subject', 
>>> requires=IS_NOT_EMPTY()), 
>>>   T('Professor Id:') ,INPUT(_name='professor_id', 
>>> _id='professor_id', value=professor_id), 
>>>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
>>> _id='professor_inst_id', value=professor_inst_id), 
>>>   INPUT(_type='submit'))
>>>  
>>> The line
>>> db.classroom.insert(institution=request.vars.professor_inst_id, 
>>> professor=request.vars.professor_id, subject=request.vars.subject, name=
>>> request.vars.name)
>>> 
>>> produces no error but I have no effect in DB. I would like to understand 
>>> difference between appadmin inserts and the one I just described. Is there 
>>> some way to log every single sql execution? Any other suggestion or 
>>> complain about my code?
>>>
>>> Tkx in advance.
>>>
>>>  
>>> =
>>> db.define_table('institution',
>>> Field('image','blob'),
>>> Field('country', default='Brasil'),
>>> Field('name'))
>>>
>>> db.define_table('professor',
>>> Field('username'),
>>> Field('photo', 'upload'),
>>> Field('email'),
>>> Field('name'),
>>> Field('institution',db.institution))
>>>
>>> db.define_table('dog',
>>> Field('name'),
>>> Field('photo', 'upload'),
>>> Field('description', 'text'),
>>> Field('institution', db.institution),
>>> Field('professor',db.professor)) 
>>>
>>> db.define_table('config',
>>> Field('name'),
>>> Field('ssid'),
>>> Field('password'),
>>> Field('institution',db.institution ))
>>>
>>>
>>> db.define_table('classroom',
>>> Field('institution',db.institution),
>>> Field('professor', db.professor),
>>> Field('subject'),
>>> Field('dog_list'),
>>> Field('name'))
>>>
>>>
>>> db.define_table('bodypoint',
>>> Field('institution',db.institution),
>>> Field('classroom', db.classroom),
>>> Field('code', default='m'),
>>> Field('delimiter_chars', default='<>'),
>>> Field('description','text'),
>>> Field('name'))
>>>
>>> db.define_table('actions',
>>> Field('institution',db.institution),
>>> Field('classroom',db.classroom),
>>> Field('professor', db.professor),   
>>> Field('dog', db.dog),
>>> Field('query_string'),
>>> Field('is_active', 'boolean', default=True))
>>>
>>> db.professor.institution.requires = IS_IN_DB(db,'institution.id', 
>>> '%(name)s')
>>> db.dog.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
>>> db.dog.professor.requires = IS_IN_DB(db,'professor.id', '%(name)s')
>>> db.config.institution.requires = IS_IN_DB(db,'institution.id', 
>>> '%(name)s')
>>> db.classroom.institution.requires = IS_IN_DB(db,'institution.id
>>> ','%(name)s')
>>> db.classroom.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
>>> 

[web2py] Re: unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
HI Anthony,

I have a function in controller group exposed using url group/new 

def new():
if(session.auth is not None and session.auth.user.id is not None):
user_id = session.auth.user.id
professor_id = db(db.professor.id == 
user_id).select(db.professor.id)[0]['id']
professor_inst_id = db(db.professor.id == 
professor_id).select(db.professor.institution)[0]['institution']
form=FORM('Nome da turma:', INPUT(_name='name', 
requires=IS_NOT_EMPTY()), 
  'Disciplina:',INPUT(_name='subject', 
requires=IS_NOT_EMPTY()), 
  T('Professor Id:') ,INPUT(_name='professor_id', 
_id='professor_id', value=professor_id), 
  T('Institution Id') ,INPUT(_name='professor_inst_id', 
_id='professor_inst_id', value=professor_inst_id), 
  INPUT(_type='submit'))
if form.accepts(request,session):

db.classroom.insert(institution=request.vars.professor_inst_id, 
professor=request.vars.professor_id, subject=request.vars.subject, 
name=request.vars.name)
response.flash = T('Nova turma criada')



Em quinta-feira, 12 de maio de 2016 10:33:11 UTC-3, Anthony escreveu:
>
> How are you doing the insert? Is it via application code during an HTTP 
> request, or in the shell or a script. If the latter, you need to call 
> db.commit() to commit any changes to the database (this is done 
> automatically in the context of HTTP requests).
>
> Anthony
>
> On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Sandro Javiel wrote:
>>
>> Hi all,
>>
>> My app has model as shown below. If I use appadmin interface I can insert 
>> on tables which have some onstraints like classroom (fk: professor.id 
>> and institution.id). However using form 
>>
>> =FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
>>   'Disciplina:',INPUT(_name='subject', 
>> requires=IS_NOT_EMPTY()), 
>>   T('Professor Id:') ,INPUT(_name='professor_id', 
>> _id='professor_id', value=professor_id), 
>>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
>> _id='professor_inst_id', value=professor_inst_id), 
>>   INPUT(_type='submit'))
>>  
>> The line
>> db.classroom.insert(institution=request.vars.professor_inst_id, 
>> professor=request.vars.professor_id, subject=request.vars.subject, name=
>> request.vars.name)
>> 
>> produces no error but I have no effect in DB. I would like to understand 
>> difference between appadmin inserts and the one I just described. Is there 
>> some way to log every single sql execution? Any other suggestion or 
>> complain about my code?
>>
>> Tkx in advance.
>>
>>  
>> =
>> db.define_table('institution',
>> Field('image','blob'),
>> Field('country', default='Brasil'),
>> Field('name'))
>>
>> db.define_table('professor',
>> Field('username'),
>> Field('photo', 'upload'),
>> Field('email'),
>> Field('name'),
>> Field('institution',db.institution))
>>
>> db.define_table('dog',
>> Field('name'),
>> Field('photo', 'upload'),
>> Field('description', 'text'),
>> Field('institution', db.institution),
>> Field('professor',db.professor)) 
>>
>> db.define_table('config',
>> Field('name'),
>> Field('ssid'),
>> Field('password'),
>> Field('institution',db.institution ))
>>
>>
>> db.define_table('classroom',
>> Field('institution',db.institution),
>> Field('professor', db.professor),
>> Field('subject'),
>> Field('dog_list'),
>> Field('name'))
>>
>>
>> db.define_table('bodypoint',
>> Field('institution',db.institution),
>> Field('classroom', db.classroom),
>> Field('code', default='m'),
>> Field('delimiter_chars', default='<>'),
>> Field('description','text'),
>> Field('name'))
>>
>> db.define_table('actions',
>> Field('institution',db.institution),
>> Field('classroom',db.classroom),
>> Field('professor', db.professor),   
>> Field('dog', db.dog),
>> Field('query_string'),
>> Field('is_active', 'boolean', default=True))
>>
>> db.professor.institution.requires = IS_IN_DB(db,'institution.id', 
>> '%(name)s')
>> db.dog.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
>> db.dog.professor.requires = IS_IN_DB(db,'professor.id', '%(name)s')
>> db.config.institution.requires = IS_IN_DB(db,'institution.id', 
>> '%(name)s')
>> db.classroom.institution.requires = IS_IN_DB(db,'institution.id
>> ','%(name)s')
>> db.classroom.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
>> db.bodypoint.institution.requires = IS_IN_DB(db,'institution.id
>> ','%(name)s')
>> db.bodypoint.classroom.requires = IS_IN_DB(db,'classroom.id','%(name)s')
>> db.actions.institution.requires = IS_IN_DB(db,'institution.id
>> ','%(name)s')
>> db.actions.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
>> db.actions.classroom.requires = 

[web2py] Applying Custom Navigation to web2py

2016-05-12 Thread Ron Chatterjee
Trying to create a custom navigation using menu.py intact. 

Leveraging from this link:

http://bootsnipp.com/snippets/featured/fancy-sidebar-navigation

I modified the layout.html as it comes from the welcome app to following. 
Result is a horrible looking navbar. Why?

 

  # using sidebars need to know what sidebar you want to use

mc0 = 'col-md-12'

mc1 = 'col-md-9'

mc2 = 'col-md-6'

left_sidebar_enabled = globals().get('left_sidebar_enabled', False)

right_sidebar_enabled = globals().get('right_sidebar_enabled', False)

middle_column = {0: mc0, 1: mc1, 2: mc2}[

(left_sidebar_enabled and 1 or 0)+(right_sidebar_enabled and 1 or 0)]

}}

  

  {{ response.files.append(URL('static','css/bootsnipp.css'))

response.files.append(URL('static','css/bootsnipp.js'))}}

  

  

  



{{=response.flash or 
''}}



  

   









 {{='auth' in globals() and 
auth.navbar('Welcome',mode='dropdown') or ''}}

  



   

   {{=response.logo or ''}}



  {{if response.menu:}}

  {{=MENU(response.menu, _class='nav 
navbar-nav',li_class='dropdown',ul_class='dropdown-menu')}}

  {{pass}}



 

 



{{block header}}

{{end}}

-- 
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: Are web2py apps safe from xss attacks?

2016-05-12 Thread Anthony
As long as you're allowed to write your own code, nothing is safe, but one 
thing web2py does to help protect against XSS attacks is to automatically 
escape all content inserted in views.

Anthony

On Thursday, May 12, 2016 at 4:14:00 PM UTC-4, Steve Joe wrote:
>
> how?

-- 
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] Are web2py apps safe from xss attacks?

2016-05-12 Thread Steve Joe
how?

-- 
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: web2py 2.14.6 is OUT

2016-05-12 Thread Dave S
On Monday, May 9, 2016 at 5:31:38 PM UTC-7, Massimo Di Pierro wrote:
>
> A few vulnerabilities have been found in admin. One of them was serious 
> and it made admin vulnerable to brute force password attacks under some 
> conditions.
> They have been been fixed in version 2.14.6. If you expose admin publicly, 
> we recommend you upgrade immediately.
>
> Anyway, we remind everybody that it is not recommended to expose admin in 
> production environments. Run it locally and connect to it using a ssh 
> tunnel instead.
>
> Many takes to Narendra for funding and reporting the vulnerabilities, 
> Leonel for fixing them, and Richard and Simone for adding many tests and 
> fixing bugs.
>
>
I've updated one of my instances so far, using the update button on the 
sites (admin) page, and that seems to have gone okay.  I'll be updating 
additional sites soon, with more verification.

/dps

-- 
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 to take javascript variables from one view to a different view?

2016-05-12 Thread Dave S


On Thursday, May 12, 2016 at 12:57:07 PM UTC-7, Dave S wrote:
>
> On Thursday, May 12, 2016 at 12:24:39 PM UTC-7, Steve Joe wrote:
>>
>> can u write syntax for the same?
>>
>
> This question could mean either of
>
> 1) How do I share javascript data between 2 pages?
> or
> 2) How do I copy javascript code from one template to another.
>
> If you meant 1), then my guess at the answer is that you need to use local 
> storage, because each page  is a separate document in the browser
> (if you're trying to handle iframes or ajax divs, the answer may be 
> different).
> 
>
>
Also, if you're traversing a sequence of links (that is, clicking to get 
from page 1 to page 2), your javascript can edit the href to provide args 
and/or vars in the URL to get to the second page.  That is the sort of 
thing SQLFORM does when providing a long table as a set of pages each with 
a subset of the data.

 

>
> If you meant 2), this is just a matter of how you edit the view [template] 
> files, isn't it? In the web2py IDE, you can copy a block of code, switch to 
> a different file, and past the block of code there.  Using a text editor in 
> your development environment would be a similar sequence.
>
> If you meant 3), please explain.
>
>
/dps
 

-- 
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 to take javascript variables from one view to a different view?

2016-05-12 Thread Dave S
On Thursday, May 12, 2016 at 12:24:39 PM UTC-7, Steve Joe wrote:
>
> can u write syntax for the same?
>

This question could mean either of

1) How do I share javascript data between 2 pages?
or
2) How do I copy javascript code from one template to another.

If you meant 1), then my guess at the answer is that you need to use local 
storage, because each page  is a separate document in the browser
(if you're trying to handle iframes or ajax divs, the answer may be 
different).



If you meant 2), this is just a matter of how you edit the view [template] 
files, isn't it? In the web2py IDE, you can copy a block of code, switch to 
a different file, and past the block of code there.  Using a text editor in 
your development environment would be a similar sequence.

If you meant 3), please explain.

/dps

-- 
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: change dropdown menu login

2016-05-12 Thread Niphlod
gluon.tools is the place where Auth lives.

On Thursday, May 12, 2016 at 3:39:30 PM UTC+2, Alessio Varalta wrote:
>
> Hi, I want to change the dropdown menu in the rigth corner of the web2py 
> application. I don't want the text Login but a icon..I see that the code is 
> imported with
>  
> 
> {{='auth' in globals() and 
> auth.navbar('Welcome',mode='dropdown') or ''}}
>  
>
> But where is defined this code?
>

-- 
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: Scheduler - limit on how large the result can be?

2016-05-12 Thread Niphlod
this has been solved recently (the result couldn't be larger than 64k on 
most platforms). Right now it has no limitations, although its surely 
finite. 
Please do keep in mind that (on top of your task being forced to pass 
around big chunks of data) result is always json string. 
Whenever you need to save and load a result, you convert back and forth 
to/from json.

If your "thing to do" its in the form of a series of zillions of rows that 
needs to stored properly, you'd waste far less "energy" just making your 
scheduled task saving the result in the "final" table rather than returning 
the result and then having another piece that fetches the result from the 
scheduled task and translates the result to the table.

On Thursday, May 12, 2016 at 5:44:53 PM UTC+2, Alfonso Serra wrote:
>
> A Task's run_output and run_result fields types are mapped to LONGTEXT if 
> you are using mysql, this is 4gb storage capacity. Python strings should be 
> around 3Gb depending on your system's ram amount. 
>
>
>

-- 
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 to take javascript variables from one view to a different view?

2016-05-12 Thread Steve Joe
can u write syntax for the 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] How to take javascript variables from one view to a different view using ?

2016-05-12 Thread Steve Joe
syntax for the 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: list:reference how to show option popup instead of plain id's?

2016-05-12 Thread Mirek Zvolský
oops,
when I remove requires= completly,
i.e. when I run with default IS_IN_DB validator,

then I see a different widget (probably a proper one):
all choices listed, and I can choose more rows using Ctrl+click.

So probably I should write better
requires=

When I replace: [IS_NOT_EMPTY(), IS_IN_DB()]
so: IS_IN_DB()
then it works, but validation will not fail if no item is selected.
When I use: IS_EMPTY_OR(IS_IN_DB())
it works exactly so.

I have workaround:
IS_IN_DB(, multiple=(1,999))

Is this the best solution?


Dne čtvrtek 12. května 2016 19:06:14 UTC+2 Mirek Zvolský napsal(a):
>
> Friends, what I do wrong?
>
> I want that user always can see 'name' instead of plain 'id'
>
> In model I have related table with format:
> format=lambda r: r.name
>
> And in the master table I define the list:reference field so:
> Field('ekosystemtypes', 'list:reference ekosystemtypes',
>   requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db.ekosystemtypes.id, 
> '%(name)s', multiple=True)]),
>
> In appadmin in grid I see 'name's - this works well.
> In appadmin I see the field together with [+][-] buttons - this works well.
>
> But instead of to see option popup with 'name's,
> I see (and user can choose) only plain 'id's.
>
> What I should do better?
>Some mistake?
>Should I explicitly assign some widget?
>or this simple cannot work with list:reference?
> Thanks,
> Mirek
>
>

-- 
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] list:reference how to show option popup instead of plain id's?

2016-05-12 Thread Mirek Zvolský
Friends, what I do wrong?

I want that user always can see 'name' instead of plain 'id'

In model I have related table with format:
format=lambda r: r.name

And in the master table I define the list:reference field so:
Field('ekosystemtypes', 'list:reference ekosystemtypes',
  requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db.ekosystemtypes.id, 
'%(name)s', multiple=True)]),

In appadmin in grid I see 'name's - this works well.
In appadmin I see the field together with [+][-] buttons - this works well.

But instead of to see option popup with 'name's,
I see (and user can choose) only plain 'id's.

What I should do better?
   Some mistake?
   Should I explicitly assign some widget?
   or this simple cannot work with list:reference?
Thanks,
Mirek

-- 
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: Thread with own db connection

2016-05-12 Thread Alfonso Serra
I kinda have it but its very bad. i have to declare the connection as:

class customthread(Thread):
   def __init__
  
  self.db = DAL(cnnstring, migrate=False)
  self.db['dontclose'] = True


At gluon/packages/pydal/connection.py wich handles the ConnectionPool 
modify the line 56 as:

def close_all_instances(action):
...
 if hasattr(db, '_adapter') and not hasattr(db, "dontclose"):
 db._adapter.close(action)

I wish there were an easier way, and i dont really know the implications of 
doing this. Ill tests it and see how it goes...

Thanks


-- 
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] Highcharts in web2py

2016-05-12 Thread Alfonso Serra
Actually is quite easy.

Prepare some data on your controller:
import json

def index():
   ...
   #get some rows from any source

   countries = XML(json.dumps([[r.country_name, r.population] for r in rows
]))

At your view:
//declare the libraries here, jquery hc, etc


[web2py] Re: again on javascript chart

2016-05-12 Thread Paolo Amboni
Ok, thanks. After long searching on the web i choose Chart.js. It seems 
very simple to use (in the web2py filosofy). I'll build my own library to 
port the data form "pyadl"  or from pandas!! 

Il giorno giovedì 12 maggio 2016 15:42:38 UTC+2, Anthony ha scritto:
>
> On Wednesday, May 11, 2016 at 9:39:17 AM UTC-4, Paolo Amboni wrote:
>>
>> *Since it seems an hot topic:*
>>
>> witch js library works better with web2py - python - (pandas) to plot 
>> some nice charts?
>>
>
> The question is really which works best with Python/Pandas (web2py is 
> irrelevant), and for that you might be better off asking elsewhere.
>
> And if you're interested in JS charting libraries, the server-side 
> language you are using probably won't help you differentiate much among the 
> options, except for the few that have Python specific APIs (for example, 
> Vincent , which is a Python 
> interface to Vega, and Bokeh ).
>
> 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: Scheduler - limit on how large the result can be?

2016-05-12 Thread Alfonso Serra
A Task's run_output and run_result fields types are mapped to LONGTEXT if 
you are using mysql, this is 4gb storage capacity. Python strings should be 
around 3Gb depending on your system's ram amount. 


-- 
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] Scheduler - limit on how large the result can be?

2016-05-12 Thread Andre Kozaczka
This question is in reference to Brad's post a couple years ago:

https://groups.google.com/forum/#!searchin/web2py/scheduler$20results/web2py/WM7cyrUV5-U/49JVuq5uL0wJ

Is there a limit on how large a "result" from a scheduled task can be? If 
so, how are folks working around this? My site parses some data for the 
user and generates a table which can be fairly large. I was thinking the 
scheduled task could save the table into a database and pass back an id so 
the user can access it.

-Andre

-- 
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: again on javascript chart

2016-05-12 Thread Anthony
On Wednesday, May 11, 2016 at 9:39:17 AM UTC-4, Paolo Amboni wrote:
>
> *Since it seems an hot topic:*
>
> witch js library works better with web2py - python - (pandas) to plot some 
> nice charts?
>

The question is really which works best with Python/Pandas (web2py is 
irrelevant), and for that you might be better off asking elsewhere.

And if you're interested in JS charting libraries, the server-side language 
you are using probably won't help you differentiate much among the options, 
except for the few that have Python specific APIs (for example, Vincent 
, which is a Python interface to 
Vega, and Bokeh ).

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] change dropdown menu login

2016-05-12 Thread Alessio Varalta
Hi, I want to change the dropdown menu in the rigth corner of the web2py 
application. I don't want the text Login but a icon..I see that the code is 
imported with
 

{{='auth' in globals() and 
auth.navbar('Welcome',mode='dropdown') or ''}}
 

But where is defined this code?

-- 
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: unexpected behavior on sqlite insert

2016-05-12 Thread Anthony
How are you doing the insert? Is it via application code during an HTTP 
request, or in the shell or a script. If the latter, you need to call 
db.commit() to commit any changes to the database (this is done 
automatically in the context of HTTP requests).

Anthony

On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Sandro Javiel wrote:
>
> Hi all,
>
> My app has model as shown below. If I use appadmin interface I can insert 
> on tables which have some onstraints like classroom (fk: professor.id and 
> institution.id). However using form 
>
> =FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
>   'Disciplina:',INPUT(_name='subject', 
> requires=IS_NOT_EMPTY()), 
>   T('Professor Id:') ,INPUT(_name='professor_id', 
> _id='professor_id', value=professor_id), 
>   T('Institution Id') ,INPUT(_name='professor_inst_id', 
> _id='professor_inst_id', value=professor_inst_id), 
>   INPUT(_type='submit'))
>  
> The line
> db.classroom.insert(institution=request.vars.professor_inst_id, 
> professor=request.vars.professor_id, subject=request.vars.subject, name=
> request.vars.name)
> 
> produces no error but I have no effect in DB. I would like to understand 
> difference between appadmin inserts and the one I just described. Is there 
> some way to log every single sql execution? Any other suggestion or 
> complain about my code?
>
> Tkx in advance.
>
>  
> =
> db.define_table('institution',
> Field('image','blob'),
> Field('country', default='Brasil'),
> Field('name'))
>
> db.define_table('professor',
> Field('username'),
> Field('photo', 'upload'),
> Field('email'),
> Field('name'),
> Field('institution',db.institution))
>
> db.define_table('dog',
> Field('name'),
> Field('photo', 'upload'),
> Field('description', 'text'),
> Field('institution', db.institution),
> Field('professor',db.professor)) 
>
> db.define_table('config',
> Field('name'),
> Field('ssid'),
> Field('password'),
> Field('institution',db.institution ))
>
>
> db.define_table('classroom',
> Field('institution',db.institution),
> Field('professor', db.professor),
> Field('subject'),
> Field('dog_list'),
> Field('name'))
>
>
> db.define_table('bodypoint',
> Field('institution',db.institution),
> Field('classroom', db.classroom),
> Field('code', default='m'),
> Field('delimiter_chars', default='<>'),
> Field('description','text'),
> Field('name'))
>
> db.define_table('actions',
> Field('institution',db.institution),
> Field('classroom',db.classroom),
> Field('professor', db.professor),   
> Field('dog', db.dog),
> Field('query_string'),
> Field('is_active', 'boolean', default=True))
>
> db.professor.institution.requires = IS_IN_DB(db,'institution.id', 
> '%(name)s')
> db.dog.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
> db.dog.professor.requires = IS_IN_DB(db,'professor.id', '%(name)s')
> db.config.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
> db.classroom.institution.requires = IS_IN_DB(db,'institution.id
> ','%(name)s')
> db.classroom.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
> db.bodypoint.institution.requires = IS_IN_DB(db,'institution.id
> ','%(name)s')
> db.bodypoint.classroom.requires = IS_IN_DB(db,'classroom.id','%(name)s')
> db.actions.institution.requires = IS_IN_DB(db,'institution.id','%(name)s')
> db.actions.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
> db.actions.classroom.requires = IS_IN_DB(db,'classroom.id','%(name)s')
> db.actions.dog.requires = IS_IN_DB(db,'dog.id','%(name)s')
>
>
>

-- 
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 to take HTML tag out out of list string, in set

2016-05-12 Thread Anthony
On Thursday, May 12, 2016 at 9:10:33 AM UTC-4, rajjmatt...@gmail.com wrote:
>
> Notice that render() option doesn't always shows up. 
>
> my_post = db.Post(request.args(0)). render (represent that field) is not 
> available even though its 
>
> But for example:
>
> posts = db().select(db.Post.all). Its also a  
> and I can do render(). 
>

.render is a method of the Rows object, not the Row object. Your second 
example is a Rows object.

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: How to take HTML tag out out of list string, in set

2016-05-12 Thread rajjmatthur
Notice that render() option doesn't always shows up. 

my_post = db.Post(request.args(0)). render (represent that field) is not 
available even though its 

But for example:

posts = db().select(db.Post.all). Its also a  
and I can do render(). 

But we still have list string in my_post like you have in posts. render 
option only shows with if I do select()


On Tuesday, May 10, 2016 at 11:03:41 AM UTC-4, rajjm...@gmail.com wrote:
>
> worked! thank you Anthony/Dave.
>
> On Monday, May 9, 2016 at 6:13:29 PM UTC-4, Dave S wrote:
>>
>> On Monday, May 9, 2016 at 1:34:31 PM UTC-7, rajjm...@gmail.com wrote:
>>>
>>> Interesting! 
>>>
>>> So, if I do:
>>>
>>> a = my_table.render()
>>>
>>> I get 
>>>
>>> a is  >
>>>
>>> How do I now access individual elements? like Rows[0], 
>>> Rows[1]..Rows[10].etc? because a[0] doesn't work.
>>>
>>>
>> It appears that you have an iterator.  Fromm the book:
>>
>>
>> f you don't specify an index, you get a generator to iterate over all the 
>>> rows:
>>> for row in rows.render():
>>> print row.myfield
>>
>>
>> > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=render#Rendering-rows-using-represent
>> >
>>
>> /dps
>>
>>
>>
>>  
>>
>>>
>>>
>>> On Monday, May 9, 2016 at 3:53:48 PM UTC-4, Anthony wrote:

 This has nothing to do with the IS_IN_SET validator, which simply does 
 validation in your code (typically, it would also generate an HTML select 
 widget in forms, but not in your code, as you have explicitly specified 
 your own form widget). It also has nothing to do with the field's form 
 widget, as that only controls the display in forms.

 Rather, it is related to how you represent list values in your view 
 code. Keep in mind that "days" is a "list:string" field, so it stores 
 lists. The resulting value of the field in each Row is a Python list. In a 
 view, if you do something like:

 {{=some_python_list}}

 you will get a display like the one you are seeing. If you want an 
 alternative display, it is your responsibility to produce it as you see 
 fit, depending on the nature of your UI.

 In read-only forms and the grid, list:-type fields are displayed as 
 comma-separated lists via their default "represent" attribute. However, if 
 you are just inserting a list value in a view via {{=row.my_list_field}}, 
 the "represent" attribute is not used. In that case, you need to use 
 Rows.render() to generate each Row object, which will automatically apply 
 the "represent" attributes of each field.

 Anthony

 On Monday, May 9, 2016 at 12:06:49 PM UTC-4, rajjm...@gmail.com wrote:
>
> day_str = ('Sun', 'Mon', 'Tues', 'wed')
>
> Field('days', type='list:string',,requires=IS_IN_SET ((day_str), 
> multiple=True),widget=lambda field, value: 
> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
> label=True)),
>
> /view
> {{=my_table.days}}
>
> One example
>
>
> On Monday, May 9, 2016 at 11:35:20 AM UTC-4, Anthony wrote:
>>
>> Please show your code.
>>
>> On Sunday, May 8, 2016 at 7:15:22 PM UTC-4, rajjm...@gmail.com wrote:
>>>
>>> What would be the most efficient way to take out html tag for 
>>> IS_IN_SET (str) which outputs 
>>>
>>> ['my string']
>>>
>>>
>>> Want to display.
>>>
>>>
>>> my string
>>>
>>>
>>> Is re.compile and re.sub are the only options? XML, sanitize =True 
>>> doesn't work. 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] Grid remove class date/datetime

2016-05-12 Thread isi_jca
Hi!!!

Is possible to remove class date/datetime from form Grid?.

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] Re: How to create the namespaces for web2py application database

2016-05-12 Thread Anthony
Answered on Stack Overflow: http://stackoverflow.com/a/37139874/440323

On Thursday, May 12, 2016 at 4:57:29 AM UTC-4, Chandra Bhushan Nulu wrote:
>
> I am new to web2py and google app engine, i tried to develop simple CRUD 
> operations web2py application have one database table like db.regiser and 
> deploy this application in google app engine in two different regions and 
> now i need to create the namespaces for this application database to access 
> the two different regions users to perform the CRUD operations on their own 
> namespaces without affecting the main db, and how to create the namespaces 
> to the database for web2py application.
>

-- 
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 to create the namespaces for web2py application database

2016-05-12 Thread Kiran Subbaraman
Will this help you: 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Using-replicated-databases
 
?

On Thursday, May 12, 2016 at 2:27:29 PM UTC+5:30, Chandra Bhushan Nulu 
wrote:
>
> I am new to web2py and google app engine, i tried to develop simple CRUD 
> operations web2py application have one database table like db.regiser and 
> deploy this application in google app engine in two different regions and 
> now i need to create the namespaces for this application database to access 
> the two different regions users to perform the CRUD operations on their own 
> namespaces without affecting the main db, and how to create the namespaces 
> to the database for web2py application.
>

-- 
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] 2.14.6: Mobile plugin and shell do not work?

2016-05-12 Thread Armando Hernandez
Same situation here mobile interface not working 

2.14.5-stable+timestamp.2016.04.14.03.26.16
(Ejecutando en nginx/1.9.14, Python 2.7.11+)

-- 
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 to create the namespaces for web2py application database

2016-05-12 Thread Chandra Bhushan Nulu
I am new to web2py and google app engine, i tried to develop simple CRUD 
operations web2py application have one database table like db.regiser and 
deploy this application in google app engine in two different regions and 
now i need to create the namespaces for this application database to access 
the two different regions users to perform the CRUD operations on their own 
namespaces without affecting the main db, and how to create the namespaces 
to the database for web2py application.

-- 
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 To Select Only The Latest Rows from a Table

2016-05-12 Thread Zenia Zen



*Use the argument groupby instead of distinct, and you'll get the desired 
results.*

*so groupby fieldname2 and retrieve max(time).*


*What does groupby do exactly?*
1– Does it group rows by a certain column's values – *such that repeating 
values are hidden*?
2– Does it group rows by a certain column's values – *such that repeating 
values are grouped together*?

*How does it differ from distinct exactly, if answer is case 1?*


Thank you, sesenmaister and Niphlod.
*GroupBy works* for my requirements in this case!
So, thanks a lot for reading and helping me out.


*— PRACHI —*






-- 
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] unexpected behavior on sqlite insert

2016-05-12 Thread Sandro Javiel
Hi all,

My app has model as shown below. If I use appadmin interface I can insert 
on tables which have some onstraints like classroom (fk: professor.id and 
institution.id). However using form 

=FORM('Nome da turma:', INPUT(_name='name', requires=IS_NOT_EMPTY()), 
  'Disciplina:',INPUT(_name='subject', 
requires=IS_NOT_EMPTY()), 
  T('Professor Id:') ,INPUT(_name='professor_id', 
_id='professor_id', value=professor_id), 
  T('Institution Id') ,INPUT(_name='professor_inst_id', 
_id='professor_inst_id', value=professor_inst_id), 
  INPUT(_type='submit'))
 
The line
db.classroom.insert(institution=request.vars.professor_inst_id, 
professor=request.vars.professor_id, subject=request.vars.subject, 
name=request.vars.name)

produces no error but I have no effect in DB. I would like to understand 
difference between appadmin inserts and the one I just described. Is there 
some way to log every single sql execution? Any other suggestion or 
complain about my code?

Tkx in advance.

 
=
db.define_table('institution',
Field('image','blob'),
Field('country', default='Brasil'),
Field('name'))

db.define_table('professor',
Field('username'),
Field('photo', 'upload'),
Field('email'),
Field('name'),
Field('institution',db.institution))

db.define_table('dog',
Field('name'),
Field('photo', 'upload'),
Field('description', 'text'),
Field('institution', db.institution),
Field('professor',db.professor)) 

db.define_table('config',
Field('name'),
Field('ssid'),
Field('password'),
Field('institution',db.institution ))


db.define_table('classroom',
Field('institution',db.institution),
Field('professor', db.professor),
Field('subject'),
Field('dog_list'),
Field('name'))


db.define_table('bodypoint',
Field('institution',db.institution),
Field('classroom', db.classroom),
Field('code', default='m'),
Field('delimiter_chars', default='<>'),
Field('description','text'),
Field('name'))

db.define_table('actions',
Field('institution',db.institution),
Field('classroom',db.classroom),
Field('professor', db.professor),   
Field('dog', db.dog),
Field('query_string'),
Field('is_active', 'boolean', default=True))

db.professor.institution.requires = IS_IN_DB(db,'institution.id', 
'%(name)s')
db.dog.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
db.dog.professor.requires = IS_IN_DB(db,'professor.id', '%(name)s')
db.config.institution.requires = IS_IN_DB(db,'institution.id', '%(name)s')
db.classroom.institution.requires = IS_IN_DB(db,'institution.id','%(name)s')
db.classroom.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
db.bodypoint.institution.requires = IS_IN_DB(db,'institution.id','%(name)s')
db.bodypoint.classroom.requires = IS_IN_DB(db,'classroom.id','%(name)s')
db.actions.institution.requires = IS_IN_DB(db,'institution.id','%(name)s')
db.actions.professor.requires = IS_IN_DB(db,'professor.id','%(name)s')
db.actions.classroom.requires = IS_IN_DB(db,'classroom.id','%(name)s')
db.actions.dog.requires = IS_IN_DB(db,'dog.id','%(name)s')


-- 
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: What's wrong with this script?

2016-05-12 Thread Fernando D. Bozzo
Well, may be there is a simple solution for this: Don't use it in a tab and 
open a new Window. I don't think that Chrome checks if it is the active 
Window or not.

Regards.-


El miércoles, 11 de mayo de 2016, 23:39:14 (UTC+2), Niphlod escribió:
>
> aside from considering a browser "as the best" being a rather subjective 
> matter, when you google around you find out that it could be a security 
> threat to have geolocation turned on when the user isn't watching at the 
> tab (also, chrome received a lot of efforts in merging code-paths with the 
> mobile version, and this potentially saves battery life).
>
> tl;dr: chrome devs ruled it behaves this way, and you can't do nothing 
> about it.
>

-- 
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: web2py scheduler with huge output or return values always timeout (even if the task finishes)

2016-05-12 Thread Niphlod
results get stored to a tempfile. it has been recently fixed. Huge "prints" 
are still a problem and are discouraged, but now you can have a result as 
big as you wish.

On Thursday, May 12, 2016 at 5:19:04 AM UTC+2, Andre Kozaczka wrote:
>
> I'm curious what workarounds folks have come up with regarding this issue. 
>
> On Monday, February 29, 2016 at 1:41:41 PM UTC-5, Boris Aramis Aguilar 
> Rodríguez wrote:
>>
>> Hi, there is an issue driving me crazy with the web2py scheduler:
>>
>> If you return something that has a huge size then it will always timeout; 
>> even if the scheduler task correctly finishes. Let me explain with an 
>> example:
>>
>> def small_test():
>> s = 's'*1256018
>> another_s = s
>> #print s
>> #print another_s
>> #print 'FINISHED PROCESS'
>> return dict(s = s, another_s = another_s, f = 'finished')
>>
>> small_test is the function to execute, as you can see a string full of 
>> 's' 1256018 times is. Simple
>>
>> So when you enqueue the scheduler every time the output is the same: 
>> http://prnt.sc/a9iarj (screenshot of the TIMEOUT)
>>
>> As you can see from the screenshot, the process actually finished; while 
>> logging the scheduler output shows the following:
>>
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:   work to do 1405
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:new scheduler_run 
>> record
>> INFO:web2py.scheduler.PRTALONENETLAPP-SRV#24475:new task 1405 
>> "small_test" portal/default.small_test
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475: new task allocated: 
>> portal/default.small_test
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:   task starting
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:task started
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:new task report: 
>> COMPLETED
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:   result: {"s": 
>> "ss$
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:freeing workers 
>> that have not sent heartbeat
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:freeing workers 
>> that have not sent heartbeat
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:freeing workers 
>> that have not sent heartbeat
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:recording 
>> heartbeat (RUNNING)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:task timeout
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475: recording task report 
>> in db (TIMEOUT)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475: status TIMEOUT, 
>> stop_time 2016-02-29 11:56:52.393706, run_result {"s": 
>> "sss$
>> INFO:web2py.scheduler.PRTALONENETLAPP-SRV#24475:task completed (TIMEOUT)
>> DEBUG:web2py.scheduler.PRTALONENETLAPP-SRV#24475:looping...
>> INFO:web2py.scheduler.PRTALONENETLAPP-SRV#24475:nothing to do
>>
>>
>>
>> As you can see there is a TaskReport object in the queue with a COMPLETED 
>> status (I know this because I read the scheduler.py code of web2py) So I'm 
>> pretty sure the task finishes quite fast but then it hangs.
>>
>> So I did another test, that doesn't directly use the scheduler but only 
>> calls the executor method from the scheduler and usess process; just like 
>> the scheduler would:
>>
>> from gluon.scheduler import Task
>> from gluon.scheduler import executor
>> t = Task(app='portal', function='small_test', timeout = 120)
>> import logging
>> logging.getLogger().setLevel(logging.DEBUG)
>> import multiprocessing
>> queue = 

[web2py] Re: again on javascript chart

2016-05-12 Thread pang

In the pandas tutorial they use matplotlib, so I'd follow that path. I 
think there have been questions already on how to embed matplilib in 
web2py. But a general search for matplotlib in the browser will give you 
several options:

http://mpld3.github.io/

http://stackoverflow.com/questions/22739592/how-to-embed-an-interactive-matplotlib-plot-in-a-webpage#31505677

-- 
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] Highcharts in web2py

2016-05-12 Thread José Luis Redrejo
I've played with highcharts and it's pretty simple if you use the json
decorator in web2py.
On the other hand, if you want a really free library I'd recommend you to
use d3js. The examples in its site are really good and you only need to
replace d3.tsv by d3.json(... calling the controller and format your
data in the controller to return the data in the same format that the tsv
file from the example to make them work.
Highcharts is a bit easier than d3js, but it's less flexible and you have
to pay a license to use it in a commercial application, while d3js is
totally free.

My 20 cents.
José L.

2016-05-11 15:52 GMT+02:00 Carlos Cesar Caballero Díaz <
desarro...@spicm.cfg.sld.cu>:

> Hi, is really easy integrate technologies like Highcharts in a web2py site
> using JSON, XML or CSV, here you can find how fill a chart from JSON, XML
> or CSV (http://www.highcharts.com/docs/working-with-data/data-intro) and
> you can look at the web2py book for JSON, XML or CSV data rendering (
> http://www.web2py.com/books/default/chapter/29/10/services#HTML-XML-and-JSON
> and http://www.web2py.com/books/default/chapter/29/10/services#CSV).
>
> Greetings.
>
> El 11/05/16 a las 09:15, kecajkecaj...@gmail.com escribió:
>
> Hi Guys,
>
> I was able to create simple graph by using highcharts.js  (
> http://www.highcharts.com/)  However since it's javascript it's really
> hard to add some data from controller. I found python module for highcharts:
>
>
> http://nbviewer.jupyter.org/github/arnoutaertgeerts/python-highcharts/blob/master/Tutorial.ipynb
>
>
> Anybody has an experience or idea how to create chart using it and how to
> display it in the view?
>
> Cheers.
> --
> 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.