[web2py] Re: CMS WEB2PY

2016-02-18 Thread Jörg Schneider
I was able to built a Custom-CMS for a refugee helper association only by watching the videos an reading the manual. I do only have really basic knowledge in programming and because Joomla and Wordpress didn't fit my needs I started from the scratch with web2py which is really a cool framework.

[web2py] Where does a login action go?

2016-02-18 Thread Dave S
I'm trying to futz around a user's problem on a Windows client, so I'm learning about Invoke-WebRequest in PowerShell. https://technet.microsoft.com/en-us/library/hh849901.aspx> I'm following the Facebook login example on that page, but trying to log into my app. I can get the login form correc

[web2py] Session variables and multiple browser tabs

2016-02-18 Thread Jim S
Hi Is there a way to keep independent session variables between two open browser tabs? Example 1. write a session variable in tab 2 2. switch to tab 1 and execute the same page setting the session variable to a different value 3. go back to tab 2 and request page that reads the session vari

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Anthony
If you alternatively want a login form or the main form to appear in the modal, and upon login you want the login form replaced with the main form in the modal (without having to re-click the apply button), it seems using an Ajax component would be the most straightforward approach. Anthony On

[web2py] Re: Old field value returns in custom select widget

2016-02-18 Thread Anthony
When you pass a record to SQLFORM, it retains the changed values by passing the values in request.post_vars to the respective field widgets. Can't say what's going on in your case without the code. Anthony On Thursday, February 18, 2016 at 4:13:23 PM UTC-5, Ian W. Scott wrote: > > The code is v

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Ron Chatterjee
Yes. Exactly On Thursday, February 18, 2016 at 6:23:44 PM UTC-5, Najtsirk wrote: > > If I do understand you correct: you want to have in the same modal form: > >- if the user is logged in: a form for submitting a new Post; >- if the user is not logged in: a login form. > > Is that correct?

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Najtsirk
If I do understand you correct: you want to have in the same modal form: - if the user is logged in: a form for submitting a new Post; - if the user is not logged in: a login form. Is that correct? On Thursday, 18 February 2016 23:22:19 UTC+1, Ron Chatterjee wrote: > > Here in the picture

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Ron Chatterjee
Here in the picture I explained. Once I click on the button, I do display the form in my modal. But that display inside the modal can only be if the user signed in or the request to sign in. If I could do something like this. def process_form(): form = SQLFORM(db.post).process() return l

[web2py] Re: Old field value returns in custom select widget

