[web2py] Re: Error in appadmin (database admin) on python 3

2017-08-06 Thread Leonel Câmara
Looks like a pyDAL bug, there is no "unicode" in the appadmin.

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


[web2py] Re: change represent of referenced filed in SQLFORM update

2017-08-06 Thread Vic Ding
works like a charm!

On Sunday, August 6, 2017 at 4:39:07 PM UTC+2, Anthony wrote:
>
> On Saturday, August 5, 2017 at 4:12:43 PM UTC-4, Vic Ding wrote:
>>
>> Thanks for the help, it works. However, this alters the table definition. 
>> 1) Is there a way that the value is only set temporarily ?
>>
>
> You can set db.customer._format and db.sales_order.customer.requires 
> anywhere you want.
>  
>
>> 2) When the address field is empty, can I use other fields , like city, 
>> country and etc?
>>
>
> The "_format" attribute and the third argument to IS_IN_DB can be a 
> function that takes a row object and returns whatever you want:
>
> def represent_customer(row):
> ...
> return something
>
> db.customer._format = represent_customer
>
> Anthony
>

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


[web2py] Re: web2py 2.15.0b1

2017-08-06 Thread wish7code
Opened a ticket at https://github.com/web2py/web2py/issues/1721

On Thursday, 13 July 2017 09:45:11 UTC+2, Jacinto Parga wrote:
>
> Great job. Thanks.
>
> First issue with @mobilize import
>
>
> 
>
> from gluon.contrib.user_agent_parser import mobilize
>
>
>
>
> El miércoles, 5 de julio de 2017, 8:55:21 (UTC+2), Massimo Di Pierro 
> escribió:
>>
>> Please help us test the new web2py:
>>
>>
>> https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
>>  
>>
>> https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_osx.zip
>>
>> https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_win.zip
>>
>> Personally and on behalf of the community: thanks to everybody who has 
>> contributed! 
>>
>> It has been a year but we piled up a huge number of small changes and bug 
>> fixes.
>>
>> ## 2.16.0b1
>>
>> - experimental python 3 support
>>
>> - experimental authapi for service login
>>
>> - more tests
>>
>> - d3.js model visulization
>>
>> - improved scheduler
>>
>> - is_email support for internationalized Domain Names
>>
>> - improved used of cookies with CookieJar
>>
>> - SQLFORM.grid(showblobs=True)
>>
>> - import JS events (added w2p.componentBegin event)
>>
>> - added support for CASv3
>>
>> - allow first_name and last_name placeholders in verify_email message
>>
>> - added three-quote support in markmin
>>
>> - updated pg8000 driver (but we still recommend psycopg2)
>>
>> - compiled views use . separator not _ separator (must recompile code)
>>
>> - better serbian, french, and catalan translations
>>
>> - speed improvements (refactor of compileapp and pyc caching)
>>
>> - removed web shell (never worked as intended)
>>
>> - allow Expose(..., follow_symlink_out=False).
>>
>> - Updated fpdf to latest version
>>
>> - JWT support
>>
>> - import fabfile for remote deployment
>>
>> - jQuery 3.2.1
>>
>> - PyDAL 17.07 including:
>>
>>   allow jsonb support for postgres
>>
>>   correctly configure adapters that need connection for configuration
>>
>>   better caching
>>
>>   updated IMAP adapter methods to new API
>>
>>   experimental suport for joinable subselects
>>
>>   improved Teradata support
>>
>>   improved mongodb support
>>
>>   overall refactoring
>>
>>   experimental support for Google Cloud SQL v2
>>
>

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


[web2py] Re: Can't load form using {{=form}} only by {{=LOAD('default','def')}} or submit the form.

2017-08-06 Thread Samuel Gosling
Thank you very much, I made a html file called order.load and did what you 
said and now it's working flawlessly. Cheers for all your help guys.

For anyone else stuck on this matter make the default/order.load file or 
default/form.load

then load in html's index as {{=LOAD('default','order.load',ajax=True)}}

