Re: [web2py] Re: sqlform insert row id

2021-07-01 Thread Javier Pepe
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert-update-delete

In form.vars.id store Last ID inserted

El jue., 1 de julio de 2021 15:47, Dave S  escribió:

>
>
> On Wednesday, June 30, 2021 at 11:35:29 PM UTC-7 Clemens wrote:
>
>> the insert returns the id of the new record.
>>
>> new_id = db.table.insert(...)
>>
>> Have a try!
>>
>
> Well, yes, if you do the insert yourself, but when you're doing SQLFORM,
> it will do the insert.  So you need it to return the new record idea.  Does
> it, and if it does how can I access it?
>
> /dps
>
>
>>
>> On Wednesday, June 30, 2021 at 11:51:08 PM UTC+2 snide...@gmail.com
>> wrote:
>>
>>> If SQLFORM.process() accepts the form and does an insert, is there a
>>> variable the controller or view can use to get the id of the row inserted?
>>>
>>> I'm not spotting it in Chapter 7 nor in sqlhtml.py.
>>>
>>> /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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/182ad87d-380c-4e9e-888f-690ca22ade8dn%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAHxJ-7rJboZvEzP1EjtGK2aZYxvnVSwqXzfJgXpHabJ%3DRCPxqg%40mail.gmail.com.


Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
Change

db.posts.question by db.posts.message

El mié., 18 de mar. de 2020 a la(s) 10:24, Maurice Waka (
mauricew...@gmail.com) escribió:

> This is my code in the model.py
>
> db.define_table('posts',
> Field('author', 'reference auth_user',
> default=auth.user_id, writable=False, readable=False),
> Field("message", 'string', requires=IS_NOT_EMPTY(),
> length=512, label=T('questions'),widget=widget(_placeholder='Type your
> question here',)),
> auth.signature
> )
>
> On Wed, Mar 18, 2020 at 4:22 PM Maurice Waka 
> wrote:
>
>> I'm getting a none value. See attached.
>>
>> On Wed, Mar 18, 2020 at 4:14 PM Javier Pepe  wrote:
>>
>>> in the manual
>>>
>>> http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms
>>>
>>> {{=form.custom.begin}}
>>> {{=form.custom.widget.question}}{{=form.custom.submit}}
>>> {{=form.custom.end}}
>>>
>>> El mié., 18 de mar. de 2020 a la(s) 10:09, Maurice Waka (
>>> mauricew...@gmail.com) escribió:
>>>
>>>> Thanks.
>>>> I put the code in the model.py code. It works.
>>>>
>>>> How about float button to right?
>>>>
>>>> Regards
>>>>
>>>> On Wed, Mar 18, 2020 at 4:00 PM Javier Pepe 
>>>> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> You can try with this
>>>>>
>>>>> db.posts.question.label = ' '
>>>>>
>>>>> label attr replace field name
>>>>>
>>>>>
>>>>>
>>>>> El mié., 18 de mar. de 2020 a la(s) 09:51, Maurice Waka (
>>>>> mauricew...@gmail.com) escribió:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm trying to customize the SQLFORM to look like
>>>>>> textarea/inputwith text area floating left and submit button to the
>>>>>> right and not bottom. I'm using the LOAD signature.
>>>>>>
>>>>>> I also want to hide the filed name (labelled as Questions see
>>>>>> attached).
>>>>>>
>>>>>> Currently with this code, I cant hide the field name and I cant find
>>>>>> a way to float the submit button to the right.
>>>>>>
>>>>>> Attached is how the form looks like.
>>>>>>
>>>>>> def post():
>>>>>> #db.posts.message.readable = False#Not working with this code
>>>>>> return dict(form=SQLFORM(db.posts, readable=False).process(),
>>>>>> posts=db(db.posts.author == auth.user.id).select() )
>>>>>>
>>>>>>
>>>>>> View page...post.load
>>>>>> 
>>>>>> {{=form}}
>>>>>> 
>>>>>>
>>>>>> --
>>>>>> 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.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/web2py/c8216348-8f12-4e8e-90c2-7e4ef9a482be%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/web2py/c8216348-8f12-4e8e-90c2-7e4ef9a482be%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> 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
>>>

Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
in the manual
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms

{{=form.custom.begin}}
{{=form.custom.widget.question}}{{=form.custom.submit}}
{{=form.custom.end}}

El mié., 18 de mar. de 2020 a la(s) 10:09, Maurice Waka (
mauricew...@gmail.com) escribió:

> Thanks.
> I put the code in the model.py code. It works.
>
> How about float button to right?
>
> Regards
>
> On Wed, Mar 18, 2020 at 4:00 PM Javier Pepe  wrote:
>
>> Hi
>>
>> You can try with this
>>
>> db.posts.question.label = ' '
>>
>> label attr replace field name
>>
>>
>>
>> El mié., 18 de mar. de 2020 a la(s) 09:51, Maurice Waka (
>> mauricew...@gmail.com) escribió:
>>
>>> Hello,
>>>
>>> I'm trying to customize the SQLFORM to look like textarea/inputwith
>>> text area floating left and submit button to the right and not bottom. I'm
>>> using the LOAD signature.
>>>
>>> I also want to hide the filed name (labelled as Questions see attached).
>>>
>>> Currently with this code, I cant hide the field name and I cant find a
>>> way to float the submit button to the right.
>>>
>>> Attached is how the form looks like.
>>>
>>> def post():
>>> #db.posts.message.readable = False#Not working with this code
>>> return dict(form=SQLFORM(db.posts, readable=False).process(),
>>> posts=db(db.posts.author == auth.user.id).select() )
>>>
>>>
>>> View page...post.load
>>> 
>>> {{=form}}
>>> 
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/c8216348-8f12-4e8e-90c2-7e4ef9a482be%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/c8216348-8f12-4e8e-90c2-7e4ef9a482be%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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/m9jMXz52fZg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/CAHxJ-7oD-q_bewVyZbcViPAeKUx4kzy%2BMbCTbU%2B5_BA1a%2BSSew%40mail.gmail.com
>> <https://groups.google.com/d/msgid/web2py/CAHxJ-7oD-q_bewVyZbcViPAeKUx4kzy%2BMbCTbU%2B5_BA1a%2BSSew%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CALkNK540GAg23er7PmUbpKb1qefXQ-kYN_yikednYpFvt4jbiQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CALkNK540GAg23er7PmUbpKb1qefXQ-kYN_yikednYpFvt4jbiQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAHxJ-7oprsPy_PvDWnGE8xhU9iuBcKN6462jaGouXKhY4qSuXw%40mail.gmail.com.


Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
Hi

You can try with this

db.posts.question.label = ' '

label attr replace field name



El mié., 18 de mar. de 2020 a la(s) 09:51, Maurice Waka (
mauricew...@gmail.com) escribió:

> Hello,
>
> I'm trying to customize the SQLFORM to look like textarea/inputwith
> text area floating left and submit button to the right and not bottom. I'm
> using the LOAD signature.
>
> I also want to hide the filed name (labelled as Questions see attached).
>
> Currently with this code, I cant hide the field name and I cant find a way
> to float the submit button to the right.
>
> Attached is how the form looks like.
>
> def post():
> #db.posts.message.readable = False#Not working with this code
> return dict(form=SQLFORM(db.posts, readable=False).process(),
> posts=db(db.posts.author == auth.user.id).select() )
>
>
> View page...post.load
> 
> {{=form}}
> 
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/c8216348-8f12-4e8e-90c2-7e4ef9a482be%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAHxJ-7oD-q_bewVyZbcViPAeKUx4kzy%2BMbCTbU%2B5_BA1a%2BSSew%40mail.gmail.com.


Re: [web2py] Problem passing a json object to controller

2019-11-20 Thread Javier Pepe
You need use:

   var = json.loads ( request.post_vars.items[*"*json1*"*] )


El mié., 20 de nov. de 2019 a la(s) 14:08, Patito Feo (
patitofeo...@gmail.com) escribió:

> Hi,
>
> Ive been trying to pass an object with keys to the controller. But i
> havent been able to extract the request.vars.
>
> Here is my view:
>
> var Cars = {}
> Cars.make = 'Ford';
> Cars.model = 'Mustang';
> Cars.year = 1969;
>
> $.post( "{{=URL('default', 'transcriptor')}}", //request.post_vars.json1
>{
>  tarea: 'solicitudguardar', items: { json1: JSON.stringify( Cars )
> }
>}, )
>
>
> Here is my function:
>
> elif request.vars.tarea == 'solicitudguardar':
>
>var = json.loads ( request.post_vars.items[json1] )
>
>
>
> Here is one of the errors i got:
>
> global name 'json1' is not defined
>
>
> I dont understand why the array object is not being process as a json
> array in controller.
>
> Any help will be much appreciated.
>
>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/cb71d997-01f3-4dd3-b689-35c280e035b7%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAHxJ-7pDW9q03HMwjcOzc6JWovRTLTDTZ3S5o32rYG8JfUb8tw%40mail.gmail.com.


Re: [web2py] Re: Changing color of a cell function of another cell value

2018-11-22 Thread Javier Pepe
You can try this way

db.articles.conteneur.represent = lambda cntnumok, row: SPAN*(*row[
'conteneur'], _class='cnt-false'*)* if cntnumok==False and cntnumok else
None

Check parenthesis


El mié., 21 de nov. de 2018 a la(s) 07:42, Yann Dulondel (
yann.dulon...@gmail.com) escribió:

>
>
> Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>>
>> Hi all,
>> I have a container number and a function that check the number is valid.
>> The result of the function is store in field cntnumok (boolean).
>> I found that we can change the color with "represent" and found an
>> example in webgroup.
>>
>> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
>> 'cnt-false' if db.articles.cntnumok==False else None)
>> I understand lambda is an inline function, i want that the if test the
>> value of  "cntnumok" for the row
>> How can i have the value of  "cntnumok"  for the row?
>> I tried this also
>> db.articles.conteneur.represent = lambda v, row:
>> SPAN(v,_class='cnt-false' if row.cntnumok==False else None)
>>
>> Try this
> db.articles.conteneur.represent = lambda cntnumok, row:SPAN(row[
> 'conteneur'], _class='cnt-false' if cntnumok==False and cntnumok else None
> )
>
> No error message but the color doesn't change
>
>> Yann
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Connect DAL to Azure Postgres Instance

2018-09-28 Thread Javier Pepe
Try this:

db = DAL("postgres://xw@dbname-postgres:
p...@dbname-postgres.postgres.database.azure.com/dbname")

El vie., 28 de sep. de 2018 a la(s) 02:17, gb (gregb...@gmail.com) escribió:

> Trying to connect to Azure-hosted postgres on version
> 2.17.1-stable+timestamp.2018.08.06.01.02.56
>
> If I try and connect with:
>
> db = DAL("postgres://dbname@dbname-postgres:
> p...@dbname-postgres.postgres.database.azure.com/dbname")
>
> I get this:
> Invalid URI string in DAL
>
> I thought it might have to do with the @ so I encoded it:
>
> db = DAL("postgres://
> dbname%40dbname-postgres:p...@dbname-postgres.postgres.database.azure.com/dbname
> ")
>
> OperationalError: could not create SSL context: library has no ciphers
> FATAL: Invalid Username specified. Please check the Username and retry
> connection. The Username should be in  format.
>
> Connecting like this works totally fine:
> import psycopg2
>
> conn = psycopg2.connect("dbname='dbname' user='xw@dbname-postgres' host='
> dbname-postgres.postgres.database.azure.com' password='pass'")
>
> cur = conn.cursor()
>
>
> Any ideas?
>
> Thanks so much
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Setting writable and readable=True on all fields

2018-09-27 Thread Javier Pepe
You need use the follow code:
for f in my_table.fields():
db['my_table'][f].writable=True



El jue., 27 de sep. de 2018 a la(s) 19:01, icodk (i...@alpiron.com) escribió:

> At a certain point, I need to allow read and write on all fields of a
> specific table
>
> How can I iterate through all fields in a table and set the writable,
> readable =true
>
> This does not work:
> for f in my_table.fields():
>f.writable=f.readable=True
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] CUSTOMIZING WEB2PY FORMS

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

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

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

> Hie guys,
>
> how do i customize the buttons on the forms if i add =form to my web page?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] SQLFORM IS_NOT_EMPTY validator dependent on the value of another request vara

2018-01-15 Thread Javier Pepe
Hi

You can use de conditional show_if

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

db,table.text_field.show_if = (db.table.select_field == Other)




2018-01-12 23:19 GMT-03:00 vtcpe12 :

> Hi,
>
> I am utilizing the IS_IN_SET functionality to produce a select box in my
> SQLFORM. One of the options is 'Other'. I have another simple text box that
> I would like to force the user to enter a value for if Other is selected in
> the select box. Is that possible with the built in validators?
>
> 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.
>

-- 
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] Open a form (form=SQLFORM(db.marks)) for a selected person by clicking on a link of their name

2017-10-22 Thread Javier Pepe
Hi

You can fill the record before SQLFORM

def marks_entry():
stu=db.student(request.args(0))

*db.marks.students.default = stu.id *
form=SQLFORM(db.marks)
return locals();

2017-10-22 8:59 GMT-03:00 mostwanted :

> Hi guys, i need help, I'm creating a simple results management system for
> a school and I've hit a stumbling block, what i wanna do is be able to open
> a form to make detail entries of a specific individual and this is how i
> want to do it, i wanna click on the specific individual's name and have
> that form open up with the name of that person pre-selected so i don't have
> to go through a large list of too many students looking for one student &
> have other fields empty and all i have to do is fill up those fields,
> fields like marks for the subjects. PLEASE HELP, I'M REALLY STUCK!
>
> My application is straight forward and to the point and so is its code:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *MODELSdb.define_table('student_class',Field('class_name',
> requires=IS_NOT_EMPTY()),Field('teacher', 'reference
> teacher'),
> format='%(class_name)s')db.define_table('student',
> Field('surname', requires=IS_NOT_EMPTY()),Field('name',
> requires=IS_NOT_EMPTY()),Field('photo', 'upload',
> requires=IS_NOT_EMPTY()),Field('class_name', 'reference
> student_class'),Field('dob', 'date',
> requires=IS_NOT_EMPTY()),
> format='%(surname)s')db.define_table('subject',
> Field('subject_name', requires=IS_NOT_EMPTY()),
> format='%(subject_name)s')#I WANT THIS TABLE TO BE OPEN WHEN I CLICK ON A
> NAME BUT WITH THAT NAME AND PRE-SELECTED WITH ONLY SOME FIELDS LEFT EMPTY
> SO I DONT #HAVE TO GO THROUGH A LIST OF 100 LOOKING FOR ONE
> STUDENT.db.define_table('marks',Field('student', 'reference
> student'),Field('subject', 'reference
> subject'),Field('term',
> requires=IS_NOT_EMPTY()),Field('marks', 'integer',
> requires=IS_NOT_EMPTY()),Field('total', 'integer',
> requires=IS_NOT_EMPTY()),
> Field('comments',type='text',requires=IS_NOT_EMPTY()),
> )CONTROLLERdef student_class():
> classes=db.student_class(request.args(0))
> student=db(db.student.class_name==classes.id
> ).select(orderby=db.student.surname)
> head=db(db.letter_head).select(db.letter_head.ALL)return
> locals()VIEWCLASS:
> {{=classes.class_name}} style="margin-left: 15px;">SURNAMES (A-E){{letters=['A', 'B',
> 'C', 'D', 'E', 'F']for stu in student:if stu.surname[0] in
> letters:stu.surname}}{{=A('Report', _href=URL('genrate_report',
> args=stu.id ))}} |  class="name">{{=stu.surname}} | {{=A('Marks',
> _href=URL('marks_entry', args=stu.id ))}} />{{pass}}{{pass}}CONTROLLER*
>
>
>
>
>
>
>
>
>
> *#I DO NOT KNOW WHAT TO ENTER IN THE BELOW FUNCTION TO MAKE IT DO WHAT I
> WANT IT TO DOdef marks_entry():form=SQLFORM(db.marks)return
> locals();VIEW{{extend 'layout.html'}}{{=form}}*
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: how to create pdf report in web2py???

2017-08-29 Thread Javier Pepe
Alex

The tool is very good, you have a user list for question, i am to try the
designer and not found howto save this.

Thanks

2017-08-26 10:19 GMT-03:00 Alex :

> We created a report tool since creating pdf reports in a web application
> is a common problem and none of the existing solutions were optimal for us.
> We needed something that is easy to integrate, easy to use (to design the
> reports) and easy to maintain (e.g. to create new versions of an existing
> report template).
>
> https://www.reportbro.com
>
> The designer to create report templates is a javascript plugin which can
> easily be integrated in a web application. Server-side we developed a
> python package - which you can either download or install via pip - to
> create the pdf (or xlsx) file with a given report template and data.
> Because it's python it is easy to use in an existing web2py app.
>
> We appreciate any kind of feedback!
>
> Alex
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] SQLFORM.GRID Change Header and labels too?

2017-04-07 Thread Javier Pepe
Hi

You can use de label atribute in Field definition, this used in all forms.


   - label is a string (or a helper or something that can be serialized to
   a string) that contains the label to be used for this field in
   auto-generated forms.

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor


2017-04-07 13:38 GMT-03:00 r :

> So I have changed the header for my sqlform grid:
>
> grid = SQLFORM.grid(db.adminis,headers={'adminis.Name':'Name'
> ,'adminis.Description':'Description','adminis.Rating':'Average Rating'})
>
> and when I click on view/edit I would like the same labels to be used. How
> is it possible ?
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Grid

2017-01-24 Thread Javier Pepe
Hi

You can use selectable metod to pass selected row to a function to update
records.



El sáb., 21 ene. 2017 a las 12:05, Bishal Saha ()
escribió:

> Cant we use grid to update few rows ?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How to define tables in a new model file

2016-05-11 Thread Javier Pepe
Hi

Web2py load files in alphabet orden.  You need rename files for load in
correct order.
For example:
Db.py as 00_db.py
Data.py as 01_data.py

El dom., 8 de mayo de 2016 10:48, Simon Carr 
escribió:

> I created a new model and called it data.py
>
> I created a definition for a table
>
> db.define_table('suppliers',
> Field('company_name','string'),
> Field('address1','string'),
> Field('address2','string'),
> Field('town','string'),
> Field('county','string'),
> Field('country','string'),
> Field('postcode','string'),
> Field('telephone','string'))
>
> But I get the error that db is not defined.
>
> I thought db was already defined by db.py
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Changing color of field

2016-04-21 Thread Javier Pepe
Hello

If you use bootstrap, can change the class of field

http://getbootstrap.com/css/#helper-classes-backgrounds



On Thu, Apr 21, 2016 at 9:39 AM, Md Anam Raihan 
wrote:

> I am creating task management app and i want to change color of field if
> deadline is completed then how to do it using javascript also i am facing
> problem in extracting datetime from my field??
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Using tinymce for text areas of in component views

2016-02-17 Thread Javier Pepe
Hello

This work for me:

Controller:
def textarea():
form=FORM('Texto:',
  TEXTAREA(_name='texto',
requires=IS_NOT_EMPTY(),_id='mytextarea'),
  INPUT(_type='submit'))
return locals()

View:


  
  tinymce.init({
selector: '#mytextarea'
  });
  
{{extend 'layout.html'}}
{{=form}}
~

On Wed, Feb 17, 2016 at 10:05 AM, PRACHI VAKHARIA 
wrote:

>
>
>- Can you please post your codes for making TinyMCE work with web2py
>Components?
>- It will allow to get a better understanding of how you applied it
>within web2py Components.
>
> Thanks!
>
> *— PRACHI*
>
>
>
>
> On Saturday, 6 November 2010 01:29:25 UTC-4, Luther Goh Lu Feng wrote:
>>
>> I am putting this link here
>> http://tinymce.moxiecode.com/punbb/viewtopic.php?id=28
>> as this is the solution to problematic form submissions.
>>
>> tinyMCE.triggerSave() might need to be called if you are using ajax or
>> components for your form submission. Hope this will be useful to
>> someone who searches the group.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] charts on web2py

2016-01-20 Thread Javier Pepe
Hi

For simple charts you can use google chart, exist plugin for integrate this

http://www.web2pyslices.com/slice/show/1721/google-charts-plugin



On Wed, Jan 20, 2016 at 3:09 PM, Richard Vézina  wrote:

> Do you know that plotly was open sourced : https://plot.ly/
>
> I it one of your best choice if you want something dynamic... There is
> D3.js, but I remember having read that most of it is included in the plotly
> stack...
>
> Richard
>
> On Wed, Jan 20, 2016 at 11:04 AM, Diego Tostes 
> wrote:
>
>> Hi,
>>
>> anyone can indicate a good solution to create charts using web2py?
>>
>> rgds
>>
>> diego
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Showing menu only after successful login

2015-02-10 Thread Javier Pepe
Also you can try to verify the model (menu.py) that the user is logged before
loading the array with the options menu
if auth.is_logged_in ():
 response.menu = [options ]
else:
 response.menu = []

On Tue, Feb 10, 2015 at 5:26 PM, Richard Vézina  wrote:

> You can create a layout_login.html and remove what you want...
>
> In views/default/user.html replace layout.html by your layout_login.html
>
> That it!
>
> Richard
>
> On Tue, Feb 10, 2015 at 9:13 AM, Simon Marshall 
> wrote:
>
>>
>> Hi All,
>>
>> is there a way to hide the top menu until a person has logged in, i have
>> a requirement that present a user just with a login page before the can do
>> anything on the site.
>>
>> Any suggestion or pointer would be grateful.
>>
>> Thanks
>>
>> Simon
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] grid problem