2016-02-18 Thread Ian W. Scott
The code is very extensive (it's a complex widget) so first I'm just trying to understand what happens in a normal form. You say that other widgets aren't preserving values from the db. So where do the values come from if you have keepvalues=True? Also, this *is* a situation where an existing r

[web2py] Re: Old field value returns in custom select widget

2016-02-18 Thread Anthony
On Thursday, February 18, 2016 at 3:54:43 PM UTC-5, Ian W. Scott wrote: > > Okay, that explains the behaviour. How, then, are values usually preserved > on an ajax form for the built-in widgets? When I submit the form all of the > other fields (not using my widget) preserve the newly submitted va

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Anthony
On Thursday, February 18, 2016 at 3:58:08 PM UTC-5, Ron Chatterjee wrote: > > Yes. Or if there is a way to add @auth.requires_login() to the table > itself. In other words, SQLFORM will validate if the user is logged in or > not based on that flag. like requires=IS_NOT_EMPTY(). Similar to that >

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Ron Chatterjee
Yes. Or if there is a way to add @auth.requires_login() to the table itself. In other words, SQLFORM will validate if the user is logged in or not based on that flag. like requires=IS_NOT_EMPTY(). Similar to that requires = IS_LOGGED_IN(). But there isn't anything like that. lol. So, yes, I nee

[web2py] Re: Old field value returns in custom select widget

2016-02-18 Thread Ian W. Scott
Okay, that explains the behaviour. How, then, are values usually preserved on an ajax form for the built-in widgets? When I submit the form all of the other fields (not using my widget) preserve the newly submitted values. Ian On Thursday, February 18, 2016 at 3:51:59 PM UTC-5, Anthony wrote: >

[web2py] Re: Old field value returns in custom select widget

2016-02-18 Thread Anthony
Hard to say without seeing more code, but note that the widgets are constructed before any database IO, so any database changes from the current submission will not be reflected in the returned copy of the form. Anthony On Thursday, February 18, 2016 at 3:40:32 PM UTC-5, Ian W. Scott wrote: > >

[web2py] Old field value returns in custom select widget

2016-02-18 Thread Ian W. Scott
I've got a custom select widget class that is working nicely except that when I submit a form via ajax the refreshed widget shows the old (pre-submission) field value. But the changes have been made properly to the database. If I refresh the page containing the form (not via ajax) the new corre

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Anthony
In that case, you could add logic to the view to only include the form if the user is logged in. If the user is not logged in, then the apply button should instead redirect to the login (with a _next variable set to return to the page with the form) rather then letting them fill in the form only

[web2py] Re: Flash message if before_insert fail

2016-02-18 Thread Anthony
There are several problems. First, note that by default, form.process() sets the flash message after processing, and that happens *after* the database insert -- so the flash message you set in the _before_insert callback gets overwritten. Second, even though your callback prevents the insert, t

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Ron Chatterjee
Thank you Anthony. I will try that. I was using the model content to render a form. So, I want user to see the entire page and when click on the "Apply" for example, the form shows up in the pop up. So I don't have a view or the controller for the form. Its all hard coded in the same view which

[web2py] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Anthony
Are you saying you want users to be able to view a page with a form, but if they submit the form without being logged in they should be redirected to login? That doesn't seem like the best user experience, but you could do: def my_function(): if request.post_vars and not auth.user: r

[web2py] @auth.requires_login() in the model instead of controller

2016-02-18 Thread Ron Chatterjee
Is it possible to define @auth.requires_login() in the model or when the form is processed rather than @auth.requires_login() def my_function(): I would like to have everyone view a page but only when the form is processed or accessed within that function definition, I would like user to sign

[web2py] Re: CMS WEB2PY

2016-02-18 Thread Ron Chatterjee
Is this the same reason that this dont work with bootstrap 3? response.title = A(IMG(_src=URL('static', 'images/something.png'))) response.subtitle = 'Find all the latest blogs here' This CMS is using bootstrap2 not bootstrap3? On Thursday, February 18, 2016 at 1:24:06 PM UTC-5, Antonio Salaz

[web2py] Re: CMS WEB2PY

2016-02-18 Thread Antonio Salazar
Bootstrap3 discontinued submenu support in dropdown menus, which is to say we are limited to two-level menus. I guess you'll have to redesign the navigation or somehow re-add dropdown submenus. Congratulations! I was eagerly expecting to cjeck your CMS, but didn't see this on time, sorry for co

[web2py] Changing the first day of week of the calendar widget

2016-02-18 Thread Antonio Salazar
The first day of week is important because the week number is dependent on it. It currently is Sunday, but I need it to be Monday. Example: January 1st 2016 is in week 52 if the first day is Sunday, but it's in week 53 if the first day is Monday. I tried including the parameter *fdow: 1* in the

[web2py] Re: apache2/pam/pwauth to remove www-data from shadow group

2016-02-18 Thread kwebb
I finally resolved this. Turns out PAM is not actually calling pwauth. A simple bit of code: proc = subprocess.Popen('/usr/sbin/pwauth', stdin=subprocess.PIPE) proc.communicate('%s\n%s\n'%(username, password)) return proc.returncode == 0 Does the trick. I will formaliz

Re: [web2py] Re: CMS WEB2PY

2016-02-18 Thread Ron Chatterjee
Carlos, Where can I download "www.daxslab.com ,"? On Tuesday, October 13, 2015 at 9:17:20 AM UTC-4, Carlos Cesar Caballero wrote: > > I am working on a site that is builded using cust

[web2py] Re: Flash message if before_insert fail

2016-02-18 Thread Ivan Gazzola
### Controller for poc form def insert_poc(): form=SQLFORM(db.poc) if form.process().accepted: response.flash = T('Record added') return dict(form=form) I've posted the full model, the function is colled in _before_insert: db.poc._before_insert.append(lambda dati: controlla_

[web2py] Re: Flash message if before_insert fail

2016-02-18 Thread Anthony
We need to see the full code, including the controller. In particular, you show a callback function, but you do not show where it is called. Anthony On Thursday, February 18, 2016 at 8:55:49 AM UTC-5, Ivan Gazzola wrote: > > > db.define_table('poc', > Field >

[web2py] Re: Rows not releasing all the memory back

2016-02-18 Thread Jitun John
Issue is kind of resolved. I created a dummy.. small sqlite file and read that sqlite the same way as large ones are done. and then do for row in some_rows.exclude(lambda row: row.id > 0) again. This tends to free up memory. -- Resources: - http://web2py.com - http://web2py.com/book (Document

[web2py] Re: I used a layout rom external and my navbar colour changed to green. How to change its colour again?

2016-02-18 Thread Niphlod
ask the creator of the theme ?!?!?! this is not a web2py issue : it's a css issue. On Thursday, February 18, 2016 at 3:57:32 PM UTC+1, RAGHIB R wrote: > > > > > >data-toggle="collapse" data-target=".navbar-collapse"> > Toggle navigation > >

[web2py] Re: Flash message if before_insert fail

2016-02-18 Thread Ivan Gazzola
db.define_table('poc', Field ('Name',required=True), Field ('Birthday','date',widget=bsdatepicker_widget(),required=True), Field

[web2py] Re: multiple versions of same table in database folder

2016-02-18 Thread Niphlod
or just remove all files, set fake_migrate_all=True, hit appadmin, set fake_migrate_all=False and enjoy having your databases folder with just the necessary .table files. On Thursday, February 18, 2016 at 8:15:38 AM UTC+1, Nico de Groot wrote: > > The table files contain the field information.

[web2py] Re: Smartgrid and onvalidation for child tables

2016-02-18 Thread Seraaj Muneer
Feature request reaised https://github.com/web2py/web2py/issues/1188 On Wednesday, 17 February 2016 16:48:49 UTC, Seraaj Muneer wrote: > > Hello everyone, according to the Book, the smartgrid can be passed a map > of parameters, eg searchable=dict(parent=True, child=False), and this will > be pa

[web2py] SQLFROM.gird

2016-02-18 Thread Charles tenorio
I have two forms, the first is the textbox, another form one grid with a button. when this button is clicked get value of the column and put in textbox -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Flash message if before_insert fail

2016-02-18 Thread Anthony
Please show your code. -- 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-

[web2py] Re: ubuntu web2py

2016-02-18 Thread Mirek Zvolský
Another problem with nginx/uwsgi script (ubuntu/debian): On my virtual server (forpsi) I have just one user, root, and 'sudo' was not installed. So commands like 'sudo mkdir ...' has failed and many files were not created. So check 'sudo' first if running as root user. apt install sudo-ldap or

Re: [web2py] Re: ubuntu web2py

2016-02-18 Thread Mirek Zvolský
Hi Jim, At github.com/zvolsky/web2py I have a new script which probably works: https://github.com/zvolsky/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh Should I generate push request? If you will do it, then you can take a look to my changes: sudo mkdir /etc/systemd sudo mkdir /et

[web2py] Flash message if before_insert fail

2016-02-18 Thread Ivan Gazzola
How can I change that? I've tried to change response.flash in callback function but this doesn't work properly, I always get the "new record inserted" message even if the record is not stored in DB. Thx Ivan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://