On Sunday, August 6, 2017 at 12:01:07 PM UTC+1, Paolo Caruccio wrote:
>
> Do you have a file named "order.load" or "order.html" in views/default 
> folder?
>
> LOAD helper needs a view  that does not extend the layout.
>
> Sample of content default order.load (please note the absence of  {{extend 
> 'layout.html'}}):
>
> {{=order}}
>
>
> More on LOAD helper in 
> http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD
>
>  
>
> Il giorno venerdì 4 agosto 2017 17:54:05 UTC+2, Samuel Gosling ha scritto:
>>
>> faced with this! invalid function (default/order)
>>
>> Started off with that statement you see.
>> Really confused at this , seems to be nobody else is having this problem!
>>
>> On Friday, August 4, 2017 at 3:59:34 PM UTC+1, Jim S wrote:
>>>
>>> In your controller, try:
>>>
>>> return dict(order=order)
>>>
>>> instead of:
>>>
>>> return order
>>>
>>> -Jim
>>>
>>> On Friday, August 4, 2017 at 9:45:51 AM UTC-5, Samuel Gosling wrote:

 Hey guys completely new to web development and web2py , enjoying it so 
 far. It has a lot of potential.

 Need help loading my form in my index.html as I can't using {{=form}} 
 or in this case {{=order}} only by using the command 
 {{=LOAD('default','order')}}. I believe this may be my problem in 
 submitting the form also as I keep getting my error back and the page 
 won't 
 redirect.
 I know usually for using a form you use the {{=form.custom.begin}} , 
 {{=form.custom.submit}}  and {{=form.custom.end}} but since I can't use 
 {{=form} that isn't an option. If i use {{=form}} , I get the error that 
 it 
 is not defined. I have looked for answers but they resulted to no avail. 
  Hope you guys can help and I appreciate it greatly. 

 default.py
 def order():
 order = SQLFORM(db.order,
submit_button='Buy!',
buttons=['submit'],
 formstyle='table3cols')
 if order.process(keepvalues=True).accepted:
 session.flash = 'Order submitted.'
 redirect(URL('payment'))
 elif order.errors:
 session.flash = 'Error.'
 else:
 session.flash = 'Please enter a wallet address.'
 return order

 db.py
 db = DAL('sqlite://storage.sqlite')
 db.define_table('order', Field('amount', requires=IS_IN_SET(['100 ɌDD', 
 '250 ɌDD', '500 ɌDD' , '1000 ɌDD', '2500 ɌDD', '5000 ɌDD', '1 ɌDD'])),
 Field('address', requires=IS_NOT_EMPTY()))

 index.html
 
 {{=LOAD('default','order')}}
 






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


[web2py] Error in appadmin (database admin) on python 3

2017-08-06 Thread Kirill Shatalaev
Hello, when using python3 and database admin, I got this error:

 name 'unicode' is not defined

You need to click on any table name (for example, 
http://127.0.0.1:8000/mysite/appadmin/select/db?query=db.auth_user.id%3E0).

I think this is python3 unicode -> str specific related trouble.



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


[web2py] Re: change represent of referenced filed in SQLFORM update

2017-08-06 Thread Anthony
On Saturday, August 5, 2017 at 4:12:43 PM UTC-4, Vic Ding wrote:
>
> Thanks for the help, it works. However, this alters the table definition. 
> 1) Is there a way that the value is only set temporarily ?
>

You can set db.customer._format and db.sales_order.customer.requires 
anywhere you want.
 

> 2) When the address field is empty, can I use other fields , like city, 
> country and etc?
>

The "_format" attribute and the third argument to IS_IN_DB can be a 
function that takes a row object and returns whatever you want:

def represent_customer(row):
...
return something

db.customer._format = represent_customer

Anthony

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


[web2py] Re: Can't load form using {{=form}} only by {{=LOAD('default','def')}} or submit the form.

2017-08-06 Thread Paolo Caruccio
Do you have a file named "order.load" or "order.html" in views/default 
folder?

LOAD helper needs a view  that does not extend the layout.

Sample of content default order.load (please note the absence of  {{extend 
'layout.html'}}):

{{=order}}


More on LOAD helper in 
http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD

 

Il giorno venerdì 4 agosto 2017 17:54:05 UTC+2, Samuel Gosling ha scritto:
>
> faced with this! invalid function (default/order)
>
> Started off with that statement you see.
> Really confused at this , seems to be nobody else is having this problem!
>
> On Friday, August 4, 2017 at 3:59:34 PM UTC+1, Jim S wrote:
>>
>> In your controller, try:
>>
>> return dict(order=order)
>>
>> instead of:
>>
>> return order
>>
>> -Jim
>>
>> On Friday, August 4, 2017 at 9:45:51 AM UTC-5, Samuel Gosling wrote:
>>>
>>> Hey guys completely new to web development and web2py , enjoying it so 
>>> far. It has a lot of potential.
>>>
>>> Need help loading my form in my index.html as I can't using {{=form}} or 
>>> in this case {{=order}} only by using the command 
>>> {{=LOAD('default','order')}}. I believe this may be my problem in 
>>> submitting the form also as I keep getting my error back and the page won't 
>>> redirect.
>>> I know usually for using a form you use the {{=form.custom.begin}} , 
>>> {{=form.custom.submit}}  and {{=form.custom.end}} but since I can't use 
>>> {{=form} that isn't an option. If i use {{=form}} , I get the error that it 
>>> is not defined. I have looked for answers but they resulted to no avail. 
>>>  Hope you guys can help and I appreciate it greatly. 
>>>
>>> default.py
>>> def order():
>>> order = SQLFORM(db.order,
>>>submit_button='Buy!',
>>>buttons=['submit'],
>>> formstyle='table3cols')
>>> if order.process(keepvalues=True).accepted:
>>> session.flash = 'Order submitted.'
>>> redirect(URL('payment'))
>>> elif order.errors:
>>> session.flash = 'Error.'
>>> else:
>>> session.flash = 'Please enter a wallet address.'
>>> return order
>>>
>>> db.py
>>> db = DAL('sqlite://storage.sqlite')
>>> db.define_table('order', Field('amount', requires=IS_IN_SET(['100 ɌDD', 
>>> '250 ɌDD', '500 ɌDD' , '1000 ɌDD', '2500 ɌDD', '5000 ɌDD', '1 ɌDD'])),
>>> Field('address', requires=IS_NOT_EMPTY()))
>>>
>>> index.html
>>> 
>>> {{=LOAD('default','order')}}
>>> 
>>>
>>>
>>>
>>>
>>>

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


[web2py] Re: Weird problems generating menu from database

2017-08-06 Thread Вячеслав Анатольевич
Thanks, Massimo!
So, i have a database table - named "map", in that table - three field - 
menu1, menu2, mnm_name.
Menu mast be like that:

   - menu1
- menu2
  -mnm_name
In menu1 - menu2, in menu2 - mnm_name

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