[web2py] Re: customizing menu items when MENU helper is used

2019-07-30 Thread Dave S


On Tuesday, July 30, 2019 at 3:09:24 PM UTC-7, Vlad wrote:
>
> what would be the best way to specify a background color (different for 
> each menu item, depending on some database-driven data) when I build the 
> menu with menu.append(...) in menu.py? 
>
> I would love to have something like this: 
>
> menu.append([description, False, 
> URL('catalog','regimen',args=[id]),[]],_style='background-color:red;')
>
> but of course, this doesn't work this way - 
>
>
>
I'd look at using _class instead of _style.  (_class defaults to 
'web2py-menu web2py-menu-vertical')

/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/dcaea736-c629-43c7-924a-b07764ce952a%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-07-30 Thread Massimo Di Pierro
you have to run 

python3 setup.py install



On Tuesday, 30 July 2019 10:59:36 UTC-7, En Ware wrote:
>
> when using py4web source , py4web-start is missing. from pip py4web-start 
> exists. 
>
>
> On Wednesday, July 24, 2019 at 12:40:27 AM UTC-5, Massimo Di Pierro wrote:
>>
>> OK. I know. I am not good with names. 
>> But there are lots of requirements to be fulfilled.
>> py4web.com was available and the pypi package was available.
>> Here is running on google cloud:
>> http://py4web.com/
>>
>> Ducking...
>>
>>

-- 
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/befe4689-51d1-495f-b611-ddb9e84ca164%40googlegroups.com.


[web2py] Re: managing web2py logs under uwsgi

2019-07-30 Thread Dave S


On Monday, July 29, 2019 at 3:06:54 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, April 23, 2019 at 8:00:44 PM UTC-7, Dave S wrote:
>>
>> I run web2py under nginx and uwsgi.  The latter runs in master mode 
>> (rather than emperor mode), and I think it is what drives my question:
>>
>> *How do I control the size of the web2py log files?*
>> I have seen the files grow without bound (until I did a manual log 
>> rotate), but currently the web2py/logs/web2py.log file is being rotated for 
>> me after 1-3 requests.  The uwsg conf file web2py.ini specifies a 
>> log-maxsize, but that's for the uwsgi logs, and the web2py logs are being 
>> kept under 300 bytes.
>>
>> (300 bytes x 6 rotations with a few requests per second means I don't 
>> have to capture error clues)
>>
>> Versions: 
>> web2py 2.1.5.4 for the moment, as I didn't jump on the .17 versions, and 
>> the .18s kept jumping every time I began to be less inert
>> nginx 1.14.1
>> uwsgi 2.0.15 (master=true, processes=4)
>>
>> /dps
>>
>>
> Having had to restart the server recently, I studied this again.
>
> It appears that when you start uwsgi, [web2py dir]/logs/web2py.log grows 
> normally until it reaches a limit, and then each uwsgi worker starts 
> autorotating it, and each rotation gives you 1-3 requests worth of logging, 
> and this goes on until the next restart.
>
> My uwsgi is set to autorotate logs, but I'd expect that to only deal with 
> uwsgi's logs.  Is the behavior above controlled by appfactory() in 
> gluon/main.py?
>
> /dps
>


In order to debug an issue, I've been using the "touch routes.py" trick, 
and that is a more graceful way of restarting the web2py.log.  It appears 
that autorotates start at about 1,000,000 bytes (but it's difficult to 
catch the actual turning point).  The file used for uwsgi configuration has 
a log size value of 2,000,000 which fits the size of the uwsgi.logs as 
rotated by uwsgi.

/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/67d87e25-75cd-4e4b-9e23-f71e7a9c6440%40googlegroups.com.


[web2py] How to connect to mongoDB: I'm getting errors when connecting

2019-07-30 Thread Maurice Waka

I was trying out this 

 example, 
not sure whether its outdated, 


but got this errors:

le "/usr/local/lib/python3.6/dist-packages/pymongo/helpers.py", line 155, in 
_check_command_response
 raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: Authentication failed.

*this was my db line:*

*db = DAL("mongodb://mwakewaka: 
blahblaha123**@ds123456.mlab.com:1257467/testriver", 
check_reserved=["mongodb_nonreserved",],  adapter_args={"safe":False})*

