[web2py] Re: SQLFORM.grid change form vars

2016-03-14 Thread Anthony
You can use formargs, editargs, createargs, and viewargs to pass arguments 
to the SQLFORM calls for create/edit/view forms. You can also set the 
readable/writable attributes of individual fields to prevent them from 
being displayed in the forms.

Anthony

On Tuesday, March 15, 2016 at 1:10:48 AM UTC-4, Vinyl Darkscratch-Kazotetsu 
wrote:
>
> It doesn't seem like anyone else has run into this particular issue 
> before.  I have an SQLFORM grid that is allowing my staff members on our 
> website to add links to their profile upon the crew page.  An example is 
> mine at https://www.nightwave.me/crew?member=VinylDarkscratch
> However, I found out that SQLFORM.grid does not take a *fields* parameter 
> like normal SQLFORM does, and as such staff members have access to edit 
> fields they should not be able to, such as the user ID.  So, I attempted to 
> set a default for the fields, in the controller function, to be the value 
> that I'd like it to be, however I had gotten the following error:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
>
> Traceback (most recent call last):
>   File "/home/vinyldarkscratch/nightwave/gluon/restricted.py", line 227, in 
> restricted
> exec ccode in environment
>   File 
> "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
>  , line 
> 294, in 
>   File "/home/vinyldarkscratch/nightwave/gluon/globals.py", line 412, in 
> 
> self._caller = lambda f: f()
>   File "/home/vinyldarkscratch/nightwave/gluon/tools.py", line 3774, in f
> return action(*a, **b)
>   File 
> "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
>  , line 
> 68, in submit_bio_links
> linkform = SQLFORM.grid((db.user_links.user_id == auth.user.id))
>   File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 2264, in grid
> onsuccess=oncreate)
>   File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2301, in process
> self.validate(**kwargs)
>   File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2238, in 
> validate
> if self.accepts(**kwargs):
>   File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 1711, in 
> accepts
> self.vars.id = self.table.insert(**fields)
>   File 
> "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 
> 712, in insert
> ret = self._db._adapter.insert(self, self._listify(fields))
>   File 
> "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 
> 658, in _listify
> 'Table: missing required field: %s' % name)
> RuntimeError: Table: missing required field: user_id
>
>
> Any suggestions on how to set a field's value in an SQLFORM.grid after 
> submission?
>

-- 
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] SQLFORM.grid change form vars

2016-03-14 Thread Vinyl Darkscratch-Kazotetsu
It doesn't seem like anyone else has run into this particular issue before. 
 I have an SQLFORM grid that is allowing my staff members on our website to 
add links to their profile upon the crew page.  An example is mine 
at https://www.nightwave.me/crew?member=VinylDarkscratch
However, I found out that SQLFORM.grid does not take a *fields* parameter 
like normal SQLFORM does, and as such staff members have access to edit 
fields they should not be able to, such as the user ID.  So, I attempted to 
set a default for the fields, in the controller function, to be the value 
that I'd like it to be, however I had gotten the following error:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.

Traceback (most recent call last):
  File "/home/vinyldarkscratch/nightwave/gluon/restricted.py", line 227, in 
restricted
exec ccode in environment
  File 
"/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
 , line 
294, in 
  File "/home/vinyldarkscratch/nightwave/gluon/globals.py", line 412, in 

self._caller = lambda f: f()
  File "/home/vinyldarkscratch/nightwave/gluon/tools.py", line 3774, in f
return action(*a, **b)
  File 
"/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
 , line 
68, in submit_bio_links
linkform = SQLFORM.grid((db.user_links.user_id == auth.user.id))
  File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 2264, in grid
onsuccess=oncreate)
  File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2301, in process
self.validate(**kwargs)
  File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2238, in validate
if self.accepts(**kwargs):
  File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 1711, in 
accepts
self.vars.id = self.table.insert(**fields)
  File "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", 
line 712, in insert
ret = self._db._adapter.insert(self, self._listify(fields))
  File "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", 
line 658, in _listify
'Table: missing required field: %s' % name)
RuntimeError: Table: missing required field: user_id


Any suggestions on how to set a field's value in an SQLFORM.grid after 
submission?

-- 
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: Oracle Driver Not Available When web2py run from bash script

2016-03-14 Thread Ben Wolski
Yes, the path/user/versions were all the same. I figured out that even 
though the $DYLD_LIBRARY_PATH and $LD_LIBRARY_PATH environment variables 
are set correctly in an interactive bash terminal, a bash script cannot see 
those same variables. Something must be overwriting them, so now I'm just 
setting those variables in the same script that I'm using to start web2py. 
Thanks! -- Benjamin Wolski

El lunes, 22 de febrero de 2016, 1:04:03 (UTC-8), Niphlod escribió:
>
> are they running from the same path and under the same user ?
>
> On Monday, February 22, 2016 at 7:00:07 AM UTC+1, Ben Wolski wrote:
>>
>> Hi all! I'm connecting to an Oracle db for the first time and I hit a 
>> snag when trying to start web2py from a bash script. 
>>
>>
>> As you can see highlighted below, running the command as a script fails 
>> to find the oracle driver, but running from the command line does.
>>
>>
>> Any ideas why this would be?
>>
>>
>> Thanks!
>>
>> Benjamin
>>
>>
>> $ cat run_server.sh 
>> #!/bin/bash
>> python web2py.py -a 'password' -i 10.2.24.61 -p 8000
>>
>>
>>
>>
>> $ bash run_server.sh 
>> web2py Web Framework
>>
>>  
>> Created by Massimo Di Pierro, Copyright 2007-2016 
>>
>> Version 2.13.4-stable+timestamp.2015.12.26.04.59.39 
>>
>> Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000 
>>
>>
>>  
>>
>> please visit: 
>>
>>  http://10.2.24.61:8000/ 
>>
>> use "kill -SIGTERM 6115" to shutdown the web2py server
>>
>>
>>
>>
>> $ python web2py.py -a 'password' -i 10.2.24.61 -p 8000
>>
>> web2py Web Framework
>>
>> Created by Massimo Di Pierro, Copyright 2007-2016
>>
>> Version 2.13.4-stable+timestamp.2015.12.26.04.59.39
>>
>> Database drivers available: cx_Oracle, pymysql, imaplib, sqlite3, pg8000, 
>> pyodbc
>>
>>
>> please visit:
>>
>> http://10.2.24.61:8000/
>>
>> use "kill -SIGTERM 6122" to shutdown the web2py server
>>
>>
>>