2014-07-29 Thread Javier Pepe
form = SQLFORM.grid(db.t_proposte,
   searchable=True,
  deletable=True,
   details=False,
*   selectable**=True,** <- must be a function*
   csv=True,
  user_signature=False)  # change to True in production


On Tue, Jul 29, 2014 at 12:05 PM, ceriox  wrote:

> hi all,
> i have a table with some fields (two of the type boolean)
>
> if i use
> form = SQLFORM.smartgrid(db.t_proposte,onupdate=auth.archive)
>
>
> all work fine!
>
> but if i use:
> form = SQLFORM.grid(db.t_proposte,
>searchable=True,
>   deletable=True,
>details=False,
>selectable=True,
>csv=True,
>   user_signature=False)  # change to True in
> production
>
>
> i have the error:
>  'bool' object is not iterable
> i'm doing something wrong?
> (i don't have any type of requires on the fields)
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] how to turn off the record counter on Sqlform.grid

2014-06-26 Thread Javier Pepe
I'm use this code:

form = SQLFORM.grid()
form.element('.web2py_counter',replace=None)


On Thu, Jun 26, 2014 at 2:04 AM, JorgeH  wrote:

> hello
> Is it possible to turn off the record counter , on the top right of the
> table generated by sqlform.frid ??
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Cron job every 30 seconds

2013-11-28 Thread Javier Pepe
You can add cron job which sleep

* * * * * sleep  0;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 10;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 20;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 30;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 40;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 50;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py

This process run every ten seconds.





On Wed, Nov 27, 2013 at 11:20 PM, Brian M  wrote:

> web2py's scheduler will let you set the repeat period in seconds so you
> could probably do 30 seconds that way.
>
> On Tuesday, November 26, 2013 2:55:16 PM UTC-6, melmg wrote:
>>
>> Is is possible to set up a cron job to run every 30 seconds instead of a
>> minute? I have a function that does an HTTP GET request to retrieve some
>> values from another server (a small server running on a microcontroller)
>> and then saves those values in the database. I want to run this function
>> every 30 seconds in the background.
>>
>> Thank you for the help!
>>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: simple button in grid question

