py4web questions

760 views
Skip to first unread message

John Bannister

unread,
Sep 25, 2019, 12:37:04 PM9/25/19
to web2py-users
Hi All,

Today have managed to play a bit with py4web with the view to developing a real-life app using the framework.

In so doing I have hit a few 'challenges' which I am hoping someone will be able to help me with.

1: User will log in via default controller and based on access rights will get appropriate menus/level of access. How to do this in py4web? I see there is a tags db generated as part of the auth initialisation but I cannot see how to utilise this to set up user/ groups /roles etc. Some guidance or direction would be most useful.

Looks like I am missing something really simple and/or have probably been spoilt by Web2Py

Thanks in advance
John


Massimo Di Pierro

unread,
Sep 26, 2019, 3:02:06 AM9/26/19
to web2py-users
Good question. I will try post a tutorial in the next few days. But the idea is you associate tags to a user and then give permissions based on the tags. The tag API is very simple so I recommend you meanwhile look at the source.

John Bannister

unread,
Sep 26, 2019, 4:02:42 AM9/26/19
to web...@googlegroups.com
Thanks Massimo much appreciated and looking forward to the tutorial. Will check out the tag API in the meantime.
--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/b6009627-7b67-405f-a98e-1dbcb5dbb1e2%40googlegroups.com.

John Bannister

unread,
Sep 26, 2019, 5:05:52 AM9/26/19
to web...@googlegroups.com
Hi  Massimo,

Have one more question which may or may not be related.

I have multiple controllers all including the same layout.html. In the layout.html the navbar should display the user logged in (or not). I see in the _scaffold app the login menu is created using globals().get('user') which works fine if we are returning the user=auth.get_user() to the template.

Question is do I need to return user=auth.get_user() from each action or is there some way of accessing the user/login information from the templates and in particular layout.html? 

And one more which is how to deal with images in py4web? I have tried to upload an image using field of type upload using standard Form. When I look at the record again or try to edit it says no image selected. Guess there is the equivalent of download missing somewhere. Any help appreciated.

John
-----Original Message-----
From: web...@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of Massimo Di Pierro
Sent: 26 September 2019 09:02
To: web2py-users
Subject: [web2py] py4web questions

--
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+unsubscribe@googlegroups.com.

Bruno Sarverry

unread,
Jan 21, 2020, 1:55:28 AM1/21/20
to web2py-users
Hello John! did you solve it? I have the same problem.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

Massimo Di Pierro

unread,
Jan 22, 2020, 1:24:09 AM1/22/20
to web2py-users

Klaus Zinser

unread,
Feb 6, 2020, 5:48:20 PM2/6/20
to web2py-users
After installing the py4web code from source it works well. I am very positive surprised what already possible with py4web. Thank you Massimo for the detailed description in the manual 

"Once py4web is installed you can access the apps at the following urls:

Unfortunately I did not manage to get into a database table to see the individual records. Most realistic its an access right issue.

In the manual/tutorial - http://py4web.com/_documentation/static/index.html#chapter-03 - access to a record is shown. 

On the py4web application there is a password in use. 

Klaus Zinser

unread,
Feb 9, 2020, 4:37:04 PM2/9/20
to web2py-users
When I posted the problem I was abroad with the notebook. Now I am back working with another PC. The Py4Web installation is very similar except OSX now more recent as the PC is new. When pressing the db-table button e.g. db.person ist possible to maintain records. I could have deleted this entry. But in case someone else has a similar issue its maybe better to keep it. 
For me its solved (and if there is a chance I will try to report the reason, Klaus

---
Reply all
Reply to author
Forward
0 new messages