-- 
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: restricting load calls with its html parent permission

2016-03-14 Thread Ben Lawrence
Thanks Anthony. It took me a while to get this to work. 
There were two things in my code that that made calling the LOAD return a 
"Not Authorized"
1. {{('message' in globals())}}  at the top of the calling html file. I had 
to delete this.
2. LOAD(... ajax=False, user_signature=True)  i.e. I have to have ajax=True

After correcting for these, your suggestion worked.



On Monday, March 7, 2016 at 1:47:40 PM UTC-8, Anthony wrote:
>
> You can use a digital signature: 
> http://web2py.com/books/default/chapter/29/04/the-core#Digitally-signed-urls
>
> When creating the component, do LOAD(..., user_signature=True). Then 
> decorate your component actions with @auth.requires_signature().
>
> Anthony
>
> On Monday, March 7, 2016 at 3:58:25 PM UTC-5, Ben Lawrence wrote:
>>
>> Hi
>>
>> I just need a little advice here.
>>
>> There are logged in users on my website that are given permission to 
>> access a particular html page. The page changes depending on the user 
>> logged in. The controller decides on whether the user can access that page 
>> or not. 
>>
>> The html page calls LOADs. How do I properly secure these LOAD calls with 
>> the same permission as the html parent? (Otherwise people can just put the 
>> LOAD file address in the browser and see it.)
>>
>> Now, I am running the same database checks in the LOAD as in the html, so 
>> there is duplication here. Should I use the http referrer 
>> request.env.http_referer to check that the caller is correct or is there a 
>> better way?
>>
>> Thanks for your time.
>>
>

-- 
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: Update all languages not catching Markmin

2016-03-14 Thread Vinyl Darkscratch-Kazotetsu
Opened a ticket for this particular issue on GitHub 
at: https://github.com/web2py/web2py/issues/1206

On Sunday, March 13, 2016 at 6:05:08 PM UTC-7, Vinyl Darkscratch-Kazotetsu 
wrote:
>
> I tried both the most recent stable, and the trunk, though neither of them 
> have functioned, sadly.  I'll attempt the trunk version once again, and see 
> if it works...
>
> On Saturday, March 12, 2016 at 9:55:53 PM UTC-8, Massimo Di Pierro wrote:
>>
>> Most recent stable or trunk?
>>
>> On Saturday, 12 March 2016 23:42:06 UTC-6, Vinyl Darkscratch-Kazotetsu 
>> wrote:
>>>
>>> I've been having this issue since updating to the most recent web2py 
>>> version.  On two of the sites I have coded, Markmin is extensively used. 
>>>  Unfortunately, I've noticed that calls to T.M() aren't being detected in 
>>> the language file updates, which means that I am unable to obtain most of 
>>> my content to add into the translations and would have to do it manually.
>>>
>>> I am hoping to avoid the manual extraction to prevent future conflicts 
>>> with various updates.  Are there any suggestions that would help with this 
>>> issue?
>>>
>>

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
Yes, got it now. Actually, it will happen in a controller as well if you 
run that code at the top level rather than inside a function (will also 
happen if you run the code in a view). It seems to be a general problem 
with saving dictionaries to the session, and it is triggered not only by 
iterating over the dictionary but even by getting a single value from the 
dictionary.

I'm not sure what a good solution would be, as it seems to be a problem 
with cPickle. We could switch to a lower protocol or to pickle, but that 
would slow things down.

Anthony

On Monday, March 14, 2016 at 8:29:16 PM UTC-4, Alex wrote:
>
> If the code (e.g. iterating user_groups) is in a controller everything is 
> fine and the session file is not written. But just put this code
>
> if auth.user_id:
> for role in auth.user_groups.itervalues():
> continue
>
>
> in db.py of the welcome app after auth.define_tables and the session file 
> will be overridden on every request. So the difference is if the session is 
> changed (or the pickled session to be more concrete) in a model file or a 
> controller.
>
> I've tested this with the welcome app, I can upload it if needed but I 
> guess it's not really necessary.
>

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Alex
If the code (e.g. iterating user_groups) is in a controller everything is 
fine and the session file is not written. But just put this code

if auth.user_id:
for role in auth.user_groups.itervalues():
continue


in db.py of the welcome app after auth.define_tables and the session file 
will be overridden on every request. So the difference is if the session is 
changed (or the pickled session to be more concrete) in a model file or a 
controller.

I've tested this with the welcome app, I can upload it if needed but I 
guess it's not really necessary.

-- 
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: How to do this? Obviously I need ajax but what's the exact syntax?