2013-09-16 Thread Javier Pepe
You need pass a list of dict

links = [{'header':'', 'body': lambda row:
A('',_title='Procesar',_class='icon-refresh',_href=URL(c='planilla',
  {'header':'', 'body': lambda row:
A('',_title='Mail',_class='icon-envelope',_href='index/pedircontadores/%
  {'header':'', 'body': lambda row:
A('',_title='Estado',_class='icon-ok',callback=URL(c='planilla',f='estad
  {'header':'', 'body': lambda row:
A('',_title='Control',_class='icon-check',_href=URL(c='planilla',f='pdf/
  {'header':'', 'body': lambda row: A('',_title='Control
2',_class='icon-check',_href=URL(c='planilla',f='co
  {'header':'', 'body': lambda row:
A('',_title='PDF',_class='icon-print',_href=URL(f='pdf/%s/%s' % (row.id,
  {'header':'', 'body': lambda row: A('',_title='PDF
distribuidor',_class='icon-print',_href=URL(f='pdf/%s/%
  {'header':'', 'body': lambda row:
A('',_title='Detalle',_class='icon-list',_href=URL(c='detalle',f='index'
  ]



On Sun, Sep 15, 2013 at 9:31 PM, Alex Glaros  wrote:

> What is syntax for TWO or more  buttons? I've tried several variations.
> Would it be two "dict" phrases, or two header phrases separated by commas?
>
> One button will call one function, and the other would call a different
> function.
>
> thanks,
>
> Alex
>
>
> On Saturday, September 14, 2013 6:56:24 PM UTC-7, Alex Glaros wrote:
>>
>> Works perfect Adi and Villas,
>>
>> much appreciated.
>>
>> Here's the complete code:
>>
>> def view_all_suggestions_and_**comments():
>> query = (db.IdeaComment.ideaID==db.**Idea.id ) &
>> (db.IdeaComment.partyID==db.**Party.id )
>>grid = SQLFORM.grid(query, ,links = [dict(header='Virtual Field',
>>  body=lambda row: A('Add a comment!',_class="btn btn-mini",
>> _href=URL('comment_on_a_**suggestion', vars=dict(filter=row.Idea.id))**
>> ))])
>> return dict(grid = grid)
>>
>> Alex
>>
>>
>> On Saturday, September 14, 2013 6:01:33 PM UTC-7, Adi wrote:
>>>
>>> lambda row: A('Complete',
>>> _class='btn', _id='btn_complete',
>>> _onclick='return confirm("Complete
>>> Order %s? (%s %s)")' % (row.id,
>>>
>>>row.shipFirstName,
>>>
>>>row.shipLastName),
>>> _href=URL(r=request,f='**
>>> complete_order',args=[row.id])**,
>>>
>>>
>>>
>>>
>>> On Saturday, September 14, 2013 7:41:24 PM UTC-4, Alex Glaros wrote:

 it works correctly Villas, thanks.

 how could I turn "Add a comment!" text into a button.  Possible syntax
 ",_class="btn btn-mini"", but where does it go?

 thanks,

 Alex

 On Saturday, September 14, 2013 10:23:00 AM UTC-7, villas wrote:
>
> Maybe this would work using row.idea.id like this...
>
> grid = SQLFORM.grid(query,
> links = [dict(header='Virtual Field',
> body=lambda row: A('Add a comment!', _href=URL('comment_on_a_**
> suggestion', vars=dict(filter=row.idea.id ))**)
> )]
> )
>
>
> You can also now include "virtual fields" in grids,  but I haven't
> needed to try that yet.
>
>
>
> On Saturday, 14 September 2013 15:23:49 UTC+1, Alex Glaros wrote:
>>
>> thanks Villas but I receive this error: Row' object has no attribute
>> 'id'
>>
>> perhaps it doesn't know which of the joined "id"s to reference
>>
>> this work-around works because it let's system know which id it is:
>>   db.Idea.id.represent = lambda id, r: A('Add a comment!',
>> _href=URL('comment_on_a_sugges**tion', vars=dict(filter=id)))
>>
>> Alex
>>
>> On Saturday, September 14, 2013 4:56:33 AM UTC-7, villas wrote:
>>>
>>> Try this...
>>>
>>> grid = SQLFORM.grid(query,
>>>   **   links = [dict(header='Virtual
>>> Field',
>>>   ** body=lambda
>>> row: A('Add a comment!', _href=URL('comment_on_a_**suggestion',
>>> vars=dict(filter=row.id)))
>>>   **  )]
>>>   **  )
>>>
>>>
>>> On Friday, 13 September 2013 21:57:28 UTC+1, Alex Glaros wrote:

 I tried this but got "lambda requires 2 args, 1 given" error, plus
 need to be able to pass Idea.id parm to the button.  How to do that?

 grid = SQLFORM.grid(query,links = [dict(header='Virtual
 Field',body=lambda id, r: A('Add a comment!', _href=URL('comment_on_a_
 **suggestion', vars=dict(filter=id])

 On Friday, September 13, 2013 1:33:35 PM UTC-7, villas wrote:
>
> Hope this helps...
>
> From the book:
>
> links is used to display new columns which can be links to other
> pages. The links argument must 

Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
Now work

The update from admin interface not end correctly.

Unzip file over actual folder, restart and work!!!





On Fri, Sep 13, 2013 at 8:49 AM, Javier Pepe  wrote:

> I'm try to use new version, but missing settings.cfg file.
>
> In that directory has to put it and what format must have?
>
> Thansk
>
>
> On Fri, Sep 13, 2013 at 8:40 AM, Javier Pepe  wrote:
>
>> +1
>>
>>
>> On Fri, Sep 13, 2013 at 5:56 AM, Tim Richardson 
>> wrote:
>>
>>> I've been using it for about a month on one Windows production site with
>>> ms-sqlserver, and it's a great release. So many improvements and even more
>>> fun to use. 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/groups/opt_out.
>>>
>>
>>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
I'm try to use new version, but missing settings.cfg file.

In that directory has to put it and what format must have?

Thansk


On Fri, Sep 13, 2013 at 8:40 AM, Javier Pepe  wrote:

> +1
>
>
> On Fri, Sep 13, 2013 at 5:56 AM, Tim Richardson wrote:
>
>> I've been using it for about a month on one Windows production site with
>> ms-sqlserver, and it's a great release. So many improvements and even more
>> fun to use. 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
+1


On Fri, Sep 13, 2013 at 5:56 AM, Tim Richardson wrote:

> I've been using it for about a month on one Windows production site with
> ms-sqlserver, and it's a great release. So many improvements and even more
> fun to use. 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Load every 5 seconds

2013-08-30 Thread Javier Pepe
Thanks

works better than expected


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

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

-- 

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


[web2py] Load every 5 seconds

2013-08-30 Thread Javier Pepe
Hi

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

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

Thanks

-- 

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


Re: [web2py] Any way of removing the text from Grid buttons?

2013-08-29 Thread Javier Pepe
Is simple

SQLFORM.grid(query,showbuttontext=False)


On Wed, Aug 28, 2013 at 8:19 PM, greenpoise  wrote:

> is there a way to remove the text from grid buttons? I mean the stock ones
> (View, Edit, Delete)
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 

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


Re: [web2py] Re: Change form layout

2013-06-24 Thread Javier Pepe
You can try whith:

http://dev.s-cubism.com/plugin_solidform


On Mon, Jun 24, 2013 at 12:02 PM, Tom Russell  wrote:

> Ah, I see now.
>
> Thanks
>
>
> On Mon, Jun 24, 2013 at 10:50 AM, Anthony  wrote:
>
>> No, 3 columns means:
>>
>> Col 1   Col 2 Col 3
>> label   widget   comment
>>
>> It's still one field per row. When in doubt, try it out. :-)
>>
>> Anthony
>>
>>
>> On Monday, June 24, 2013 10:26:08 AM UTC-4, Tom Russell wrote:
>>
>>> Thanks again for the info.
>>>
>>> I guess I still do not get it though if I set my formstyle to table3cols
>>> would'nt my form at least be laid out like:
>>>
>>> Name Address City
>>> State
>>>
>>> Or am I not looking at this correctly?
>>>
>>>
>>> On Mon, Jun 24, 2013 at 10:16 AM, Anthony  wrote:
>>>
 Your best bet is to look at how the built-in ones work, starting here:
 https://code.google.com/**p/web2py/source/browse/gluon/**sqlhtml.py#752.
 Copy the one of those that is closest to what you want and modify it as
 necessary.

 def myformstyle():
 [custom code here]

 form = SQLFORM(..., formstyle=myformstyle)

 Anthony


 On Monday, June 24, 2013 10:07:49 AM UTC-4, Tom Russell wrote:

> Thanks for the responses.
>
> The formstyle looks interesting but I cannot make heads or tails out
> of the way to use it. Are there any examples of this some place?
>
> Thanks
>
>
> On Mon, Jun 24, 2013 at 9:55 AM, Anthony  wrote:
>
>> I assume that means you are relying on a generic view to display your
>> table. If so, you can instead create a non-generic view (which you should
>> probably do anyway), or you can build the form DOM on the server using
>> web2py HTML helpers (probably not the way to go). The custom formstyle
>> option also does not require any HTML coding.
>>
>> Anthony
>>
>>
>> On Monday, June 24, 2013 9:35:31 AM UTC-4, Tom Russell wrote:
>>
>>> Thanks for the response. So now I am really confused because I have
>>> no idea where to put this code if I am using a SQLFORM.factory?
>>>
>>> Basically I just want to add row fluid to make the layout a little
>>> easier to navigate. I do not have a html file to set this code in for 
>>> this
>>> form.
>>>
>>> Thanks.
>>>
>>>
>>> On Mon, Jun 24, 2013 at 9:04 AM, Anthony  wrote:
>>>
 http://web2py.com/books/**default/chapter/29/07#Custom-**forms

 I don't think it's in the book yet, but you can also create a
 custom formstyle if you need to use the layout in multiple places:
 https://groups.google.**com/d/msg/web2py/QmoRmapiOwA/**t
 ZqeEbii6QgJ

 Anthony


 On Monday, June 24, 2013 8:53:16 AM UTC-4, Tom Russell wrote:
>
> I have a SQLForm and use the formset DIV for it but its not what I
> really want. Rather than having just one column with all of the fields
> required to be filled out, how do I set it so its like 3-4 columns?
>
> For example:
>
> Name  Address  City  State
>
> Instead of:
>
> Name
> Address
> City
> State
>
> Thanks.
>
  --

 ---
 You received this message because you are subscribed to the Google
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to web2py+un...@**googlegroups.com.

 For more options, visit https://groups.google.com/**grou
 ps/opt_out .



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

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



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

Re: [web2py] SQLFROM.GRID SELECTEBLE

2013-05-10 Thread Javier Pepe
Hi

you have to use

selectable = lambda ids: function(ids)

def function(ids):
...
...
...


On Fri, May 10, 2013 at 9:14 AM, Pawan Jha wrote:

> Hi I am new developer with Web2py so getting problem to work on so please
> help
>
>
> I'm using "selectable=True" in the sqlform.grid. This shows a checkbox in
> first column for all the rows "except the header" and Submit Button
>
> i want to get all the Selected check box id on clicking on submit button
> 
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




Re: [web2py] REF: Pie/bar Charts

2013-04-04 Thread Javier Pepe
Hello

I am use http://pygooglechart.slowchop.com/

Is very simple, create a file, a use then in the view.




On Thu, Apr 4, 2013 at 10:37 AM, Teddy Nyambe wrote:

> whats the easiest way to create a pie/bar chart using web2py/python, i was
> attempting to use pycha with cairo/pycairo libraries with very little
> success, failed to install pycairo on the mac all the googled exmaples not
> working.
>
> Any ideas?
>
> --
>
> ...
> Teddy Lubasi Nyambe
> Opensource Zambia
> Lusaka, ZAMBIA
>
> Cell: +260 97 7760473
> website: http://www.opensource.org.zm
>
> ~/
> Human Knowledge belongs to the world! - AntiTrust
>
> Man is a tool-using animal. Without tools he is nothing, with tools he is
> all - Thomas Carlyle 1795-1881
>
> /~
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




Re: [web2py] Re: Help with query

2013-03-05 Thread Pepe Araya
Hi Derek and Anthony,

that's make the trick!!

Thank you both!!

*Pepe Araya*
Diseñador / Designer



On Tue, Mar 5, 2013 at 4:18 PM, Derek  wrote:

> You can negate a part of a query by using a tilde (~).
>
>
> On Tuesday, March 5, 2013 10:30:50 AM UTC-7, Pepe Araya wrote:
>>
>> Hi!
>>
>> In words what i need is to get a set from this query: select the
>> 'persons.email' and 'persons.id' from table 'persons' *that are not in*table 
>> '
>> invitations.to'
>>
>> my tables:
>>
>> db.define_table('persons',
>>  Field('name'),
>>  Field('email'))
>>
>> db.define_table('invitations',
>>  Field('from',db.persons),
>>  Field('to',db.persons))
>>
>>
>> Any help is welcome.
>>
>> Thank you very much.
>>
>>  --
>
> ---
> 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/OOFjQug73q0/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




[web2py] Help with query

2013-03-05 Thread Pepe Araya
Hi!

In words what i need is to get a set from this query: select the 
'persons.email' and 'persons.id' from table 'persons' *that are not in*table 
'invitations.to'

my tables:

db.define_table('persons',
 Field('name'),
 Field('email'))

db.define_table('invitations',
 Field('from',db.persons),
 Field('to',db.persons))


Any help is welcome.

Thank you very much.

-- 

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




Re: [web2py] Smartgrid: How to make value from foreign table appear in table when only foreign key is in table

2013-02-22 Thread Javier Pepe
Alex

Use represent for this:

http://web2py.com/books/default/chapter/29/06#Record-representation

Ej:

db.Word.dictionaryTipeID.represent = lambda id,row: db.DictionaryType
(id).dictionaryName




On Thu, Feb 21, 2013 at 10:35 PM, Alex Glaros  wrote:

> Instead of *db.Word.dictionaryTypeID* displaying (which is a foreign key
> in db.Word), I’d like a value from the foreign table to appear, i.e.,
> DictionaryType. dictionaryName.
>
>
> In the example below, when user cascades down to the Word table, it only
> shows db.Word.dictionaryTypeID but I’d like to add the corresponding
> DictionaryType. dictionaryName value to it.
>
>
> def search_lang():
>
>grid = SQLFORM.smartgrid(db.HumanLanguage,
> linked_tables=['Word','DictionaryType'], fields = [db.HumanLanguage.id,
> db.HumanLanguage.languageName, db.Word.id, db.Word.wordName,
> db.Word.definition, db.DictionaryType.dictionaryName,
>
>*db.Word.dictionaryTypeID*],
>
>user_signature=False)
>
>return dict(grid=grid)
>
>
> id
>   
> Wordname
>   
> Definition
>   
> Dictionarytypeid
> 1 beakerglass jar 1
>
>
> Want to replace the "1" under Dictionarytypeid with value from foreign
> table.
>
> Thanks,
>
> Alex Glaros
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




Re: [web2py] SQLFORM.grid and the maxtextlength parameter: The parameter doesnt work in my code

2013-01-18 Thread Javier Pepe
Hello

maxtextlength is for all fields, you need use maxtextlengths

http://web2py.com/book/default/chapter/07#SQLFORM.grid-and-SQLFORM.smartgrid


On Fri, Jan 18, 2013 at 9:40 AM, Sverre  wrote:

> I have the controller:
>
> def commodities():
> tbl = db.commodities
> fields = [tbl.itemcode,tbl.name,tbl.unit,tbl.supplier,tbl.contact]
> query = (tbl.id>0)
> order = [tbl.itemcode]
> maxlen = {'commodities.itemcode':2,'commodities.name
> ':2,'commodities.unit':2,'commodities.supplier':2,'commodities.contact':2}
> return dict(grid=SQLFORM.grid(query,fields=fields, csv=False,
> orderby=order,maxtextlength=maxlen))
>
>
> The grid is working well, but not the maxtextlength parameter. If I set
> the parameter to 2, it's working but not when I'm setting all field
> individually. Has someone an idea?
>
>
>
>
>  --
>
>
>
>

-- 





Re: [web2py] Smartgrid orderby field , descending

2013-01-09 Thread Javier Pepe
Use this:

orderby=~db.table.date


On Wed, Jan 9, 2013 at 7:08 AM, António Ramos  wrote:

> hello, how do i order a smartgrid based on a field in descending order?
> for example the auth event table on date descending
>
> thank you
>
> --
>
>
>
>

-- 





Re: [web2py] Re: Need to save a multipage PDF

2012-11-21 Thread Javier Pepe
Try this:

def taggen_print():
*pdf = FPDF()*
rows = db(db.bike_no.id > 0).select()
for row in rows:
   tag_no = row.bike_typ+str(row.id)
   pfile = tag_no+'_p.pdf'
   pdf.add_page()
   pdf.set_font('Arial', 'B', 14)
   pdf.cell(40,10,tag_no)
*   pdf.AddPage()*
*pdf.output(name=request.folder + '/static/temp.pdf')*
response.headers['Content-Disposition']='attachment.filename =' + pfile
response.headers['Content-Type']='application/pdf'
return response.stream(open(request.folder+'/static/temp.pdf',
'rb'),chunk_size=4096)
#  pdf.output(pfile, 'F')
redirect(URL("index"))


On Wed, Nov 21, 2012 at 5:18 AM, LightDot  wrote:

> This group is a wealth of information for other users, so when you can,
> please do post what is it that you've figured out. :)
>
> It's highly likely someone will have the same or similar problem and
> search for answers.
>
> Regards,
> Ales
>
>
> On Wednesday, November 21, 2012 6:36:04 AM UTC+1, Paul Rykiel wrote:
>>
>> Nevermind ... figured it out
>> On Tuesday, November 20, 2012 3:06:22 PM UTC-6, Paul Rykiel wrote:
>>>
>>> Greetings everyone,
>>>
>>> this is my code and I am having difficulity creating a "Multipage" PDF
>>> to save to a directory.
>>> any assistance will be welcomed.
>>>
>>> Regards,
>>>
>>> def taggen_print():
>>> rows = db(db.bike_no.id > 0).select()
>>> for row in rows:
>>>tag_no = row.bike_typ+str(row.id)
>>>pfile = tag_no+'_p.pdf'
>>>pdf = FPDF()
>>>pdf.add_page()
>>>pdf.set_font('Arial', 'B', 14)
>>>pdf.cell(40,10,tag_no)
>>>pdf.output(name=request.folder + '/static/temp.pdf')
>>> response.headers['Content-**Disposition']='attachment.**filename ='
>>> + pfile
>>> response.headers['Content-**Type']='application/pdf'
>>> return response.stream(open(request.**folder+'/static/temp.pdf',
>>> 'rb'),chunk_size=4096)
>>> #  pdf.output(pfile, 'F')
>>> redirect(URL("index"))
>>>
>>> right now it only saves the PDF for the last record... I need it to
>>> create a page for each record and save it in PDF format in the directory
>>>
>>  --
>
>
>
>

-- 





Re: [web2py] SQLFORM.grid dinamically update fields

2012-10-03 Thread Javier Pepe
chech this

http://web2py.com/books/default/chapter/29/07?search=onupdate

may help.





On Wed, Oct 3, 2012 at 9:49 PM, alex  wrote:

>
> I have a SQLFORM.grid.
> When the user updates field 'a' in the grid, before submitting the form,
> field 'b' should represent a calculation based on value of 'a'.
> For instance b=a+1
>
> db.py
> db.define_table('t',
> Field('a', type='integer'),
> Field('b', type='integer')
> )
>
> default.py
> def index():
> grid = SQLFORM.smartgrid(db.t)
> return locals()
>
> index.html
> {{extend 'layout.html'}}
> {{=grid}}
>
> Someone can help?
>
> --
>
>
>
>

-- 





Re: [web2py] Re: Calculated field in SQLFORM.grid

2012-10-01 Thread Javier Pepe
Hello

You can create a function to represent in link

links =  [{'header':'Contador', 'body': lambda row: count_b(row.id) }]


def count_b(a.id):
c = db(db.B.ref_a == id).count()
if c:
count = c
else:
count = 0
return count

On Sun, Sep 30, 2012 at 9:26 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> This is currently not possible unless you denormalize and store the count
> in a column of A.
>
>
> On Saturday, 29 September 2012 23:01:22 UTC-5, alex wrote:
>>
>>
>> I have a relation  [1:n] from table A to table B.
>>
>> define_table('A',
>>  Field('name', type='string'))
>>
>> define_table('B',
>>  Field('ref_a', type='reference A'))
>>
>>
>>
>> Then I have this grid
>>
>> qry = db.A.id>0
>> grid = SQLFORM.grid(qry,links=links)
>>
>> How do I write links (and the lambda function in it) in order to have in
>> the grid an additional column with the count of references to A
>> (db.B.ref_a.count()) ?
>>
>  --
>
>
>
>

-- 





[web2py] Re: HTML truncate

2012-09-12 Thread Pepe Araya
Thanks you both!

One more help request: I have a "represent" related question in this 
topic https://groups.google.com/d/topic/web2py/9R9iQT_BVyU/discussion

please, can you help me to understand what I'm doing wrong? 

On Tuesday, September 11, 2012 11:33:18 AM UTC-3, Massimo Di Pierro wrote:
>
> {{=db.publicaciones.descripcion.represent(tipo_3.descripcion,tipo_3}}
>
> I do not think you want the extra =.
>
> On Tuesday, 11 September 2012 08:47:00 UTC-5, villas wrote:
>>
>> I end up doing something like this:
>>
>> {{=db.publicaciones.descripcion.represent(=tipo_3.descripcion,tipo_3)}}
>>
>> I hope that helps,  but maybe there is a better way?
>>
>>
>>
>> On Tuesday, September 11, 2012 1:48:59 PM UTC+1, Pepe Araya wrote:
>>>
>>> Hi Massimo,
>>>
>>> Sorry for my poor explanation.
>>>
>>> What I don't get is in the view when i call the field value 
>>> {{=tipo_3.descripcion}}  I get the whole text and not the truncated one 
>>> like in the SQLFORM.grid case.
>>>
>>>
>>>
>>>
>>> On Tuesday, September 11, 2012 9:32:18 AM UTC-3, Massimo Di Pierro wrote:
>>>>
>>>> What does it mean it does not work? Can you import it? Can you import 
>>>> it from python?
>>>>
>>>> On Tuesday, 11 September 2012 00:55:03 UTC-5, Pepe Araya wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I need to truncate a field that contains HTML content. 
>>>>>
>>>>> Now i'm using htmltruncate<https://github.com/eentzel/htmltruncate.py> in 
>>>>> a controller that return a SQLFORM.smartgrid and it works perfect:
>>>>>  
>>>>> def noticias():
>>>>> 
>>>>> db.noticias.cuerpo.represent = lambda field,row: 
>>>>> XML(htmltruncate.truncate(field, 100))
>>>>> grid = SQLFORM.smartgrid(db.noticias, 
>>>>> linked_tables=['adjuntos_noticia'])
>>>>>
>>>>> return dict(grid =grid)
>>>>>
>>>>>
>>>>> But when I try to implement a in a controller in this way:
>>>>>
>>>>> def index():
>>>>> db.publicaciones.descripcion.represent = lambda field, row: 
>>>>> XML(htmltruncate.truncate(field, 10))
>>>>> tipo_3 = db(db.publicaciones.tipo == 3).select().last()
>>>>>
>>>>> return dict(tipo_3 = tipo_3)
>>>>>
>>>>>
>>>>> It doesn't work
>>>>>
>>>>>
>>>>> The module is inside the "modules" folder of the app and it's imported 
>>>>> via:
>>>>> import htmltruncate
>>>>>
>>>>>
>>>>> any help is welcome!
>>>>>
>>>>> Best!
>>>>>
>>>>

-- 





[web2py] Re: denormalizing a list:reference -- need a bit of help

2012-09-12 Thread Pepe Araya
Thanks you!

On Wednesday, September 12, 2012 6:51:56 AM UTC-3, Niphlod wrote:
>
> no, it wont.
> users is a "list" of users.
> you need to fetch the "list of entities" separately for every "item" of 
> the "list of the users".
>
> Il giorno mercoledì 12 settembre 2012 11:46:32 UTC+2, Pepe Araya ha 
> scritto:
>>
>> Thanks very much! it works!
>>
>> if I have the user query in the controller like this:
>>
>> def user_list():
>>  users = db(db.auth_user).select()
>>  entities =  db(db.entity.id.belongs(user.entity)).select(db.entity.name)
>>  return dict(users = users, entities = entities )
>>
>> will work?
>>
>> ---
>>
>> Another related question is: why this don't work?
>> entities = db.auth_user.entity.represent(user.entity)
>>
>> on the book appears as the way to get the work done, but it doesn't 
>>
>>
>> On Wednesday, September 12, 2012 6:32:44 AM UTC-3, Niphlod wrote:
>>>
>>> more or less
>>>
>>> {{for user in db(db.auth_user).select():}}
>>>  Name : {{=user.name}}
>>>  {{entities = db(db.entity.id.belongs(user.entity)).select(db.entity
>>> .name)}}
>>>  Entities : {{', '.join(ent.name for ent in entities)}}
>>> {{pass}}
>>> --
>>>
>>> of course you should probably fetch the result in the controller and 
>>> show only them in the view.
>>>
>>> BTW: this is pretty simple and standard for web2py. If you were asking 
>>> for something else please post more details...
>>>
>>> Il giorno mercoledì 12 settembre 2012 11:10:33 UTC+2, Pepe Araya ha 
>>> scritto:
>>>>
>>>> Hi,
>>>> a question: how do you display the entities related to a user in a View 
>>>> which displays a list of users with their related entities??
>>>>
>>>> for example:
>>>>
>>>> Name: user 1
>>>> Entities: one, two
>>>>
>>>> --
>>>>
>>>> Name: user 2
>>>> Entities: one
>>>>
>>>> --
>>>> ...
>>>>
>>>> Thanks.
>>>>
>>>> On Friday, May 11, 2012 12:16:32 PM UTC-4, Niphlod wrote:
>>>>>
>>>>> If you need to fetch all entities knowing the user in advance there is 
>>>>> a ultra-simple way to fetch entities in a single query
>>>>> Actually I don't think anyone will come up with a solution involving 
>>>>> more than 1 additional query to the one required for "selecting" the user.
>>>>>
>>>>> user = db.auth_user(auth.user_id)
>>>>> entities = db(db.entity.id.belongs(user.entity)).select(db.entity.name) 
>>>>>
>>>>>
>>>>> Mind that the auth_user line is copied into session, so if that is 
>>>>> always available you can skip the first query and do
>>>>>
>>>>> entities = db(db.entity.id.belongs(auth.user.entity)).select(
>>>>> db.entity.name)
>>>>>
>>>>>
>>>>>
>>>>> Il giorno venerdì 11 maggio 2012 17:28:38 UTC+2, weheh ha scritto:
>>>>>>
>>>>>> db.define_table('entity', Field('name'), format='%(name)s')
>>>>>> auth_user_table = db.define_table(
>>>>>> auth.settings.table_user_name,
>>>>>> ... 
>>>>>> Field('entity', 'list:reference db.entity',
>>>>>>requires=IS_IN_DB(db, 'entity.id','%(name)s', multiple=
>>>>>> True),
>>>>>>...
>>>>>> )
>>>>>>
>>>>>> Later, I want to get a list of entities by name from the list: 
>>>>>> reference entry for the current user.
>>>>>>
>>>>>> I would think I could do this:
>>>>>> user = db(db.auth_user.id == auth.user_id).select().first()
>>>>>> entities = db.auth_user.entity.represent(user.entity)
>>>>>> but I get a ticket:
>>>>>>   File "N:/web2py/applications/myapp/controllers/mycontroller.py",line 
>>>>>> 15, in myfunc
>>>>>> return dict(etext=db.auth_user.entity.represent(user.entity))
>>>>>> TypeError: 'NoneType' object is not callable
>>>>>>
>>>>>>
>>>>>> I've tried a few different variations on the theme, but none working 
>>>>>> so far. Any help would be appreciated.
>>>>>>
>>>>>> There are obvious slower ways to do this, but inelegant. I want the 
>>>>>> fastest, tightest solution.
>>>>>>
>>>>>>
>>>>>>

-- 





[web2py] Re: denormalizing a list:reference -- need a bit of help

2012-09-12 Thread Pepe Araya
Thanks very much! it works!

if I have the user query in the controller like this:

def user_list():
 users = db(db.auth_user).select()
 entities =  db(db.entity.id.belongs(user.entity)).select(db.entity.name)
 return dict(users = users, entities = entities )

will work?

---

Another related question is: why this don't work?
entities = db.auth_user.entity.represent(user.entity)

on the book appears as the way to get the work done, but it doesn't 


On Wednesday, September 12, 2012 6:32:44 AM UTC-3, Niphlod wrote:
>
> more or less
>
> {{for user in db(db.auth_user).select():}}
>  Name : {{=user.name}}
>  {{entities = db(db.entity.id.belongs(user.entity)).select(db.entity.
> name)}}
>  Entities : {{', '.join(ent.name for ent in entities)}}
> {{pass}}
> --
>
> of course you should probably fetch the result in the controller and show 
> only them in the view.
>
> BTW: this is pretty simple and standard for web2py. If you were asking for 
> something else please post more details...
>
> Il giorno mercoledì 12 settembre 2012 11:10:33 UTC+2, Pepe Araya ha 
> scritto:
>>
>> Hi,
>> a question: how do you display the entities related to a user in a View 
>> which displays a list of users with their related entities??
>>
>> for example:
>>
>> Name: user 1
>> Entities: one, two
>>
>> --
>>
>> Name: user 2
>> Entities: one
>>
>> --
>> ...
>>
>> Thanks.
>>
>> On Friday, May 11, 2012 12:16:32 PM UTC-4, Niphlod wrote:
>>>
>>> If you need to fetch all entities knowing the user in advance there is a 
>>> ultra-simple way to fetch entities in a single query
>>> Actually I don't think anyone will come up with a solution involving 
>>> more than 1 additional query to the one required for "selecting" the user.
>>>
>>> user = db.auth_user(auth.user_id)
>>> entities = db(db.entity.id.belongs(user.entity)).select(db.entity.name) 
>>>
>>> Mind that the auth_user line is copied into session, so if that is 
>>> always available you can skip the first query and do
>>>
>>> entities = db(db.entity.id.belongs(auth.user.entity)).select(
>>> db.entity.name)
>>>
>>>
>>>
>>> Il giorno venerdì 11 maggio 2012 17:28:38 UTC+2, weheh ha scritto:
>>>>
>>>> db.define_table('entity', Field('name'), format='%(name)s')
>>>> auth_user_table = db.define_table(
>>>> auth.settings.table_user_name,
>>>> ... 
>>>> Field('entity', 'list:reference db.entity',
>>>>requires=IS_IN_DB(db, 'entity.id','%(name)s', multiple=True
>>>> ),
>>>>...
>>>> )
>>>>
>>>> Later, I want to get a list of entities by name from the list: 
>>>> reference entry for the current user.
>>>>
>>>> I would think I could do this:
>>>> user = db(db.auth_user.id == auth.user_id).select().first()
>>>> entities = db.auth_user.entity.represent(user.entity)
>>>> but I get a ticket:
>>>>   File "N:/web2py/applications/myapp/controllers/mycontroller.py",line 
>>>> 15, in myfunc
>>>> return dict(etext=db.auth_user.entity.represent(user.entity))
>>>> TypeError: 'NoneType' object is not callable
>>>>
>>>>
>>>> I've tried a few different variations on the theme, but none working so 
>>>> far. Any help would be appreciated.
>>>>
>>>> There are obvious slower ways to do this, but inelegant. I want the 
>>>> fastest, tightest solution.
>>>>
>>>>
>>>>

-- 





[web2py] Re: denormalizing a list:reference -- need a bit of help

2012-09-12 Thread Pepe Araya
Hi,
a question: how do you display the entities related to a user in a View 
which displays a list of users with their related entities??

for example:

Name: user 1
Entities: one, two

--

Name: user 2
Entities: one

--
...

Thanks.

On Friday, May 11, 2012 12:16:32 PM UTC-4, Niphlod wrote:
>
> If you need to fetch all entities knowing the user in advance there is a 
> ultra-simple way to fetch entities in a single query
> Actually I don't think anyone will come up with a solution involving more 
> than 1 additional query to the one required for "selecting" the user.
>
> user = db.auth_user(auth.user_id)
> entities = db(db.entity.id.belongs(user.entity)).select(db.entity.name) 
>
> Mind that the auth_user line is copied into session, so if that is always 
> available you can skip the first query and do
>
> entities = db(db.entity.id.belongs(auth.user.entity)).select(
> db.entity.name)
>
>
>
> Il giorno venerdì 11 maggio 2012 17:28:38 UTC+2, weheh ha scritto:
>>
>> db.define_table('entity', Field('name'), format='%(name)s')
>> auth_user_table = db.define_table(
>> auth.settings.table_user_name,
>> ... 
>> Field('entity', 'list:reference db.entity',
>>requires=IS_IN_DB(db, 'entity.id','%(name)s', multiple=True),
>>...
>> )
>>
>> Later, I want to get a list of entities by name from the list: reference 
>> entry for the current user.
>>
>> I would think I could do this:
>> user = db(db.auth_user.id == auth.user_id).select().first()
>> entities = db.auth_user.entity.represent(user.entity)
>> but I get a ticket:
>>   File "N:/web2py/applications/myapp/controllers/mycontroller.py", line 
>> 15, in myfunc
>> return dict(etext=db.auth_user.entity.represent(user.entity))
>> TypeError: 'NoneType' object is not callable
>>
>>
>> I've tried a few different variations on the theme, but none working so 
>> far. Any help would be appreciated.
>>
>> There are obvious slower ways to do this, but inelegant. I want the 
>> fastest, tightest solution.
>>
>>
>>

-- 





[web2py] represent list:reference

2012-09-11 Thread Pepe Araya
Hello,
I need to display the format value of the referenced table in a 
list:reference and not the list of ids.

I have these tables:
db.define_table('personas',
 Field('nombres'),
 Field('apellidos'),
 format='%(nombres)s %(apellidos)s')

db.define_table('publicaciones',
 Field('titulo'),
 Field('descripcion', 'text', label='Descripción'),
 Field('autores', 'list:reference db.personas',
requires= IS_IN_DB(db, 'personas.id', '%(nombres)s %(apellidos)s', 
multiple=True)),
 format='%(titulo)s')

this controller function:
def filtro():
tipo = request.args(0)
lista_publicaciones = db(db.publicaciones.tipo == tipo).select(orderby 
=~ db.publicaciones.fecha)
if lista_publicaciones:
lista_publicaciones=lista_publicaciones
else:
lista_publicaciones = "0"
return dict(lista_publicaciones=lista_publicaciones)

and this in the view:

{{if lista_publicaciones !='0':}}

{{for publicacion in lista_publicaciones:}}


{{=publicacion.titulo}}
Autores: {{=publicacion.autores}}

{{=XML(publicacion.descripcion)}}

{{pass}}
{{else:}}
something...
{{pass}}

using this in the view:
{{=db.publicaciones.autores.represent(publicacion.autores) }}

I get this error:
('NoneType' object is not callable)

Please, any help is welcome.
Thanks.

-- 





[web2py] Re: HTML truncate

2012-09-11 Thread Pepe Araya
Hi Massimo,

Sorry for my poor explanation.

What I don't get is in the view when i call the field value 
{{=tipo_3.descripcion}}  I get the whole text and not the truncated one 
like in the SQLFORM.grid case.




On Tuesday, September 11, 2012 9:32:18 AM UTC-3, Massimo Di Pierro wrote:
>
> What does it mean it does not work? Can you import it? Can you import it 
> from python?
>
> On Tuesday, 11 September 2012 00:55:03 UTC-5, Pepe Araya wrote:
>>
>> Hello,
>>
>> I need to truncate a field that contains HTML content. 
>>
>> Now i'm using htmltruncate <https://github.com/eentzel/htmltruncate.py> in 
>> a controller that return a SQLFORM.smartgrid and it works perfect:
>>  
>> def noticias():
>> 
>> db.noticias.cuerpo.represent = lambda field,row: 
>> XML(htmltruncate.truncate(field, 100))
>> grid = SQLFORM.smartgrid(db.noticias, 
>> linked_tables=['adjuntos_noticia'])
>>
>> return dict(grid =grid)
>>
>>
>> But when I try to implement a in a controller in this way:
>>
>> def index():
>> db.publicaciones.descripcion.represent = lambda field, row: 
>> XML(htmltruncate.truncate(field, 10))
>> tipo_3 = db(db.publicaciones.tipo == 3).select().last()
>>
>> return dict(tipo_3 = tipo_3)
>>
>>
>> It doesn't work
>>
>>
>> The module is inside the "modules" folder of the app and it's imported 
>> via:
>> import htmltruncate
>>
>>
>> any help is welcome!
>>
>> Best!
>>
>

-- 





[web2py] HTML truncate

2012-09-11 Thread Pepe Araya
Hello,

I need to truncate a field that contains HTML content. 

Now i'm using htmltruncate  in 
a controller that return a SQLFORM.smartgrid and it works perfect:
 
def noticias():

db.noticias.cuerpo.represent = lambda field,row: 
XML(htmltruncate.truncate(field, 100))
grid = SQLFORM.smartgrid(db.noticias, 
linked_tables=['adjuntos_noticia'])

return dict(grid =grid)


But when I try to implement a in a controller in this way:

def index():
db.publicaciones.descripcion.represent = lambda field, row: 
XML(htmltruncate.truncate(field, 10))
tipo_3 = db(db.publicaciones.tipo == 3).select().last()

return dict(tipo_3 = tipo_3)


It doesn't work


The module is inside the "modules" folder of the app and it's imported via:
import htmltruncate


any help is welcome!

Best!

-- 





[web2py] Not loading static files when accessing default view in controller

2012-08-10 Thread Pepe C
I have a site with a URL like this: www.mydomain/init/foldername/viewname

When I type the URL like this *www.mydomain/init/foldername* I don't get 
the static files loaded. However, when I type *www.mydomain/init/foldername/ 
*(with a backlash at the very end) the static files are loaded OK. What can 
be the issue?

I tried to add this in my default.py:

def foldername():
redirect(URL(request.application,'foldername','index'))

but no luck...

-- 





Re: [web2py] Re: bootstrap and user panel

2012-07-24 Thread Javier Pepe
Hello

Delete the content on database dir.
The system recreate auth tables.



On Tue, Jul 24, 2012 at 2:49 AM, murtaza52
wrote:

>
> Hello Martin,
>
> The CSS is cool so +1 for this.
>
> 1) I cloned your welcome app repo and placed it under applications, this
> is the summary of the error I get when I browse to the app -
>
> 127.0.0.1.2012-07-24.11-12-36.3a36305c-435d-4087-ab03-e427b4e00812
>  table auth_user already exists
>
> 2) Below is the error I recieved from the useradmin app when I did the
> same -
>
> 127.0.0.1.2012-07-24.11-17-36.3a723b6d-872c-49e2-878d-65fab3349ca5
>  define_tables() got an unexpected keyword
> argument 'signature'
> What am I doing wrong ?
>
> Thanks,
> Murtaza
>
>
> On Tuesday, July 24, 2012 9:27:49 AM UTC+5:30, Massimo Di Pierro wrote:
>>
>> This looks great. Are you proposing it as a replacement for the current
>> welcome? pros? cons?
>>
>> On Monday, 23 July 2012 19:02:47 UTC-5, Martin.Mulone wrote:
>>>
>>> I want to share this two applications*
>>>
>>> Bootstrap welcome application*
>>>
>>> I made my own welcome scatfold app, using twitter bootstrap template. My
>>> version is more like from the example template.
>>> Download: 
>>> https://bitbucket.org/**mulonemartin/bootstrap/**overviewalso
>>>  you can test
>>> here .
>>>
>>> *User Panel Admin*
>>>
>>> An application to administer the auth_user table. You can add, remove,
>>> activate users/ add groups, also add users to groups and so on.
>>> https://bitbucket.org/**mulonemartin/usersadmin
>>>
>>>
>>>
>>>  --
>
>
>
>

-- 





[web2py] Web2py expert needed for start-up

2012-07-16 Thread Pepe C
Hi, 

We have a set of applications on web2py and we are looking for an expert 
that can help us to operate and develop them.  This is a long-term role 
taking ~10 hours a week, although we do have a bunch of additional work to 
get done in the next few weeks. 

Responsibilities include:

   - Development of new web services 
   - Web2py administration and deployment 
   - Polishing and addressing bugs in the existing code

Experience with Jquery mobile plugin or mobile layouts would be a big plus.

In your replies please tell us about your portfolio, your availability for 
the next two months and your hourly rate.

Thanks!

-- 





Re: [web2py] Re: Nightly Build (for testers) for windows

2012-06-22 Thread Javier Pepe
Thanks

I expect the final version


On Fri, Jun 22, 2012 at 3:20 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> There are some known issue with the windows nightly build because we are
> moving from python 2.5 to 2.7. He hope to resolve them soon.
>
>
> On Friday, 22 June 2012 11:53:42 UTC-5, Javier wrote:
>>
>> Hello
>>
>> I'm trying to use de lastest binary version and get the follow error:
>>
>> Traceback (most recent call last):
>>File "web2pypy", line 16, in 
>> zipimport.ZipImportError: can't find module 'gluon'
>>
>> I need use this version to use scheduler.
>>
>> Thanks
>>
>>
>>  --
>

-- 





[web2py] Nightly Build (for testers) for windows

2012-06-22 Thread Javier Pepe
Hello

I'm trying to use de lastest binary version and get the follow error:

Traceback (most recent call last):
   File "web2pypy", line 16, in 
zipimport.ZipImportError: can't find module 'gluon'

I need use this version to use scheduler.

Thanks

-- 





Re: [web2py] web2py interactive console

2012-06-06 Thread Javier Pepe
Hello

You need add the -M option to load models.



On Wed, Jun 6, 2012 at 6:25 AM, Hassan Alnatour
wrote:

> Dear ALL ,
>
> i am trying  to use web2py from the terminal now i open the terminal and
> did this :
>
> $ cd web2py
> $ python web2py.py -S welcome
>
>
> here web2py will start the interactive console :
>
> >>> db =  DAL('sqlite://storage.sqlite')
> >>> db.tables
> []
>
>
>
> i didnt find my tables , why ??  i want to do this becouse i want to
> export a csv file for my auth_user
>
>
>
>
>


Re: [web2py] Re: Add conditional sub-menu

2012-04-12 Thread Javier Pepe
I was working on a set menu from the database. It's simple and it can be
useful.
The model is simple, and has a condition to evaluate options when
generating the menu items.
The evaluation was done using the function 'eval'.
Attach model.
To manage SQLFORM.grid use or what you like

db.define_table('menu',
Field('posicion',type='integer'),
Field('titulo',type='string'),
Field('controlador',type='string'),
Field('funcion',type='string'),
Field('padre'),
Field('condicion'),
   )
db.menu.padre.requires = IS_IN_DB(db, db.menu.id,'%(titulo)s')
db.menu.padre.represent = lambda id,row: db.menu(id).titulo
db.menu.condicion.default = 'True'

response.title = settings.title
response.subtitle = settings.subtitle
response.meta.author = '%(author)s <%(author_email)s>' % settings
response.meta.keywords = settings.keywords
response.meta.description = settings.description
response.menu = [ ]


def add_item(nivel):
item = []
for itemmenu in db((db.menu.padre == nivel) & (db.menu.id >
1)).select(orderby=db.menu.posicion):
if eval(itemmenu.condicion):

item.append([itemmenu.titulo,None,URL(itemmenu.controlador,itemmenu.funcion),add_item(
itemmenu.id) ])
return item

if auth.is_logged_in():
response.menu = add_item(1)


On Thu, Apr 12, 2012 at 1:00 AM, Cliff  wrote:

> I have something like this working:
>
> sub_menu = []
> if (auth.user_id != None) and ((auth.has_membership(role = 'admin'))):
> sub_menu = [('Admin',  False,  URL('admin')), ]
> response.menu = [('Home', False, URL('home','default','index'), []),
> (SPAN('Price List',_style='color:yellow'), True,
> URL('pricelist','default','index'),
> [('Guideline',  False,  URL('pricelist','default','guideline')),
>  ('Multiplier Tables',  False,
>  URL('pricelist','default','multitable')),
>  ('Cut Charge Tables',  False,  URL('pricelist','default','cuttable')),
>  (sub_menu),
> ])]
>
> On Wednesday, April 11, 2012 12:24:29 PM UTC-4, Omi Chiba wrote:
>>
>> The following menu works. It's add "Admin" menu next to "Price List" if
>> the user has role "admin". Now, I want to add the "Admin" menu as sub-menu
>> of "Price List" where it's right after the "Cut Charge Tables". How can I
>> do this ?
>>
>> response.menu = [('Home', False, URL('home','default','index'), []),
>> (SPAN('Price List',_style='color:yellow'), True,
>> URL('pricelist','default','**index'),
>> [('Guideline',  False,  URL('pricelist','default','**guideline')),
>>  ('Multiplier Tables',  False,  URL('pricelist','default','**
>> multitable')),
>>  ('Cut Charge Tables',  False,  URL('pricelist','default','**
>> cuttable')),
>> ])]
>>
>> if (auth.user_id != None) and ((auth.has_membership(role = 'admin'))):
>> response.menu += [('Admin',  False,  URL('admin')), ]
>>
>


Re: [web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-23 Thread Javier Pepe
sabsto

You can use selectable, for example:

selectable = lambda ids: delete(ids)
form=SQLFORM.grid(query,selectable=selectable)

def delete(ids):
to_delete=db(db.tabla.id.belongs(ids))
to_delete.delete()




On Fri, Mar 23, 2012 at 9:46 PM, Derek  wrote:

> Or you could avoid javascript, store the IDs of the "deleted" items in the
> session and do your own calls to the DAL to delete items.
>
>
> On Friday, March 23, 2012 7:33:42 AM UTC-7, Anthony wrote:
>>
>> Is it possible to select and delete multiple rows with one button click
>>> using SQLFORM.grid ?  (instead of clicking delete on each row)
>>> I tried the "selectable" property but this doesn't help to delete.
>>> I searched the archive of this group / mailing-list without success
>>>
>>
>> Not out of the box. I suppose you could add a column (via the "links"
>> argument) with "delete" checkboxes, and then add a "delete checked" button
>> to the page with a Javascript event handler that identifies the checked
>> records, submits a request to the server, and then possibly reloads the
>> whole page or just the grid via Ajax.
>>
>> Anthony
>>
>


Re: [web2py] Re: No models vs. conditional models -- what's the advantage?

2012-03-12 Thread Pepe Araya
With all the post arguing about no models... I'm asking myself: why web2py 
have "models" folder if it isn't the best way to do the work? only for 
background compatibility? 

what's the reason to load the models every time you make a request? is 
because the automatic migrations? 

are only questions, and why not made a huge change and optimization in a 
brand new version of web2py?

best regards,



On Thursday, March 8, 2012 12:45:41 PM UTC-3, rochacbruno wrote:
>
> another advantage is the fact that you can import modules, you cannot 
> import models. it is very nice to import your tables on external scripts.
>
> http://zerp.ly/rochacbruno
> Em 08/03/2012 12:11, "Anthony" escreveu:
>
>> I think an additional advantage of the module approach is that the module 
>> only has to be loaded once (when it is first imported), but the model files 
>> have to be read on every request.
>>
>> Anthony
>>
>> On Thursday, March 8, 2012 10:04:11 AM UTC-5, Cliff wrote:
>>>
>>> Certainly we want to avoid processing unnecessary table definitions 
>>> with every request. 
>>>
>>> It seems to me that the simplest solution is something like this: 
>>>
>>> if request.controller=='foo': 
>>>   db.define_table('foo', Field...) # main table 
>>>   db.define_table('foo_one_to_**many', Field(foo_id, db.foo...)...) 
>>>   ... 
>>>
>>> What is the advantage of the no models architecture over this?
>>
>>

Re: [web2py] Select Where first letter is A

2012-02-09 Thread Javier Pepe
>From manual:

http://web2py.com/books/default/chapter/29/6#like,-startswith,-contains,-upper,-lower

db.mytable.myfield.startswith('value')


On Thu, Feb 9, 2012 at 11:06 AM, Web2Py Freak wrote:

> Dear All ,
>
> How Can i select everything in the table the starts with A
>
> Best Regards,
> Hassan Alnatour
>


[web2py] Re: problem when upgrade to 1.99.4

2011-12-18 Thread Pepe Araya
thank you very much!
my fault.
:(


[web2py] Re: problem when upgrade to 1.99.4

2011-12-18 Thread Pepe Araya
sorry, is related with this:

db.actividades.fecha.represent = lambda *v, r: v.strftime(*'%d-%m-%Y')


[web2py] problem when upgrade to 1.99.4

2011-12-18 Thread Pepe Araya
Hi,

I have this ticket when upgrade to 1.99.4:

 'NoneType' object has no attribute 
'strftime'VERSIONweb2py™(1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 
14), 'stable')PythonPython 2.7.1: /usr/local/bin/pythonTRACEBACK

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Traceback (most recent call last):
  File "/home/doctoradoarq/webapps/web2py_docv3/web2py/gluon/restricted.py", 
line 204, in restricted
exec ccode in environment
  File 
"/home/doctoradoarq/webapps/web2py_docv3/web2py/applications/doctoradofadeu/controllers/administrar.py"
 
,
 line 244, in 
  File "/home/doctoradoarq/webapps/web2py_docv3/web2py/gluon/globals.py", line 
172, in 
self._caller = lambda f: f()
  File 
"/home/doctoradoarq/webapps/web2py_docv3/web2py/applications/doctoradofadeu/controllers/administrar.py"
 
,
 line 92, in agenda
return index()
  File 
"/home/doctoradoarq/webapps/web2py_docv3/web2py/applications/doctoradofadeu/controllers/administrar.py"
 
,
 line 88, in index
grid = SQLFORM.smartgrid(db.actividades)
  File "/home/doctoradoarq/webapps/web2py_docv3/web2py/gluon/sqlhtml.py", line 
1962, in smartgrid
user_signature=user_signature,**kwargs)
  File "/home/doctoradoarq/webapps/web2py_docv3/web2py/gluon/sqlhtml.py", line 
1781, in grid
value=field.represent(value,row)
  File 
"/home/doctoradoarq/webapps/web2py_docv3/web2py/applications/doctoradofadeu/models/ac_a_actividades.py"
 
,
 line 33, in 
db.actividades.fecha.represent = lambda v, r: v.strftime('%d-%m-%Y')
AttributeError: 'NoneType' object has no attribute 'strftime'


related to:
db.actividades.fecha.represent = lambda v, r: r.strftime('%d-%m-%Y')

what is a 'date' field

in version 1.99.2 it works ok, and reformat the date.

Thanks!! 


[web2py] Re: [OT] Pycharm 2 is out

2011-12-18 Thread Pepe Araya
Voted

[web2py] Re: SQLFORM.smartgrid PLURALIZE by default!!!!?????

2011-12-18 Thread Pepe Araya
sorry if my speech is annoying, but it's really irritating.

My apologies.


[web2py] SQLFORM.smartgrid PLURALIZE by default!!!!?????

2011-12-18 Thread Pepe Araya
Why pluralize by default!!???!

that ONLY work for english language, in spanish isn't so simply like add 
"s" for everything. I hate that, is like Rails...
please, don't go in the wrong way...

can I get my WELL FORMED labels back in some way?

thanks.


[web2py] how to set the id of a textarea of a SQLFORM?

2011-12-17 Thread Pepe Araya
Hello!

is possible to set the id of a textarea of a SQLFORM?

I have 2 forms on the same page but the textarea of both have the same 
id... 

thanks


[web2py] Re: book 4th edition in PDF

2011-12-17 Thread Pepe Araya
Work for me.

thanks.


[web2py] Re: SQLForm.grid - How do I use it properly?

2011-12-04 Thread Pepe Araya
Thanks!

Massimo, I noticed that this line of *gluon/sqlhtml.py*

1754: message = error or T('%(nrows)s records found') % dict(nrows=nrows)

add a new entry in the language file for every different search result. ("1 
records found", "2 records found"  )

I think that %(nrows)s should be outside the T() helper.

regards!

pepe.


[web2py] Re: SQLForm.grid - How do I use it properly?

2011-12-04 Thread Pepe Araya
Hi Massimo and all the team!

First all: Thanks very much for this feature!I it's really amazing!

I have a question: It's possible to call a function after *update* or *edit* 
that 
take the id of the record created or updated? (or any other parameter)

thanks very much!

pepe.


[web2py] Re: simulate a sub-domain from localhost?

2011-11-28 Thread Pepe Araya
I think that you can make it through the HOSTS file of your system

127.0.0.1:8000 site1.web2py.local
127.0.0.1:8000 site2.web2py.local




[web2py] computed field: update and images

2011-11-28 Thread Pepe Araya
Hi!!

I have 3 computed fields that call a "resize_image" function to make 3 
versions of a uploaded image.
The definition of one of these fields:

Field('foto_portada_detalle', 'upload',
uploadfolder=request.folder+'static/uploads/actividades',
compute=lambda r: resize_image(r['foto_portada'], (200,200), 'detalle', 
'actividades'),
autodelete=True,
readable=False)


When I delete the record, all is ok and the images are deleted but when I 
update the record with another image one good thing occur: all the other 3 
versions get updated BUT one bad thing occur too: the old images stay on 
the disk although "autodelete=True"

I think that the resize_image function need to manage the delete of old 
images but I don't know how. can you help me? Thank a lot!

The function:

def resize_image(image, size, path, folder, rotate=0):
import os.path

from PIL import Image, ImageOps

if image:
try:
img = Image.open('%sstatic/uploads/%s/%s' % (request.folder, 
folder, image))
img = img.convert("RGB")
img = ImageOps.fit(img, size, Image.ANTIALIAS, centering=(0.5, 
0.5))
#img.resize(size, Image.ANTIALIAS)
img = img.rotate(rotate)
root, ext = os.path.splitext(image)
filename = '%s_%s%s' %(root, path, ext)
img.save('%sstatic/uploads/%s/%s' % (request.folder, folder, 
filename))
return filename
except Exception, e:
return e
else:
return None


[web2py] Re: Checkboxes in SQLFORMs don't show updated values in 1.99.2

2011-11-23 Thread Pepe Araya
some news?

Thank you!




Re: [web2py] SQLFORM.grid collection of posts

2011-10-31 Thread Javier Pepe
Nick

I'm use the attribute _class to make a button

 A('Detalle',_class='button',_href='index/detalle/%s' % row.id)

This class render a button, same a the buttons on grid.



On Fri, Oct 28, 2011 at 11:08 PM, Nik Go  wrote:

> It mentions: "If you use jqueryui then the links are rendered as buttons.
> "
>
> am still trying to find an answer about how to use icons for your custom
> buttons.
>
> On Friday, October 28, 2011, Cliff wrote:
>
>> I'll try to keep an eye on it.
>>
>> On Oct 27, 1:47 pm, Massimo Di Pierro 
>> wrote:
>> > Thanks this is useful! Mind that the API may still fluctuate a bit.
>> >
>> > On Oct 26, 4:38 pm, Cliff  wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > You can find a digest of posts about SQLFORM.grid here:
>> >
>> > >https://docs.google.com/document/d/1p-OXDn75Nt2qmXQ0lvjqr4tYIf2PTIQx6.
>> ..
>> >
>> > > I know it is not complete, but it may help you get started.
>> >
>> > > Also there is some good information in the source file: gluon/
>> > > sqlhtml,  Just looking at the signature of the grid function is very
>> > > instructive.
>> >
>> > > If you find something I've missed, just let me know.
>> >
>> > > Cliff Kachinske
>
>


Re: [web2py] Re: Cascading Drop Down Lists with Ajax

2011-10-08 Thread Pepe Araya
Great!
thank you!!

On Fri, Oct 7, 2011 at 11:04 AM, Omi Chiba  wrote:

> Pepe,
>
> It's up now. Thank you for letting me know.
>
> My web2py version was back to 1.98.2 and all app was gone... I don't
> know why.
> I deployed the new version 1.99.2 and re-create the app from slice.
> It's actually pretty easy !
>
> On Oct 7, 4:00 am, Pepe Araya  wrote:
> > hi! the demo site is down :(
>


[web2py] Re: Cascading Drop Down Lists with Ajax

2011-10-07 Thread Pepe Araya
hi! the demo site is down :(

Re: [web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread Javier Pepe
Hello

Along with the question of Johann, you can add new buttons to the grid
/ SmartGrid, because the links are render as links, and not as
buttons.

Thanks

On Thu, Oct 6, 2011 at 9:36 AM, apple  wrote:
> You can add your own buttons using:
>
> links = [lambda row: A('Edit',_href=URL("controller","edit",
> args=["update", tablename, a.id]))
>
> and set editable, deletable, details  to False.
>
>
> On Oct 6, 12:48 pm, Johann Spies  wrote:
>> How do I override the views/controllers  triggered by the buttons  mentioned
>> in the subject line when using SQLFORM.grid/smartgrid?
>>
>> Regards
>> Johann
>>
>> --
>>  May grace and peace be yours in abundance through the full knowledge of God
>> and of Jesus our Lord!  His divine power has given us everything we need for
>> life and godliness through the full knowledge of the one who called us by
>> his own glory and excellence.
>>                                                     2 Pet. 1:2b,3a


Re: [web2py] Re: Field compute= and make thumbnail

2011-09-26 Thread Pepe Araya
oh! thanks very much!

I'll try

pepe

On Mon, Sep 26, 2011 at 3:30 PM, pbreit  wrote:

> Here's what I do. Seems to work.
>
> Field('image', 'upload', uploadfolder=request.folder+'static/uploads',
> requires=IS_EMPTY_OR(IS_IMAGE())),
> Field('image_display', 'upload',
> uploadfolder=request.folder+'static/uploads',
> compute=lambda r: resize_image(r['image'], (320,320),
> 'display'),
> readable=False, writable=False),
> Field('image_thumb', 'upload',
> uploadfolder=request.folder+'static/uploads',
> compute=lambda r: resize_image(r['image'], (150,130), 'thumb'),
> readable=False, writable=False),
>
> def resize_image(image, size, path, rotate=0):
> import os.path
> from PIL import Image'
> if image:
> try:
> img = Image.open('%sstatic/uploads/%s' % (request.folder,
> image))
> img = img.convert("RGB")
> img.thumbnail(size, Image.ANTIALIAS)
> img = img.rotate(rotate)
> root, ext = os.path.splitext(image)
> filename = '%s_%s%s' %(root, path, ext)
> img.save('%sstatic/uploads/%s' % (request.folder, filename))
> return filename
> except Exception, e:
> return e
> else:
> return None
>


[web2py] Field compute= and make thumbnail

2011-09-26 Thread Pepe Araya
Hello,

I have a table where only store images related to x Article. 

db_define_table('images',
  Field('original_image', 'upload'),
  Field('thumb_image', 'upload')

Is efficient even, possible to make  'thumb_image' Field a computed Field?
Something like:

  Field('thumb_image', 'upload', *compute*= lambda r:*make_thumb*(r, 
85))


def *make_thumb*(r, thumb_size):

try:
from PIL import Image
except:
raise ImportError, "Requires PIL installed in your system."


size = (thumb_size, thumb_size)


Any help is welcome!

thanks!


Re: [web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Pepe Araya
thank you so much!

[web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Pepe Araya
Hi, I have same problems here.

can someone record a step by step screencast?

when I clone the repo, I only get one folder and 4 files:

public_html> dispatch.fcgi
icon.png
README
tmp_fb_pw

how I can to add one app?

Thanks so much!


Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Thanks!
I'm very grateful for your help!

I have only one more question: in which cases is right to define this in the 
controller?

You says:

you can define a represent in controller before creating the table or form.
db.table.field.represent = lambda .

that is for Table and Form Helpers?

Anew, thanks very much for your time and help! 



Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
In that way it not work, but I tried this:

{{for postulacion in lista_postulaciones:}}
 {{represent =*db.postulaciones.estado_postulacion.represent
*}}
 
 {{=postulacion.postulaciones.id}}

 {{=postulacion.postulaciones.fecha_postulacion}}
 {{=represent(*
postulacion.postulaciones.estado_postulacion*)}}

and it works :)

Thanks a lot!

ps: is this the right way or the best way to do it?


Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
I get this error:

AttributeError: 'str' object has no attribute 'represent'



Re: [web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Thanks Bruno!

I'm doing something wrong:

*my controller*:

def index():
db.postulaciones.estado_postulacion.represent = lambda 
r:db.estados_postulacion[r].nombre
lista_postulaciones = db(db.postulaciones.postulante == 
db.auth_user.id).select()

return dict( lista_postulaciones = lista_postulaciones)

*my view:*
*
*

 
 ID 
 Fecha de Postulación
 Estado
 Nombres
 Apellido Paterno
 Apellido Materno
 Ver Postulación
 
 {{for postulacion in lista_postulaciones:}}
 
 {{=postulacion.postulaciones.id}}

 {{=postulacion.postulaciones.fecha_postulacion}}

 {{=postulacion.postulaciones.estado_postulacion}}
 {{=postulacion.auth_user.first_name}}
 {{=postulacion.auth_user.last_name}}
 {{=postulacion.auth_user.apellido_materno}}
 {{=A('VER POSTULACIÓN', _href=URL(r=request, 
f='ver_postulacion', args=postulacion.postulaciones.id))}}

 
 {{pass}}
 

*and I get this:*

IDFecha de PostulaciónEstadoNombresApellido PaternoApellido MaternoVer 
Postulación62011-08-03 12:53:151PepeArayaBossaVER POSTULACIÓN



Thank you for your help!

[web2py] define represent in a Controller

2011-08-31 Thread Pepe Araya
Hi!

I really can't get this done, please, any help is welcome.

Consider that I have this tables:

# models/db.py #

db.define_table('auth_user' ... )

db.define_table('estados_postulacion',
Field('nombre'),
Field('descripcion'),
format='[%(id)s] %(nombre)s')

db.define_table('postulaciones',
Field('proceso_postulacion', db.proceso_postulacion),
Field('postulante', db.auth_user, default=user_id),
Field('fecha_postulacion', 'datetime', default=request.now),
Field('estado_postulacion', requires=IS_IN_DB(db, 'estados_postulacion.id', 
'%(nombre)s'),
  represent=lambda r:db.estados_postulacion[r].nombre))

###

The "represent" attribute defined there only work for SQLTABLE but I don't 
need a table in my view.

How I can to define a represent in a controller for the field: 
db.postulaciones.estado_postulacion ?

I need that this represent work in my view:
represent=lambda r:db.estados_postulacion[r].nombre


Thanks a lot!


[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-05 Thread Pepe Araya
Quoting Jonathan Lundell:

It should be* IOError* (capital E)

---

with that change it works.


Re: [web2py] 1.96.3 is OUT

2011-06-05 Thread Pepe Araya
With that change it works.

 open('/dev/urandom','wb').write(''.join(chr(t) for t in ctokens))
except IOError:
# works anyway


thanks!


Re: [web2py] 1.96.3 is OUT

2011-06-05 Thread Pepe Araya
Sorry, that is a duplicate message of 
this: https://groups.google.com/d/msg/web2py/f3l_IOcx560/wNLyIfvSj6wJ

After your recommendation, I added that line to utils.py and it works but 
now, after a fresh install with the version in trunk other error appear : 

(posted 
here: https://groups.google.com/d/msg/web2py/e2KcQDYcPD0/32Gvo-UrUCEJ )

Traceback (most recent call last):
  File "web2py.py", line 16, in 
import gluon.widget
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py", 
line 15, in 
from globals import current
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py", line 
21, in 
from html import xmlescape, TABLE, TR, PRE
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py", line 
29, in 
from utils import web2py_uuid, hmac_hash
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
103, in 
ctokens = initialize_urandom()
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
93, in initialize_urandom
except IOerror:
NameError: global name 'IOerror' is not defined


[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-05 Thread Pepe Araya
Massimo, I did a fresh install with the new trunk and this is the traceback:

Traceback (most recent call last):
  File "web2py.py", line 16, in 
import gluon.widget
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py", 
line 15, in 
from globals import current
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py", line 
21, in 
from html import xmlescape, TABLE, TR, PRE
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py", line 
29, in 
from utils import web2py_uuid, hmac_hash
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
103, in 
ctokens = initialize_urandom()
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
93, in initialize_urandom
except IOerror:
NameError: global name 'IOerror' is not defined



Re: [web2py] 1.96.3 is OUT

2011-06-05 Thread Pepe Araya
In webfaction, I did a fresh install using their install script (
https://wiki.webfaction.com/wiki/Web2py-LatestSource) and I get this error:

Traceback (most recent call last):
  File "web2py.py", line 16, in 
import gluon.widget
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py", 
line 15, in 
from globals import current
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py", line 
21, in 
from html import xmlescape, TABLE, TR, PRE
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py", line 
29, in 
from utils import web2py_uuid, hmac_hash
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
98, in 
ctokens = initialize_urandom()
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
93, in initialize_urandom
logging.warn(
NameError: global name 'logging' is not defined

Any idea?


Re: [web2py] 1.96.3 is OUT

2011-06-04 Thread Pepe Araya
now it works ok!

thanks!!


Re: [web2py] 1.96.3 is OUT

2011-06-04 Thread Pepe Araya
In webfaction, I did a fresh install using their install script but i get 
this error:

Traceback (most recent call last):
  File "web2py.py", line 16, in 
import gluon.widget
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/__init__.py", 
line 15, in 
from globals import current
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/globals.py", line 
21, in 
from html import xmlescape, TABLE, TR, PRE
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/html.py", line 
29, in 
from utils import web2py_uuid, hmac_hash
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
98, in 
ctokens = initialize_urandom()
  File "/home/pepearaya/webapps/crewcatalyst2/web2py/gluon/utils.py", line 
93, in initialize_urandom
logging.warn(
NameError: global name 'logging' is not defined

any idea of what I can to do??
thanks a lot!


Re: [web2py] 1.96.3 is OUT

2011-06-04 Thread Pepe Araya
did you installed it with the webfaction's script?

Re: [web2py] 1.96.3 is OUT

2011-06-04 Thread Pepe Araya
I have the same problem as i mentioned 
here: https://groups.google.com/d/topic/web2py/e2KcQDYcPD0/discussion



[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-04 Thread Pepe Araya
Massimo, bad news :( it not work
this is the log:

[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1]   File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/html.py", line 29, in 

[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] from utils import 
web2py_uuid, hmac_hash
[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1]   File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py", line 98, in 

[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] ctokens = 
initialize_urandom()
[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1]   File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py", line 90, in 
initialize_urandom
[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] 
open('/dev/urandom','wb').write(''.join(chr(t) for t in ctokens))
[Sat Jun 04 17:41:31 2011] [error] [client 127.0.0.1] IOError: [Errno 13] 
Permission denied: '/dev/urandom'




[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-04 Thread Pepe Araya
Thanks Massimo!

I'll give a try


[web2py] Re: webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-04 Thread Pepe Araya
Reply 2:

> open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens))

In this line, you are attempting to open /dev/urandom for reading, and then 
are attempting to write to it.

Instead, you need to read the data from /dev/urandom, and then open a new 
file for writing to write your output.

Hope that helps!

__

what can i do?


[web2py] webfaction: Internal Server Error after upgrade to 1.96.2

2011-06-04 Thread Pepe Araya
Hi, my site have an "internal server error" after upgrade to 1.96.2

Webfaction support say:

Your app is trying to wrote to /dev/urandom which it will never be able to 
do:

[pepearaya@web136 apache2]$ tail 
/home/pepearaya/logs/user/error_crewcatalyst.log
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from globals import 
current
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/globals.py", line 21, in 

[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from html import 
xmlescape, TABLE, TR, PRE
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/html.py", line 29, in 

[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] from utils import 
web2py_uuid, hmac_hash
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py", line 98, in 

[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] ctokens = 
initialize_urandom()
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] File 
"/home/pepearaya/webapps/crewcatalyst/web2py/gluon/utils.py", line 90, in 
initialize_urandom
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] 
open('/dev/urandom','wb').write(''.join(chr(t) for t in ctokens))
[Sat Jun 04 01:34:25 2011] [error] [client 127.0.0.1] IOError: [Errno 13] 
Permission denied: '/dev/urandom'

*So, you need to change that line to: 
"open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens))"*
*
*
after that change I get this error:
open('/dev/urandom','r').write(''.join(chr(t) for t in ctokens))
[Sat Jun 04 02:12:33 2011] [error] [client 127.0.0.1] IOError: [Errno 9] Bad 
file descriptor

any idea of what i can to do?

thanks!


[web2py] Re: Embedding web2py

2011-05-19 Thread Pepe Araya
maybe this help: 
http://www.appcelerator.com/products/titanium-cross-platform-application-development/

[web2py] Pusher - Real-time push

2011-04-22 Thread Pepe Araya
Hello!

Has anyone used this with web2py? can you share your experience?

http://www.pusher.com




Re: [web2py] Extend Field Type "upload" to a CDN

2011-04-17 Thread Pepe Araya
Hi,

any news about?

I'm very interested

regards!


[web2py] web2py HL7: where come from "key:descriptions" of some tables?

2011-03-04 Thread Pepe Araya
Hello,

I'm trying to understand the Web2py HL7 App and I don't understand where 
come from the key:descriptions of some tables.

e.g:

"social_history" Table

id: 1
key: 229819007
description: Tobacco use and exposure (observable entity) Not available 
Smoking


is the key arbitrary or is a standard?

Thanks a lot.


  1   2   >