However I not that this connection with localhost is ok.


db = DAL('mongodb://localhost/queellness')

-- 
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/c71468e7-2f20-4822-bec9-e5f3ab8f963d%40googlegroups.com.


[web2py] customizing menu items when MENU helper is used

2019-07-30 Thread Vlad
what would be the best way to specify a background color (different for 
each menu item, depending on some database-driven data) when I build the 
menu with menu.append(...) in menu.py? 

I would love to have something like this: 

menu.append([description, False, 
URL('catalog','regimen',args=[id]),[]],_style='background-color:red;')

but of course, this doesn't work this way - 


-- 
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/bbc8c801-a94e-4ce2-acb7-c3ba493278a9%40googlegroups.com.


[web2py] Re: long() argument must be a string or a number, not 'list'

2019-07-30 Thread Dave S


On Tuesday, July 30, 2019 at 11:12:26 AM UTC-7, Kimus wrote:
>
> bem tenho o seguinte problema dessa vez, estou tentando criar a primeira 
> tabela com relacionamento, só que não to conseguindo inserir nd dos dados 
> na tabela pq ele fica dando esse erro "long() argument must be a string or 
> a number, not 'list' 
> meu controller 
> @auth.requires_login()
> def CadastroPropriedade():
> formulario = db.PropriedadeRural.insert(area=request.vars.area)
> return dict(mensagem=" ")
> meu BD : 
> propriedadeRural = db.define_table('PropriedadeRural'
> ,Field('area','integer',label='Area de platação')
> ,Field('ano','date',label='ano da colheita')
> ,Field('lavoura','string',label='Tipo de cultivo')
> ,Field('producao','integer',label='Produção em sacos')
> ,Field('valorProducao','integer',label='Receita de Venda')
> ,Field('agricultor','references auth_user',label='Dono Da Lavoura'))
>
> e o erro completo:
>
> Número do Ticket
>
> 127.0.0.1.2019-07-30.12-01-32.d039c906-1e98-41a0-8ae5-e0657181b244
>  long() argument must be a string or a 
> number, not 'list'Versão
> web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
> Python Python 2.7.15+: /usr/bin/python (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
>
> Traceback (most recent call last):
>   File "/home/nti/Área de Trabalho/web2py/gluon/restricted.py", line 219, in 
> restricted
> exec(ccode, environment)
>   File "/home/nti/Área de 
> Trabalho/web2py/applications/ProjetoMargem/controllers/template.py" 
> ,
>  line 66, in 
>   File "/home/nti/Área de Trabalho/web2py/gluon/globals.py", line 421, in 
> 
> self._caller = lambda f: f()
>   File "/home/nti/Área de Trabalho/web2py/gluon/tools.py", line 3869, in f
> return action(*a, **b)
>   File "/home/nti/Área de 
> Trabalho/web2py/applications/ProjetoMargem/controllers/template.py" 
> ,
>  line 21, in CadastroPropriedade
> formulario = db.PropriedadeRural.insert(area=request.vars.area)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/objects.py", line 762, in insert
> ret = self._db._adapter.insert(self, row.op_values())
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 480, in 
> insert
> query = self._insert(table, fields)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 476, in 
> _insert
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 476, in 
> 
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 445, in 
> _expand
> rv = self.represent(expression, field_type)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 382, in 
> represent
> return super(SQLAdapter, self).represent(obj, field_type)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 336, in 
> represent
> return self.representer.represent(obj, field_type)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 251, 
> in represent
> rv = self.get_representer_for_type(field_type)(rv, field_type)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 139, 
> in __call__
> return self.adapt(self.call(value, field_type))
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 136, 
> in _call
> return self.inner_call(value)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 124, 
> in _inner_call
> return self.obj.f(self.representer, value, **kwargs)
>   File "/home/nti/Área de 
> Trabalho/web2py/gluon/packages/dal/pydal/representers/base.py", line 30, in 
> _integer
> return str(long(value))
> TypeError: long() argument must be a string or a number, not 'list'
>
> Momento do Erro [image: help] 
> 
>
> (long() argument must be a string or a 
> number, not 'list')
>
>
>

Normally, request.vars.something is a string, and you should do a type 
conversion.  You didn't provide a sample URL for the request, so I'm 
guessing that your URL was something like 
my_app/my_controller/my_function?area=3,5 and the comma (',') turns one 
string into two, hence a list.

If that comma is a decimal point (which is true in many locale settt

[web2py] Re: Como editar um decoratordo web2py

2019-07-30 Thread Dave S


On Monday, July 29, 2019 at 11:29:09 PM UTC-7, Kimus wrote:
>
> Ola estou com um problema , estou trabalhando com um template usando 
> bootstrap (peguei na net ) diferente do web2py logo tenho que fazer td na 
> mão e até msm inventar as coisas pra fazer acontecer, e agora estou com um 
> problem, tenho um controllor chamado template e nele em uma das funções eu 
> uso o decorator @auth.requires_login() funciona , só que ele redireciona 
> parao controler default/user/login eeu quero que ele redifrecione pra outro 
> controler, teria como editar essa decorator para isso ??
>

[Per Google Translate, you're using a different template for your views, 
and you have some controller  functions decorated with 
"@auth.requires_login()",
and you don't want to redirect to default/user/login.

Why do you want to redirect to another controller or function, rather than 
giving your user a chance to login?  

If you want to use a different login method than the "out of the box" 
method, then you should be reading Chapter 9 on Access Control.  That's 
also where you will find the information about the settings 
auth.settings.login_url and auth.settings.on_failed_authorization.
http://web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages>

Good luck!

/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/7c5d5f37-435d-4708-9a86-415f79dba0c2%40googlegroups.com.


Re: [web2py] Re: How to link images (under static/images) from static folder static html

2019-07-30 Thread Jon Subscripted
Thanks Dave,
I'll test using the logo (which actually works) as you suggested.
Regards, Jon.


Libre
de virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Mon, Jul 29, 2019 at 10:27 PM Dave S  wrote:

>
>
> On Monday, July 29, 2019 at 1:43:55 AM UTC-7, Jonsubs wrote:
>>
>> Hi everyone,
>> Any suggestions, please?
>> It does work for me in locally (127.0.0.0), but not in PythonAnywhere.
>> Thanks, Jon.
>>
>> On Mon, Jul 22, 2019 at 4:02 PM Jon Subscripted 
>> wrote:
>>
>>> Hi everyone,
>>> I'm experiencing some problems trying to display static images in my
>>> static html files. Actually I get a 404 error, when I "inspect" what's
>>> going wrong.
>>>
>>> Some of the HTML files in my project are fully static (stored along with
>>> 403.html, 404.html, 500.html & 503.html) and display images stored in
>>> static/images folder. So I tried to link them the traditional way. (I
>>> assumed the URL builder cannot be used as the HTMLs are not processed by
>>> web2py before being served.)
>>>
>>> But it is not working. How should I link those images?
>>>
>>> I've tried different approaches but neither of them seems to work.
>>>
>>> a) relative path  (relative inside
>>> the app)
>>> b) relative path
>>>
>>>  (relative inside the
>>> web2py site)
>>>
>>> c) absolute path https://www.myweb.com.eus/myapp/static/images/forks_es.png"; />
>>>
>>> BTW, it may be important to note that I'm using the "routes.py" using
>>> the "parameter-based system" using:
>>>
>>> BASE  = dict(default_application='myapp')
>>>
>>> Thanks, Jon.
>>>
>>
>
> On my server, the following works for both links:
>
> 
> 
> 
> 
> 
> 
>
>
>  My global routes.py sets (using the "simple router" example)
>
> routers = dict(
> # base router
> BASE=dict(default_application='appOne',
>  root_static = ['favicon.ico, 'robots.txt'])
>
>
> and I used "app2/static/test-ess.html" to load the page.
>
> I also copied the html to appOne (already had the same logo in static
> images), and "static/test-ess.html" worked there; both copies of the logo
> were displayed.
>
> If you have a lot of static files, or some of them are large, you may want
> to see if you can serve them with your front-end.  I have a vague idea that
> PythonAnywhere uses Nginx, but I don't know if they give you any control of
> it.
>
> /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/8f4c309d-afb7-4ba7-83a5-85a98bbe72e0%40googlegroups.com
> 
> .
>


Libre
de virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
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/CAK8tz32WM3MAmtcHEZATdodDyoKE2xtLQ-4XdAv1QURBPyyE8A%40mail.gmail.com.


[web2py] Re: Adding custom attributes to fields and tables

2019-07-30 Thread 'jim kaubisch' via web2py-users
Similar question, but maybe simpler?

I have a table name which, for various reasons, isn't very human reader 
friendly (crowner). I'd like to add a table attribute (e.g. print_name = 
'Copyright Owners') to be used for table display instead of the table name 
itself
Does that mean db.table._extra = {'print_name' : 'Copyright Owners'} or ??? 
If so, how do I access that attribute? db.table.['print_name'] ???
Thanks

On Sunday, April 22, 2018 at 3:15:03 AM UTC-7, xelomac wrote:
>
> I want to add a custom attribute so that I can decide which customwidget 
> has to be used for a form field connected to that field.
> Example:
>
> db.define_table('person',
> Field('salutation', mycustomwidget='select2', label = T('Salutation'), 
> requires=IS_IN_SET(GENDER), represent=lambda v, r: GENDER[v]),
> Field('first_name', label = T('First Name')),
> format = '%(last_name)s')
>
>
> I had no luck defining that custom attribute the way it is described in 
> the book. How and and where would I define such a custom attribute 
> 'mycustomwidget' for the table 'person' or even better for all tables?
>
> Adding attributes to fields and tables
>
> If you need to add custom attributes to fields, you can simply do this:
>
> 1
>
> db.table.field.extra = {}
>
> "extra" is not a keyword ; it's a custom attributes now attached to the 
> field object. You can do it with tables too but they must be preceded by an 
> underscore to avoid naming conflicts with fields:
>
> 1
>
> db.table._extra = {} 
>
>
>

-- 
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/f7d701f7-81d5-4544-a77b-a2b4f397cfe2%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-07-30 Thread En Ware
in the documentation for 
http://py4web.com/_documentation/static/index.html#chapter-02. 
datetime.datime.now() (should that be datetime.datetime.now() ? 

On Tuesday, July 30, 2019 at 12:59:36 PM UTC-5, En Ware wrote:
>
> when using py4web source , py4web-start is missing. from pip py4web-start 
> exists. 
>
>
> On Wednesday, July 24, 2019 at 12:40:27 AM UTC-5, Massimo Di Pierro wrote:
>>
>> OK. I know. I am not good with names. 
>> But there are lots of requirements to be fulfilled.
>> py4web.com was available and the pypi package was available.
>> Here is running on google cloud:
>> http://py4web.com/
>>
>> Ducking...
>>
>>

-- 
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/0a5d4744-d922-4629-a479-234a31b5700d%40googlegroups.com.


[web2py] long() argument must be a string or a number, not 'list'

2019-07-30 Thread Kimus
bem tenho o seguinte problema dessa vez, estou tentando criar a primeira 
tabela com relacionamento, só que não to conseguindo inserir nd dos dados 
na tabela pq ele fica dando esse erro "long() argument must be a string or 
a number, not 'list' 
meu controller 
@auth.requires_login()
def CadastroPropriedade():
formulario = db.PropriedadeRural.insert(area=request.vars.area)
return dict(mensagem=" ")
meu BD : 
propriedadeRural = db.define_table('PropriedadeRural'
,Field('area','integer',label='Area de platação')
,Field('ano','date',label='ano da colheita')
,Field('lavoura','string',label='Tipo de cultivo')
,Field('producao','integer',label='Produção em sacos')
,Field('valorProducao','integer',label='Receita de Venda')
,Field('agricultor','references auth_user',label='Dono Da Lavoura'))

e o erro completo:

Número do Ticket

127.0.0.1.2019-07-30.12-01-32.d039c906-1e98-41a0-8ae5-e0657181b244
 long() argument must be a string or a number, 
not 'list'Versão
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 2.7.15+: /usr/bin/python (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

Traceback (most recent call last):
  File "/home/nti/Área de Trabalho/web2py/gluon/restricted.py", line 219, in 
restricted
exec(ccode, environment)
  File "/home/nti/Área de 
Trabalho/web2py/applications/ProjetoMargem/controllers/template.py" 
,
 line 66, in 
  File "/home/nti/Área de Trabalho/web2py/gluon/globals.py", line 421, in 

self._caller = lambda f: f()
  File "/home/nti/Área de Trabalho/web2py/gluon/tools.py", line 3869, in f
return action(*a, **b)
  File "/home/nti/Área de 
Trabalho/web2py/applications/ProjetoMargem/controllers/template.py" 
,
 line 21, in CadastroPropriedade
formulario = db.PropriedadeRural.insert(area=request.vars.area)
  File "/home/nti/Área de Trabalho/web2py/gluon/packages/dal/pydal/objects.py", 
line 762, in insert
ret = self._db._adapter.insert(self, row.op_values())
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 480, in insert
query = self._insert(table, fields)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 476, in _insert
','.join(self.expand(v, f.type) for f, v in fields))
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 476, in 

','.join(self.expand(v, f.type) for f, v in fields))
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 445, in _expand
rv = self.represent(expression, field_type)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 382, in 
represent
return super(SQLAdapter, self).represent(obj, field_type)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/adapters/base.py", line 336, in 
represent
return self.representer.represent(obj, field_type)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 251, 
in represent
rv = self.get_representer_for_type(field_type)(rv, field_type)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 139, 
in __call__
return self.adapt(self.call(value, field_type))
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 136, 
in _call
return self.inner_call(value)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 124, 
in _inner_call
return self.obj.f(self.representer, value, **kwargs)
  File "/home/nti/Área de 
Trabalho/web2py/gluon/packages/dal/pydal/representers/base.py", line 30, in 
_integer
return str(long(value))
TypeError: long() argument must be a string or a number, not 'list'

Momento do Erro [image: help] 


(long() argument must be a string or a number, 
not 'list')


-- 
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/56ca94ee-e430-439a-8c28-c20455f398d6%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-07-30 Thread En Ware
when using py4web source , py4web-start is missing. from pip py4web-start 
exists. 


On Wednesday, July 24, 2019 at 12:40:27 AM UTC-5, Massimo Di Pierro wrote:
>
> OK. I know. I am not good with names. 
> But there are lots of requirements to be fulfilled.
> py4web.com was available and the pypi package was available.
> Here is running on google cloud:
> http://py4web.com/
>
> Ducking...
>
>

-- 
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/c7543229-fd9d-4afb-a4cd-a82a104eefc2%40googlegroups.com.


Re: [web2py] Re: web3py -> py4web

2019-07-30 Thread villas
On Tuesday, 30 July 2019 07:35:08 UTC+1, Massimo Di Pierro wrote:
>
> I did not know about this. It has a cost. I'd rather not pay for it.
>

1. Just so you know, from GitBook Pricing  
page: 

> GitBook is free for open-source & non-profit teams 
>

2. Markdown instead of Markmin +1

-- 
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/66294a20-ba3c-4451-a978-2aba062914b6%40googlegroups.com.


[web2py] Questions about translations and pluralization

2019-07-30 Thread Константин Комков
1. If I want use plural for book without numbers what I need to do?
I want to write word - books.

2. If I write
T("You have %s %%{book}", symbols=10)
I get: You have 10 books
If I want to change language, like 
T.force('ru')
I get: 'You have 10 book'. I want to get: 'У меня есть 10 книг'
What I need to write in laguages/ru.py?

3. If I add to words in laguages/ru.py, like:
'add':'добавить',
'word':'слово',
I wrote:
T.force('ru')
T("add word")
I got: 'add word'
If I write:
T("add")+" "+T("word")
I get: 'добавить слово'. Are there way to translate both words in time?

4. If I want to get uppercase letter I tried use something like that:

%%{[][]}

but nothing work. How can I get: 'Add' or 'Добавить'?

Thank you!





-- 
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/0f0f53ee-24a6-461f-8468-f6430d649af9%40googlegroups.com.


[web2py] Re: Como editar um decoratordo web2py

2019-07-30 Thread Константин Комков
As variant, you can write decorator by yourself, like:
def yourDecorator(fun):
def decorated():

if (auth.user_id is not None):
redirect(URL('yourController','yourFunction'))
else:
return fun()
return decorated

@yourDecorator
def yourFunction():


-- 
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/421eafd7-87ab-4f8e-8838-82ddfa873911%40googlegroups.com.