2016-03-14 Thread Leonel Câmara
Make a form with a hidden input and a submit button. Display all the 
images, add javascript so when one image is clicked it becomes "selected" 
and its id is added to the hidden input (for instance the hidden input can 
store the values comma separated). Submit the form and in your controller 
you should have the selected images in the hidden input's name. You can 
then validate it using something like:

values, error = IS_IN_DB(db, 'pictures.id', multiple=True, 
delimiter=',')(request.vars.hidden_input_name)

Finally after checking error is None insert the values into choices:

for value in values:
db.choices.insert(user_id=auth.user_id, choice=value)

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
Interestingly, the following code does seem to trigger overwrites of the 
session file (though not consistently):

 temp = BEAUTIFY(session)

Not sure what's going on there.

Anthony

On Monday, March 14, 2016 at 7:42:53 PM UTC-4, Anthony wrote:
>
> I'm on Windows with the same web2py and Python versions.
>
> On Monday, March 14, 2016 at 7:00:16 PM UTC-4, Alex wrote:
>>
>> I don't think a test app is that simple to create. It needs a db, 
>> auth_user table, user entry with memberships, login form ... because the 
>> issue only occurs if you're logged in.
>>
>
> Just start with the welcome app -- it has everything you need. Just 
> register a single user and log in.
>  
>
>> It is true that the pickled sessions are different after iterating the 
>> user_groups as confirmed by Anthony.
>>
>
> Yes, but it appears that the pickling itself (in your code) leads to that 
> issue. The real question, though, is whether the session file is 
> overwritten on each request, and if you just iterate over auth.user_groups 
> (with no pickling code), it does not appear that the session file is in 
> fact overwritten.
>  
> So, start with a fresh copy of the welcome app, register a user, log in, 
> and add some code to iterate over auth.user_groups. Then observe directly 
> the mtime of the session file and see if it changes with each request. If 
> so, pack the application and post it here.
>
> 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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
I'm on Windows with the same web2py and Python versions.

On Monday, March 14, 2016 at 7:00:16 PM UTC-4, Alex wrote:
>
> I don't think a test app is that simple to create. It needs a db, 
> auth_user table, user entry with memberships, login form ... because the 
> issue only occurs if you're logged in.
>

Just start with the welcome app -- it has everything you need. Just 
register a single user and log in.
 

> It is true that the pickled sessions are different after iterating the 
> user_groups as confirmed by Anthony.
>

Yes, but it appears that the pickling itself (in your code) leads to that 
issue. The real question, though, is whether the session file is 
overwritten on each request, and if you just iterate over auth.user_groups 
(with no pickling code), it does not appear that the session file is in 
fact overwritten.
 
So, start with a fresh copy of the welcome app, register a user, log in, 
and add some code to iterate over auth.user_groups. Then observe directly 
the mtime of the session file and see if it changes with each request. If 
so, pack the application and post it here.

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: session always written if auth.user_groups is accessed

2016-03-14 Thread Alex
I don't think a test app is that simple to create. It needs a db, auth_user 
table, user entry with memberships, login form ... because the issue only 
occurs if you're logged in.

It is true that the pickled sessions are different after iterating the 
user_groups as confirmed by Anthony. Therefor session._unchanged should 
also be false for you, please check the return value after iterating the 
user_groups. If this is also false for you then the session will be written 
- response.session_id is set (because logged in), self._forget is not set 
and self._unchanged returns false.

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Niphlod
got that but trust /me and @Anthony, we're pretty accustomed with the code.
I can't replicate and @Anthony seems neither.
I'm on win, 2.7.9, and tested all stable releases from 2.6.1 to latest, and 
can't see the session change (i.e. the file being updated) while iterating 
user_groups.
Something else is going on with your app (or your env). 
Can you replicate the behavior just starting from a simple scaffolding app, 
with a controller (i.e. /appname/default/testme ) that iterates (and 
prints, just to be on the "blind" side) roles ?
If yes, can you pack it ? 

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Alex
On Monday, March 14, 2016 at 10:08:34 PM UTC+1, Anthony wrote:
>
> On Monday, March 14, 2016 at 4:14:42 PM UTC-4, Alex wrote:
>>
>> no, I don't have response.toolbar in my view. The issue should be 
>> reproducible with the code snippet above - assuming you are logged in and 
>> have a membership (i.e. auth.user_groups has at least one item).
>>
>
> It's true that you code does result in the two pickles not being 
> equivalent. However, at least for me, merely iterating over 
> auth.user_groups does *not* result in the session file being overwritten 
> on each request. However, the session file is overwritten on each request 
> when response.toolbar() is included (more specifically, when 
> BEAUTIFY(session) is serialized in the view -- no idea why that has an 
> effect, though).
>
> Anthony
>

If the two pickles are different it should result in the session being 
written. If you try this code:

if auth.user_id:

import cPickle as pickle

unchanged1 = session._unchanged(response)

session_pickled1 = pickle.dumps(session, pickle.HIGHEST_PROTOCOL)
for role in auth.user_groups.itervalues():
continue
session_pickled2 = pickle.dumps(session, pickle.HIGHEST_PROTOCOL)
eq = (session_pickled1 == session_pickled2)

unchanged2 = session._unchanged(response)


unchanged1 should be True and unchanged2 False. And if the session is not 
unchanged it will be written (gluon/globals.py), depending on the session 
type. E.g. in _try_store_in_file for file sessions there is the following 
check

if (not response.session_id or self._forget
or self._unchanged(response)):


which returns False, thus the session will be written

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Alex
web2py version 2.12.3 (the code for testing if the session has changed is 
the same in the current version), Python 2.7.5 and Windows.

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
Also, which version of web2py and Python, and which platform?

