Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-26 Thread Muhammad Atif Ayaz
Thank you Jim, it works.

Do you think a way that can help dynamically making a list of all fields of
a table and then we can remove specific fields from it.
Like the following which produces the required list but in the desired
data-type:
fields = [fld for fld in db.engagement.fields if fld!='token']
grid = SQLFORM.grid(db.engagement, fields=fields)


On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:

> Can you try with the field in the format:
>
> db.tablename.fieldname
>
> ex:
>
> fields = [db.engagement.id, db.engagement.name]
>
> -Jim
>
>
> On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:
>
>> Here is the code:
>> `fields=['id', 'name']`
>> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>>
>> Error:
>> `AttributeError('str' object has no attribute 'tablename')`
>>
>>
>> --
> 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/Ym3zsLYNePg/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/e19daf19-95c7-4e46-88da-74882bd4e51an%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/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com.


[web2py] Re: web2py ubuntu 16

2021-01-26 Thread Dave S
On Tuesday, January 26, 2021 at 4:33:59 AM UTC-8 Ovidio Marinho wrote:

>
>
> I installed web2py using the setup_ubuntu.sh script and
> I don't know what is happening with these errors
>
>
> restarting apage
> 
>  * Restarting web server apache2 AH00558: apache2: Could not reliably 
> determine the server's fully qualified domain name, using 127.0.1.1. Set the 
> 'ServerName' directive globally to suppress this message
> [...] 
>
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py", line 
> 4205, in pbkdf2_hex
> hmac = hashlib.pbkdf2_hmac (
> AttributeError: 'module' object has no attribute 'pbkdf2_hmac'
> done!
>
> I confess that I never saw this error.
>
> Please reveal the versions you are using of 

-- web2py
-- Python
-- Apache
-- Ubuntu

Please note that using Apache is not recommended unless you already have it 
working [for either web2py or other webservers]; new users are encouraged 
to use NginX.

/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/162436ec-d482-4d47-b15d-26c637f42784n%40googlegroups.com.


[web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-26 Thread Jim S
Can you try with the field in the format:

db.tablename.fieldname

ex:

fields = [db.engagement.id, db.engagement.name]

-Jim


On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:

> Here is the code:
> `fields=['id', 'name']`
> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>
> Error:
> `AttributeError('str' object has no attribute 'tablename')`
>
>
>

-- 
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/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com.


[web2py] web2py ubuntu 16

2021-01-26 Thread Ovidio Marinho
I installed web2py using the setup_ubuntu.sh script and
I don't know what is happening with these errors


restarting apage

 * Restarting web server apache2 AH00558: apache2: Could not reliably
determine the server's fully qualified domain name, using 127.0.1.1.
Set the 'ServerName' directive globally to suppress this message

[ OK ]
Traceback (most recent call last):
  File "", line 1, in 
  File "gluon / widget.py", line 27, in 
from gluon.shell import die, run, test
  File "gluon / shell.py", line 288
exec (read_pyc (pycfile), _env)
SyntaxError: unqualified exec is not allowed in function 'run' it
contains a nested function with free variables
admin password: ov0466
Traceback (most recent call last):
  File "", line 1, in 
  File "gluon / main.py", line 593, in save_password
fp.write ('password = "% s" \ n'% cpassword)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py",
line 4302, in __str__
hashed = simple_hash (self.password, key, salt, digest_alg)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py",
line 4223, in simple_hash
pbkdf2_hex (text, salt, int (iterations), int (keylen), get_digest (alg))
  File "/home/www-data/web2py/gluon/packages/dal/pydal/validators.py",
line 4205, in pbkdf2_hex
hmac = hashlib.pbkdf2_hmac (
AttributeError: 'module' object has no attribute 'pbkdf2_hmac'
done!

I confess that I never saw this error.






  *Ovidio Marinho Falcao Neto*
 ovidio...@gmail.com
Brasil

-- 
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/CAPwik%3DL6HR8v-HC%3D%3Dd_9sqRXRzEj_%3DeG7CbJUb%2Bbf7NGDiGwUw%40mail.gmail.com.