On Monday, March 14, 2016 at 5:08:34 PM UTC-4, Anthony wrote:
>
> On Monday, March 14, 2016 at 4:14:42 PM UTC-4, Alex wrote:
>>
>> no, I don't have response.toolbar in my view. The issue should be 
>> reproducible with the code snippet above - assuming you are logged in and 
>> have a membership (i.e. auth.user_groups has at least one item).
>>
>
> It's true that you code does result in the two pickles not being 
> equivalent. However, at least for me, merely iterating over 
> auth.user_groups does *not* result in the session file being overwritten 
> on each request. However, the session file is overwritten on each request 
> when response.toolbar() is included (more specifically, when 
> BEAUTIFY(session) is serialized in the view -- no idea why that has an 
> effect, though).
>
> 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: session always written if auth.user_groups is accessed

2016-03-14 Thread Niphlod
BTW: can't replicate myself either with your piece of code.

On Monday, March 14, 2016 at 10:08:34 PM UTC+1, Anthony wrote:
>
> On Monday, March 14, 2016 at 4:14:42 PM UTC-4, Alex wrote:
>>
>> no, I don't have response.toolbar in my view. The issue should be 
>> reproducible with the code snippet above - assuming you are logged in and 
>> have a membership (i.e. auth.user_groups has at least one item).
>>
>
> It's true that you code does result in the two pickles not being 
> equivalent. However, at least for me, merely iterating over 
> auth.user_groups does *not* result in the session file being overwritten 
> on each request. However, the session file is overwritten on each request 
> when response.toolbar() is included (more specifically, when 
> BEAUTIFY(session) is serialized in the view -- no idea why that has an 
> effect, though).
>
> 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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
On Monday, March 14, 2016 at 4:14:42 PM UTC-4, Alex wrote:
>
> no, I don't have response.toolbar in my view. The issue should be 
> reproducible with the code snippet above - assuming you are logged in and 
> have a membership (i.e. auth.user_groups has at least one item).
>

It's true that you code does result in the two pickles not being 
equivalent. However, at least for me, merely iterating over 
auth.user_groups does *not* result in the session file being overwritten on 
each request. However, the session file is overwritten on each request when 
response.toolbar() is included (more specifically, when BEAUTIFY(session) 
is serialized in the view -- no idea why that has an effect, though).

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: session always written if auth.user_groups is accessed

2016-03-14 Thread Niphlod
there's a bit of machinery added to sessions to see if it actually changed 
or not. Actually there was an issue (referenced in the commit log as 1524, 
which ATM I can't find) which was fixed by the whole shebang of 
sorting_pickler in 2.6.0

On Monday, March 14, 2016 at 9:14:42 PM UTC+1, Alex wrote:
>
> no, I don't have response.toolbar in my view. The issue should be 
> reproducible with the code snippet above - assuming you are logged in and 
> have a membership (i.e. auth.user_groups has at least one item).
>

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Alex
no, I don't have response.toolbar in my view. The issue should be 
reproducible with the code snippet above - assuming you are logged in and 
have a membership (i.e. auth.user_groups has at least one item).

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


Re: [web2py] please help with new widgets

2016-03-14 Thread Dave S


On Monday, March 14, 2016 at 10:55:53 AM UTC-7, Dave S wrote:
>
>
>
> On Monday, March 14, 2016 at 12:41:03 AM UTC-7, José L. wrote:
>>
>> Massimo, I'm missing all the time a grid (sqlgrid) widget in these 
>> examples. Aren't you considering it, or it's just it's not needed as the 
>> style will apply and look good in the three cases?
>> Sqlgrid is one of the most powerful objects in web2py forms and I think 
>> most of us could not live without it ;)
>>
>
> He's got a replacement in mind, and this is a preparatory step.  The new 
> one is going to be in Forms.py, and I think he's posted a simple example in 
> another thread.
>


form.py, which is mentioned at the top of the thread, but the only 
discussion is in the dev group, where this example was shown:

ef index():
from gluon.form import Form
form = Form(db.thing, request.args(0))
if form.accepted: ...
elif form.errors: ...
else: ...
return dict(form=form)

or

def index():
from gluon.form import Form
form = Form([Field(’name’),Field(‘age’,’integer’)])
if form.accepted: ...
elif form.errors: ...
else: ...
return dict(form=form)


/dps
 

>  
>

>> 2016-03-14 7:34 GMT+01:00 joseph simpson :
>>
>>> Should be:
>>>
>>> http://mdipierro.github.io/stupid.css/widgets/materialize.html
>>>
>>> On Sun, Mar 13, 2016 at 11:32 PM, joseph simpson  
>>> wrote:
>>>
 I get a 404 on the:

 http://mdipierro.github.io/stupid.css/widgets/metarialize.html

 page..

 Take care and have fun..

 Joe

 On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro <
 massimo@gmail.com> wrote:

> can somebody help me with this little project?
>
> http://mdipierro.github.io/stupid.css/widgets/index.html
> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> Specifically, can you read the instructions? Do they make sense? can 
> you help extend them? Does everything work for you?
> I am planning to release a new library for web2py called form.py that 
> will replace SQLFORM and use the new widgets.
>
> Massimo
>
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.
>



 -- 
 Joe Simpson
 “Reasonable people adapt themselves to the world. Unreasonable people 
 attempt to adapt the world to themselves. All progress, therefore, 
 depends on unreasonable people.”
 George Bernard Shaw

>>>
>>>
>>>
>>> -- 
>>> Joe Simpson
>>> “Reasonable people adapt themselves to the world. Unreasonable people 
>>> attempt to adapt the world to themselves. All progress, therefore, 
>>> depends on unreasonable people.”
>>> George Bernard Shaw
>>>
>>> -- 
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


Re: [web2py] please help with new widgets

2016-03-14 Thread Dave S


On Monday, March 14, 2016 at 12:41:03 AM UTC-7, José L. wrote:
>
> Massimo, I'm missing all the time a grid (sqlgrid) widget in these 
> examples. Aren't you considering it, or it's just it's not needed as the 
> style will apply and look good in the three cases?
> Sqlgrid is one of the most powerful objects in web2py forms and I think 
> most of us could not live without it ;)
>

He's got a replacement in mind, and this is a preparatory step.  The new 
one is going to be in Forms.py, and I think he's posted a simple example in 
another thread.

/dps

 

>
> 2016-03-14 7:34 GMT+01:00 joseph simpson :
>
>> Should be:
>>
>> http://mdipierro.github.io/stupid.css/widgets/materialize.html
>>
>> On Sun, Mar 13, 2016 at 11:32 PM, joseph simpson > > wrote:
>>
>>> I get a 404 on the:
>>>
>>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>>
>>> page..
>>>
>>> Take care and have fun..
>>>
>>> Joe
>>>
>>> On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro <
>>> massimo@gmail.com > wrote:
>>>
 can somebody help me with this little project?

 http://mdipierro.github.io/stupid.css/widgets/index.html
 http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
 http://mdipierro.github.io/stupid.css/widgets/metarialize.html

 Specifically, can you read the instructions? Do they make sense? can 
 you help extend them? Does everything work for you?
 I am planning to release a new library for web2py called form.py that 
 will replace SQLFORM and use the new widgets.

 Massimo

 -- 
 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 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Joe Simpson
>>> “Reasonable people adapt themselves to the world. Unreasonable people 
>>> attempt to adapt the world to themselves. All progress, therefore, 
>>> depends on unreasonable people.”
>>> George Bernard Shaw
>>>
>>
>>
>>
>> -- 
>> Joe Simpson
>> “Reasonable people adapt themselves to the world. Unreasonable people 
>> attempt to adapt the world to themselves. All progress, therefore, 
>> depends on unreasonable people.”
>> George Bernard Shaw
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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: please help with new widgets

2016-03-14 Thread Dave S


On Sunday, March 13, 2016 at 10:49:36 PM UTC-7, Massimo Di Pierro wrote:
>
> can you point out the typos?
>


Nothing that's too bad, I guess.

Under 
DATE/TIME/DATETIME WIDGET

"complete decouple the UI represnetation"

(not sure if that is 1 or 2 typos)


Under 
NUMBER WIDGET

"prevent you from tying invalid numbers"
 
(Also, if "number" is different from "integer" by allowing fractional 
parts, maybe there should be a fractional part in the example.


/dps


> On Monday, 14 March 2016 00:45:05 UTC-5, Dave S wrote:
>>
>>
>>
>> On Sunday, March 13, 2016 at 5:06:46 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> can somebody help me with this little project?
>>>
>>> http://mdipierro.github.io/stupid.css/widgets/index.html
>>> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
>>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>>
>>> Specifically, can you read the instructions? Do they make sense? can you 
>>> help extend them? Does everything work for you?
>>> I am planning to release a new library for web2py called form.py that 
>>> will replace SQLFORM and use the new widgets.
>>>
>>> The instructions seem moderately clear to me, despite a couple of 
>> distracting typos,  
>>
>> However, I don't have a lot of experience with using widgets explicitly 
>> (my SQLFORMs have just used the defaults), and I have not yet tried to 
>> build anything with these.  Since they are js, I expect that one puts them 
>> in the view?
>>
>> /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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: please help with new widgets

2016-03-14 Thread villas
FYI  I made a pull-request for learn.html


On Monday, 14 March 2016 05:49:36 UTC, Massimo Di Pierro wrote:
>
> can you point out the typos?
>
> On Monday, 14 March 2016 00:45:05 UTC-5, Dave S wrote:
>>
>>
>>
>> On Sunday, March 13, 2016 at 5:06:46 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> can somebody help me with this little project?
>>>
>>> http://mdipierro.github.io/stupid.css/widgets/index.html
>>> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
>>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>>
>>> Specifically, can you read the instructions? Do they make sense? can you 
>>> help extend them? Does everything work for you?
>>> I am planning to release a new library for web2py called form.py that 
>>> will replace SQLFORM and use the new widgets.
>>>
>>> The instructions seem moderately clear to me, despite a couple of 
>> distracting typos,  
>>
>> However, I don't have a lot of experience with using widgets explicitly 
>> (my SQLFORMs have just used the defaults), and I have not yet tried to 
>> build anything with these.  Since they are js, I expect that one puts them 
>> in the view?
>>
>> /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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] please help with new widgets

2016-03-14 Thread Dave S


On Sunday, March 13, 2016 at 11:33:09 PM UTC-7, jjs0sbw wrote:
>
> I get a 404 on the:
>
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> page..
>

Typo in the link:



(same document; Massimo's used 3 different CSS packages to style it)

/dps
 

>
> Take care and have fun..
>
> Joe
>
> On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro  > wrote:
>
>> can somebody help me with this little project?
>>
>> http://mdipierro.github.io/stupid.css/widgets/index.html
>> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>
>> Specifically, can you read the instructions? Do they make sense? can you 
>> help extend them? Does everything work for you?
>> I am planning to release a new library for web2py called form.py that 
>> will replace SQLFORM and use the new widgets.
>>
>> Massimo
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Joe Simpson
> “Reasonable people adapt themselves to the world. Unreasonable people 
> attempt to adapt the world to themselves. All progress, therefore, 
> depends on unreasonable people.”
> George Bernard Shaw
>

-- 
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: session always written if auth.user_groups is accessed

2016-03-14 Thread Anthony
Do you happen to have {{=response.toolbar()}} in your view, and if so, does 
the problem go away if you remove it?

Anthony

On Sunday, March 13, 2016 at 12:10:32 PM UTC-4, Alex wrote:
>
> I've found out that the session file is always updated 
> (Session._try_store_in_file) if I access auth.user_groups. When the user is 
> logged in I'm iterating through auth.user_groups which modifies the session.
>
> I've the following code:
>
> if auth.user_id:
> for role in auth.user_groups.itervalues():
>...
>
>
> when auth.user_groups.itervalues is called (or auth.user_groups.iteritems) 
> the session is changed. The reason is the pickled session (in 
> Session._unchanged) is different, although I've got no clue how this can 
> happen. I always thought itervalues does not change the dict.
>
> I've made this small test:
>
> if auth.user_id:
>
> import cPickle as pickle
>
> session_pickled1 = pickle.dumps(session, pickle.HIGHEST_PROTOCOL)
> for role in auth.user_groups.itervalues():
> continue
> session_pickled2 = pickle.dumps(session, pickle.HIGHEST_PROTOCOL)
> eq = (session_pickled1 == session_pickled2)
>
>
> where eq is always False once auth.user_groups contains at least one item. 
> Is there any explanation for this?
>
> Alex
>
>

-- 
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: smartgrid example problem

2016-03-14 Thread JoeCodeswell
Hi all,

I said i'd do some more research & here it is.
The problem STILL PERSISTS on both my local Windows 10 & my 
joecodeswell.com Linux machines.

I ALSO tested this with Opera. The Opera message said, "This webpage has a 
redirect loop: The webpage at 
https://joecodeswell.com/w2psnips/default/manage_songs/song has resulted in 
too many redirects. Clearing your cookies for this site or allowing 
third-party cookies may fix the problem. If not, it is possibly a server 
configuration issue and not a problem with your computer."

Here is the config info for both web2py machines.



*Windows 10 (local)*

web2py version = 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on Rocket 
1.2.6, Python 2.7.10) 
sys.version_info = sys.version_info(major=2, minor=7, micro=10, 
releaselevel='final', serial=0)
sys.platform = win32
sys.getwindowsversion = sys.getwindowsversion(major=6, minor=2, build=9200, 
platform=2, service_pack='')
platform.python_compiler() = MSC v.1500 64 bit (AMD64)
str(' '.join(platform.uname()) ) = Windows  8 6.2.9200 AMD64 
Intel64 Family 6 Model 61 Stepping 4, GenuineIntel

 
Linux (joecodeswell.com)

web2py version = 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on 
Apache/2.2.17 (Unix) mod_wsgi/3.3 Python/2.7.11, Python 2.7.11) 

sys.version_info = sys.version_info(major=2, minor=7, micro=11, 
releaselevel='final', serial=0)sys.platform = linux2 

platform.python_compiler() = GCC 4.4.7 20120313 (Red Hat 4.4.7-16)

str(' '.join(platform.uname()) ) = Linux  
2.6.32-604.30.3.lve1.3.63.el6.x86
*64 ...*
I am going to open a ticket and reference this post.

Thanks.

Love and peace,

Joe

On Wednesday, March 9, 2016 at 7:56:04 AM UTC-8, JoeCodeswell wrote:
>
> Dear Jim,
>
> Thanks for the response.  I should have said the config info before.
>
> Web2py version: 2.13.4-stable+timestamp.2015.12.26.04.59.39 - Installed 
> from source
> Os: windows -10 64 bit
> Python Interpreter: Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC 
> v.1500 64 bit (AMD64)] on win32
>
> I will look further into this problem.
>
> Thanks again, Jim.
>
> Love and peace,
>
> Joe
>
> On Tuesday, March 8, 2016 at 5:41:31 PM UTC-8, Jim S wrote:
>>
>> I cut your db.py, default.py and manage_songs.html code and pasted into a 
>> new app and it worked fine for me.
>>
>> When I click on Add Record from 
>> http://127.0.0.1:8000/songs/default/manage_songs/song it goes to 
>> http://127.0.0.1:8000/songs/default/manage_songs/song/new/song
>>
>> So, I think your sample code is just fine.  My version is Version 
>> 2.13.3-stable+timestamp.2015.12.24.08.08.22
>>
>> -Jim
>>
>>
>>
>> On Tuesday, March 8, 2016 at 11:47:58 AM UTC-6, JoeCodeswell wrote:
>>>
>>> Dear web2py Community,
>>>
>>> I BELIEVE i am faithfully following the one-to-many SmartGrid example in 
>>> the book (Example 34* Using a Smartgrid*). 
>>>
>>> I'll show my code below.
>>>
>>> PROBLEM
>>> When I click on addRecord from "
>>> http://127.0.0.1:8000/w2psnips/default/manage_songs;, Firefox goes to "
>>> http://127.0.0.1:8000/w2psnips/default/manage_songs/song; and says "The 
>>> page isn't redirecting properly. Firefox has detected that the server is 
>>> redirecting the request for this address in a way that will never complete."
>>>
>>> What am I doing wrong?
>>>
>>> Thanks for the help in advance,
>>>
>>> Love and peace,
>>>
>>> Joe
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *db.py#one song TO MANY mp3parts  ->  choirdb.define_table('song',
>>> Field('title',requires=IS_NOT_EMPTY()),Field('info'),# 
>>> auth.signature,)db.define_table('mp3part',
>>> Field('part_name',requires=IS_NOT_EMPTY()),
>>> Field('mp3',requires=IS_URL()),Field('song_id',db.song),# 
>>> auth.signature,)default.pydef manage_songs():grid = 
>>> SQLFORM.smartgrid(db.song,linked_tables=['mp3part'], user_signature=False)  
>>>   return dict(grid=grid)*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *manage_songs.html{{# 
>>> left_sidebar_enabled,right_sidebar_enabled=False,('message' in 
>>> globals())}}{{left_sidebar_enabled,right_sidebar_enabled=False,False}}{{extend
>>>  
>>> 'layout.html'}}{{block header}}  {{if 
>>> response.title:}}{{=response.title}}  
>>> {{=response.subtitle or ''}}{{pass}}  
>>> {{end}}{{=grid}}*
>>>
>>

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


Re: [web2py] How good a combo of MongoDB and web2py as a restful backend for a vast mobile application?

2016-03-14 Thread António Ramos
for something like socket.io you have tornado
https://www.youtube.com/watch?v=MUWy-NSrvNQ

for mongodb, i suggest using postgresql . It has also support for json
objects and is faster than even mongodb, they say...
http://www.enterprisedb.com/nosql-for-enterprise

But, i´m just a curious guy with no relevant background in any of these
matters...

Regards
António

2016-03-13 19:57 GMT+00:00 arihant daga :

> Hi all,
>
> I am trying to build a mobile application communicating to server using
> rest services.
> I am trying to build the backend with web2py. But i am feeling quiet
> doubtful since i am not getting much resources on web apart from the
> book.I am a little doubtful weather i should go for MongDb with web2py or
> not??
> Is MongoDb Support stable in web2py? Is Node.Js or other alternatives
> would be better than web2py with mongoDb.
> Does we2py provides a good auth solution for mobile application rather
> than basic auth? If yes what is it?
> Can i use socket.io later with web2py ??
>
>
>
> --
> 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.
>

-- 
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: Testing

2016-03-14 Thread Leonel Câmara
Yeah this group is moderated so you have to wait until your messages are 
aproved the first few times until you're whitelisted.

-- 
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: Testing

2016-03-14 Thread Pierre Thibault
OK, it seems the problem is gone but Saturday I sent a few messages and 
they would not appear.

I hope the problem is not generalized. Keep on an eye on this.

Le lundi 14 mars 2016 12:49:58 UTC-4, Pierre Thibault a écrit :
>
> I do not see my messages in this group.
>

-- 
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] Testing

2016-03-14 Thread Pierre Thibault
I do not see my messages in this group.

-- 
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] How to do this? Obviously I need ajax but what's the exact syntax?

2016-03-14 Thread RAGHIB R
Suppose a db table named pictures has 100 pics uploaded (from id  1 to 
100). I have another db table name 'choices' with one default field as 
auth.user_id and another as 'choice' . Now I show user the pics from that 
db from id 1 to 100 and let him click on any of those such that if he 
clicks on the pic with id x I will record his choice 'x' and insert x as 
field choice in the db table choices. How to do that? I know it will take a 
bit of your time. But this is creating a lot of confusion in me. 

-- 
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: How to upload my app on gae through ubuntu stepwise?

2016-03-14 Thread Willoughby
http://web2py.com/books/default/chapter/29/13/deployment-recipes?search=GAE#Deploying-on-Google-App-Engine



On Monday, March 14, 2016 at 12:16:36 PM UTC-4, RAGHIB R wrote:
>
> Please let me know the stepwise procedure.
>

-- 
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] How to upload my app on gae through ubuntu stepwise?

2016-03-14 Thread RAGHIB R
Please let me know the stepwise procedure.

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


Re: [web2py] Re: About Cubaconf

2016-03-14 Thread Carlos Cesar Caballero Díaz
Yes. I should send it before, but I was too busy and I overlooked it (my 
bad)...


If you can make it, please tell me, I can move things up with the 
organizators for making an invitation 
(https://www.treasury.gov/resource-center/sanctions/Programs/Documents/guidance_cuba_travel.pdf) 
as fast as possible.


Greetings.

El 13/03/16 a las 01:48, Massimo Di Pierro escribió:
It is a bit on a short notice. I would love to attend. I will check 
next week if I can make it work.



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

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


Re: [web2py] Re: About Cubaconf

2016-03-14 Thread Carlos Cesar Caballero Díaz
Yes. I should send it before, but I was too busy and I overlooked it (my 
bad)...


Greetings.

El 13/03/16 a las 01:48, Massimo Di Pierro escribió:
It is a bit on a short notice. I would love to attend. I will check 
next week if I can make it work.



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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: What are the platforms for free web hosting of web2py apps?

2016-03-14 Thread Mirek Zvolský
allwaysdata.com, but has only 10M place (about 6M after you install 
web2py-min), good ssh, cron, no problem to install everything.
forpsi.com paid, but only 2$/month for full VM



Dne neděle 21. února 2016 7:38:46 UTC+1 Rgb Aston napsal(a):
>
> Which one's the best to go for?
>

-- 
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 tutorials?

2016-03-14 Thread Mirek Zvolský
web2py.com/book

If you are from Czech/Slovak Rep. write to me: zvol...@seznam.cz




Dne neděle 13. března 2016 6:42:05 UTC+1 Moreplavec napsal(a):
>
> Greetings,
>
> looking for good Python framework to help me with my simple web apps. I 
> tried other frameworks and their recommended tutorials, but i have problem 
> to find any easy to follow and up-to-date for Web2Py. Please, can you help 
> me and point me to good one? I need some simple but usefull best-practice 
> tutorials to start with. No luck even with books, recommended one is four 
> years old now :(
>
> Thanks for help or tips!
>

-- 
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: Regarding "registration needs verification"

2016-03-14 Thread Najtsirk
Do you get this error at the firs login (when user registers) or at the 
first login?

Because, if you get it after the first login, this is correct behaviour. 
The user has to verify registrations.

On Friday, 11 March 2016 16:21:43 UTC+1, Ramchandra Sharma wrote:
>
> Although the user is registering .While loginging  i get the error 
> "registration needs verification"\
>
> My variables are --
>
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval=False
> auth.settings.reset_password_requires_verification = True
> auth.settings.login_after_registration = True
>
> can anyone help me please!!!
>

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


Re: [web2py] please help with new widgets

2016-03-14 Thread José Luis Redrejo
Massimo, I'm missing all the time a grid (sqlgrid) widget in these
examples. Aren't you considering it, or it's just it's not needed as the
style will apply and look good in the three cases?
Sqlgrid is one of the most powerful objects in web2py forms and I think
most of us could not live without it ;)

2016-03-14 7:34 GMT+01:00 joseph simpson :

> Should be:
>
> http://mdipierro.github.io/stupid.css/widgets/materialize.html
>
> On Sun, Mar 13, 2016 at 11:32 PM, joseph simpson 
> wrote:
>
>> I get a 404 on the:
>>
>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>
>> page..
>>
>> Take care and have fun..
>>
>> Joe
>>
>> On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> can somebody help me with this little project?
>>>
>>> http://mdipierro.github.io/stupid.css/widgets/index.html
>>> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
>>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>>
>>> Specifically, can you read the instructions? Do they make sense? can you
>>> help extend them? Does everything work for you?
>>> I am planning to release a new library for web2py called form.py that
>>> will replace SQLFORM and use the new widgets.
>>>
>>> Massimo
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Joe Simpson
>> “Reasonable people adapt themselves to the world. Unreasonable people
>> attempt to adapt the world to themselves. All progress, therefore,
>> depends on unreasonable people.”
>> George Bernard Shaw
>>
>
>
>
> --
> Joe Simpson
> “Reasonable people adapt themselves to the world. Unreasonable people
> attempt to adapt the world to themselves. All progress, therefore,
> depends on unreasonable people.”
> George Bernard Shaw
>
> --
> 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.
>

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


Re: [web2py] please help with new widgets

2016-03-14 Thread joseph simpson
Should be:

http://mdipierro.github.io/stupid.css/widgets/materialize.html

On Sun, Mar 13, 2016 at 11:32 PM, joseph simpson  wrote:

> I get a 404 on the:
>
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> page..
>
> Take care and have fun..
>
> Joe
>
> On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> can somebody help me with this little project?
>>
>> http://mdipierro.github.io/stupid.css/widgets/index.html
>> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
>> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>>
>> Specifically, can you read the instructions? Do they make sense? can you
>> help extend them? Does everything work for you?
>> I am planning to release a new library for web2py called form.py that
>> will replace SQLFORM and use the new widgets.
>>
>> Massimo
>>
>> --
>> 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.
>>
>
>
>
> --
> Joe Simpson
> “Reasonable people adapt themselves to the world. Unreasonable people
> attempt to adapt the world to themselves. All progress, therefore,
> depends on unreasonable people.”
> George Bernard Shaw
>



-- 
Joe Simpson
“Reasonable people adapt themselves to the world. Unreasonable people
attempt to adapt the world to themselves. All progress, therefore, depends
on unreasonable people.”
George Bernard Shaw

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


Re: [web2py] please help with new widgets

2016-03-14 Thread joseph simpson
I get a 404 on the:

http://mdipierro.github.io/stupid.css/widgets/metarialize.html

page..

Take care and have fun..

Joe

On Sun, Mar 13, 2016 at 5:06 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> can somebody help me with this little project?
>
> http://mdipierro.github.io/stupid.css/widgets/index.html
> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> Specifically, can you read the instructions? Do they make sense? can you
> help extend them? Does everything work for you?
> I am planning to release a new library for web2py called form.py that will
> replace SQLFORM and use the new widgets.
>
> Massimo
>
> --
> 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.
>



-- 
Joe Simpson
“Reasonable people adapt themselves to the world. Unreasonable people
attempt to adapt the world to themselves. All progress, therefore, depends
on unreasonable people.”
George Bernard Shaw

-- 
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: please help with new widgets

2016-03-14 Thread xmarx
in mdipierro.github.io/stupid.css/widgets/index.html line 32: (chrome view 
source: view-source:http://mdipierro.github.io/stupid.css/widgets/index.html
)


should be:


i am not expert js or css. this is all I can do.


14 Mart 2016 Pazartesi 02:06:46 UTC+2 tarihinde Massimo Di Pierro yazdı:
>
> can somebody help me with this little project?
>
> http://mdipierro.github.io/stupid.css/widgets/index.html
> http://mdipierro.github.io/stupid.css/widgets/bootstrap.html
> http://mdipierro.github.io/stupid.css/widgets/metarialize.html
>
> Specifically, can you read the instructions? Do they make sense? can you 
> help extend them? Does everything work for you?
> I am planning to release a new library for web2py called form.py that will 
> replace SQLFORM and use the new widgets.
>
> Massimo
>

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