[web2py] Re: class nav-collapse in layout.html

2012-12-07 Thread Paolo Caruccio
Nav-collapse is a bootstrap class.

Are you using default web2py configuration or have you modified something?

I'm on windows7 and all works fine with last trunk.


Il giorno venerdì 17 agosto 2012 00:05:09 UTC+2, mweissen ha scritto:
>
> I have a program with a menu and I tried Firefox and Google Chrome:
> Chrom shows the menu, Firefox not.
>
> Line 76 in layout.html is:
> 
>
> I could not find a definition for the class "nav-collapse".
>
> Next step: I removed this class definition
>
>
>   
>   {{is_mobile=request.user_agent().is_mobile}}
>   {{if response.menu:}}
>   {{=MENU(response.menu, _class='mobile-menu nav' if is_mobile else 
> 'nav',mobile=is_mobile,li_class='dropdown',ul_class='dropdown-menu')}}
>   {{pass}}
> 
>
> and the menu is visible again in both browsers.
> What is the reason?
>
> Regards, Martin
>
>
> -- 
> Mit freundlichen Grüßen / With kind regards 
> Martin Weissenböck
> Gregor-Mendel-Str. 37, 1190 Wien
> Austria / European Union
> Tel  +43 1 31400 00
> Fax  +43 1 31400 70
>

-- 





Re: [web2py] Re: raw web2py

2012-12-07 Thread Martin Weissenboeck
About performance:

Is it better
(1) to have only few controllers with a lot of functions in it or
(2) to have a lot of controllers with only few functions or
(3) is there - from the point of view of performance - no difference?

2012/12/7 Massimo Di Pierro 

> Hello dbv,
>
> about nginx we will add something to the book but meanwhile we provide two
> setup scrpts:
>
>
> https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
>
> https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-on-centos.sh
>
> About gevent you can do:
>
> python anyserver.py  -h
> python anyserver.py  -s gevent
>
> anyserver.py comes with web2py.
>
> You cannot turn off features but since 2.2.x many of the features are lazy
> therefore off by default if unused. Specifically session and cache do not
> add overhead. there is still a small overhead in validating client ip,
> accept-language, and parsing the request environment.
>
> You can move your models in a subfolder so they are only executed for a
> controller with the same name as the subfolder.
>
> Massimo
>
>
> On Friday, 7 December 2012 12:50:11 UTC-6, dbv wrote:
>>
>> We are considering using web2py because it offers strong access control
>> and user session management.
>>
>> Our first application is not database-heavy and so db issues are not an
>> issue.  Performance is important but should be fine with Nginx:
>>
>> a. Why isn't Nginx configuration included in the web2py book?  Lighttpd
>> is included but their code hasn't been updated in nearly two years.
>>
>> For our 2nd application, performance is important:
>>
>> b. Is gevent supported in web2py with monkey-patching?  If so, is there a
>> reference to it?
>> c. Is it possible to turn off the things that make web2py slower eg.
>> session management, db etc. to provide a 'raw' web2py (+ gevent + nginx)
>> whose only purpose is to take http requests and return data ie. no session
>> management, access control or db access?
>>
>>  --
>

-- 





[web2py] Re: SQLFORM.grid: search and links

2012-12-07 Thread tomt
After some more investigation I found out that the latest trunk has the 
added options:
 buttons_placement = 
'right',   ):
 links_placement = 'right' 

With this option I can set links_placement ='left'  which results in the 
'links' column appearing on the first column.

Great, problem solved.

On Friday, December 7, 2012 10:02:53 PM UTC-6, tomt wrote:
>
> I would also like to be able to change the position of the 'links' column.
> I see that your post didn't receive any answers. Did you figure out how to 
> do this?
> If you did, I would appreciate if you could tell me how.
>
> - Tom
>
> On Sunday, January 29, 2012 4:33:21 PM UTC-6, backseat wrote:
>>
>> I've a couple of questions about SQLFORM.grid:
>>
>>  - Is it possible to position the buttons/links created by the 'links' 
>> argument somewhere other than the end of the row? It feels as if the 
>> 'fields' argument should be able to do this, but I can't see how.
>>
>>  - Is it possible for the 'search' box to search linked tables? That may 
>> be asking a bit much...
>>
>> Thanks
>>
>

-- 





[web2py] Re: Basic access control

2012-12-07 Thread Massimo Di Pierro
auth.settings.create_user_groups = None

On Friday, 7 December 2012 12:59:36 UTC-6, dbv wrote:
>
> Is it possible to support user authorization and authentication at the 
> user level only ie. we don't need a role to be defined?

-- 





[web2py] Re: crud.update returning 404 NOT FOUND ??

2012-12-07 Thread Massimo Di Pierro
I suspect the problem is somewhere else.
Are you sure crud.update(...) is being called?

On Friday, 7 December 2012 21:52:25 UTC-6, Luca wrote:
>
> I have the following simple code, which is meant to let a user do a new 
> submission, or update a submission if one exists:
>
> sub = db(db.submission.author == auth.user_id).select().first() 
> form = crud.update(db, 
> record=sub,
> deletable=True,
> next=URL('default', 'index'),
> )
> return dict(form=form)
>
> sub is None, initially, as there is no submission, and so the crud (I am 
> hoping) should behave like a create. 
> Instead, I get a 404 NOT FOUND.  Is this normal?  What's the proper way of 
> doing this? 
>
> It's  a bit bizarre also to get a page that says 404 NOT FOUND, rather 
> than having my browser report 404 because it is not finding a page. 
> It's like getting a letter in the mail that says, today you got no mail! 
> :-) 
>
> Thanks for all the help, 
>
> Luca
>

-- 





[web2py] Basic access control

2012-12-07 Thread dbv
Is it possible to support user authorization and authentication at the user 
level only ie. we don't need a role to be defined?

-- 





[web2py] Re: SQLFORM.grid: search and links

2012-12-07 Thread tomt
I would also like to be able to change the position of the 'links' column.
I see that your post didn't receive any answers. Did you figure out how to 
do this?
If you did, I would appreciate if you could tell me how.

- Tom

On Sunday, January 29, 2012 4:33:21 PM UTC-6, backseat wrote:
>
> I've a couple of questions about SQLFORM.grid:
>
>  - Is it possible to position the buttons/links created by the 'links' 
> argument somewhere other than the end of the row? It feels as if the 
> 'fields' argument should be able to do this, but I can't see how.
>
>  - Is it possible for the 'search' box to search linked tables? That may 
> be asking a bit much...
>
> Thanks
>

-- 





[web2py] crud.update returning 404 NOT FOUND ??

2012-12-07 Thread Luca
I have the following simple code, which is meant to let a user do a new 
submission, or update a submission if one exists:

sub = db(db.submission.author == auth.user_id).select().first() 
form = crud.update(db, 
record=sub,
deletable=True,
next=URL('default', 'index'),
)
return dict(form=form)

sub is None, initially, as there is no submission, and so the crud (I am 
hoping) should behave like a create. 
Instead, I get a 404 NOT FOUND.  Is this normal?  What's the proper way of 
doing this? 

It's  a bit bizarre also to get a page that says 404 NOT FOUND, rather than 
having my browser report 404 because it is not finding a page. 
It's like getting a letter in the mail that says, today you got no mail! 
:-) 

Thanks for all the help, 

Luca

-- 





Re: [web2py] Can I have field comments while editing, but not in view?

2012-12-07 Thread Luca
Thanks... what I really don't know is, if you do that, is it a permanent 
change to the db.table.field definition, or is it for the processing of the 
current request only? 
I think my confusion is due to the fact that in other formalisms (e.g. 
Django), these settings are permanent, as not everything is re-loaded at 
each request. 

Luca

On Friday, December 7, 2012 5:46:42 PM UTC-8, rochacbruno wrote:
>
>
> if request.args[0] in ['edit']:
>> db.table.field.comment = 'yadayada'
>>
>

-- 





Re: [web2py] Can I have field comments while editing, but not in view?

2012-12-07 Thread Bruno Rocha
> if request.args[0] in ['edit']:
> db.table.field.comment = 'yadayada'
>

-- 





[web2py] How to define a database "deserialiation" function to decide the editable form of a field?

2012-12-07 Thread Luca
Suppose I want to store some data in the database, defining my own 
translation from user-defined strings to db representation, and vice versa. 
 Obviously this may not work for search, but leave search aside. 

To translate from user input to db representation, I can use the compute= 
attribute of a Field.
But how can I translate from db representation to editable string?  There 
is represent= , but it does something else. 

The context in which I need this is dates. 
I would like that, if a user leaves a date blank, I replace it in the db 
with a certain date (for instance, Year = MINYEAR, or YEAR = MAXYEAR, to 
imply that the date is far in the past or future, so that searches with < > 
will work properly).   But, when the user edits the field, I want to 
restore the blank field, not have them edit a date of Jan 1,  !  That 
would be illogical, since they never entered that date. 

This is a very general problem I imagine.  Is there a way to define such 
translations between stored and editable values in web2py?  Can it be 
added?  Where would one go to add it? 

Luca

-- 





[web2py] Can I have field comments while editing, but not in view?

2012-12-07 Thread Luca
I am using SQLFORM.grid, and if I set:

db.table.field.comment = 'yadayada'

I would like 'yadayada' to appear while editing the field (to help users to 
understand what to put in), 
but not while displaying the field in view mode (because there, I can use 

db.table.field.represent = my_smart_representation

to help users understand whatever I put in the db). 

Is there a way to add an argument to SQLFORM.grid, so that comments are 
only displayed during view?  Does this make sense as a feature request?  (I 
can also implement it, no problems, but is there a  way already to do 
this?). 

Best, Luca

-- 





[web2py] Re: Unable to update database

2012-12-07 Thread Daniele
Worked!!! Thanks s much this has been bugging me for a while.

On Saturday, December 8, 2012 12:15:49 AM UTC, Anthony wrote:
>
> db.define_table('tutor',
>
> Field('user', 'reference auth.user.id'),
>> ...)
>>
>
> This is not correct. It should be 'reference [table name]', so in this 
> case, 'reference auth_user'. Perhaps you are attempting to set the default 
> to be auth.user.id (same as auth.user_id) -- to do that, do:
>
> Field('user', 'reference auth_user', default=auth.user_id)
>
> Anthony
>  
>

-- 





[web2py] Re: Unable to update database

2012-12-07 Thread Anthony

>
> db.define_table('tutor',

Field('user', 'reference auth.user.id'),
> ...)
>

This is not correct. It should be 'reference [table name]', so in this 
case, 'reference auth_user'. Perhaps you are attempting to set the default 
to be auth.user.id (same as auth.user_id) -- to do that, do:

Field('user', 'reference auth_user', default=auth.user_id)

Anthony
 

-- 





[web2py] Re: Unable to update database

2012-12-07 Thread Daniele
Alright I think I got it to work although I don't know if it's correct.

Basically, I added a user variable to the update_or_insert() function, as 
follows:

db.tutor.update_or_insert(db.tutor.user==auth.user_id,
user = auth.user_id,
t_Hourly_Rate = tform.vars.t_Hourly_Rate,
t_Image = tform.vars.t_Image,
t_Qualifications = tform.vars.t_Qualifications,
t_Subjects = tform.vars.t_Subjects,
t_Location = tform.vars.t_Location,
t_Biography = tform.vars.t_Biography
)

My reasoning was that user would be set automatically, since in my db.py 
file I said

db.define_table('tutor',
Field('user', 'reference auth.user.id'),
...)

But apparently, I need to set that variable. So how does the actual 
reference work? I'm not sure I get it. Anyway, it seems to be updating the 
table now so, thanks for the help ;)



On Friday, December 7, 2012 11:38:52 PM UTC, Daniele wrote:
>
> Ok that seems to have done the trick. However, it's creating a new record 
> every time which means that the logged in user does not refer to the tutor 
> table. Does the id field have to be the same as auth.user_id? The id field 
> seems to be generated automatically. In my tutor table I have a line that 
> says Field('user', 'reference auth.user.id') but the relation does not 
> seem like it's being made...
>
> On Friday, December 7, 2012 11:28:06 PM UTC, Anthony wrote:
>>
>> You can try 
>> update_or_insert()
>> .
>>
>> Anthony
>>
>> On Friday, December 7, 2012 5:54:58 PM UTC-5, Daniele wrote:
>>>
>>> I am unable to update entries in my database. I think I have an idea of 
>>> why this may be, but I'm not sure how to go about fixing this.
>>>
>>> In my controller, I have:
>>>
>>> tform = SQLFORM.factory(
>>> Field('is_tutor', 'boolean'),
>>> *[f for f in db.tutor if f.name.startswith('t_')],
>>> table_name='tutor')
>>>
>>> if tform.process().accepted:
>>> if tform.vars.is_tutor:
>>> if not auth.has_membership('Tutors'):
>>> auth.add_membership('Tutors')
>>> db(db.tutor.user == auth.user_id).update(
>>> t_Hourly_Rate = tform.vars.t_Hourly_Rate,
>>> t_Image = tform.vars.t_Image,
>>> t_Qualifications = tform.vars.t_Qualifications,
>>> t_Subjects = tform.vars.t_Subjects,
>>> t_Location = tform.vars.t_Location,
>>> t_Biography = tform.vars.t_Biography
>>> )
>>> else:
>>> if auth.has_membership('Tutors'):
>>> auth.del_membership('Tutors')
>>> response.flash = T('Profile updated!')
>>> elif tform.errors:
>>> response.flash = T('There was an error with your submission')
>>>
>>>
>>> However, when I submit the form I am just getting a bunch of 'None' values. 
>>> I think the problem may be that
>>> I'm trying to update db(db.tutor.user == auth.user_id) but if db.tutor.user 
>>> does not exist, it is not being assigned
>>> the value of the currently logged in user (auth.user_id)
>>> How can I go about fixing this??
>>> Thanks
>>>
>>>
>>>

-- 





[web2py] Re: Unable to update database

2012-12-07 Thread Daniele
Ok that seems to have done the trick. However, it's creating a new record 
every time which means that the logged in user does not refer to the tutor 
table. Does the id field have to be the same as auth.user_id? The id field 
seems to be generated automatically. In my tutor table I have a line that 
says Field('user', 'reference auth.user.id') but the relation does not seem 
like it's being made...

On Friday, December 7, 2012 11:28:06 PM UTC, Anthony wrote:
>
> You can try 
> update_or_insert()
> .
>
> Anthony
>
> On Friday, December 7, 2012 5:54:58 PM UTC-5, Daniele wrote:
>>
>> I am unable to update entries in my database. I think I have an idea of 
>> why this may be, but I'm not sure how to go about fixing this.
>>
>> In my controller, I have:
>>
>> tform = SQLFORM.factory(
>> Field('is_tutor', 'boolean'),
>> *[f for f in db.tutor if f.name.startswith('t_')],
>> table_name='tutor')
>>
>> if tform.process().accepted:
>> if tform.vars.is_tutor:
>> if not auth.has_membership('Tutors'):
>> auth.add_membership('Tutors')
>> db(db.tutor.user == auth.user_id).update(
>> t_Hourly_Rate = tform.vars.t_Hourly_Rate,
>> t_Image = tform.vars.t_Image,
>> t_Qualifications = tform.vars.t_Qualifications,
>> t_Subjects = tform.vars.t_Subjects,
>> t_Location = tform.vars.t_Location,
>> t_Biography = tform.vars.t_Biography
>> )
>> else:
>> if auth.has_membership('Tutors'):
>> auth.del_membership('Tutors')
>> response.flash = T('Profile updated!')
>> elif tform.errors:
>> response.flash = T('There was an error with your submission')
>>
>>
>> However, when I submit the form I am just getting a bunch of 'None' values. 
>> I think the problem may be that
>> I'm trying to update db(db.tutor.user == auth.user_id) but if db.tutor.user 
>> does not exist, it is not being assigned
>> the value of the currently logged in user (auth.user_id)
>> How can I go about fixing this??
>> Thanks
>>
>>
>>

-- 





[web2py] Re: web2py and rendering geometries (from postgresql)

2012-12-07 Thread howesc
not exactly what you are looking for, but i'm storing geo points for shapes 
on google app engine, and then rendering delivery zones on a google map for 
http://www.diginn.com/order/ (enter an address in New York, NY 
USAduring "business hours" in the EST and it will bring up the 
locations map).  in this case i store a list of points in the DB (as a list 
of formatted strings), and use the javascript google maps API to draw the 
layer.

if any of this is applicable to you i can share some of the relevant code.

On Thursday, December 6, 2012 2:54:51 PM UTC-8, Luis wrote:
>
> Thank you Massimo,
>
> I think the st_astext and st_geojson functions will set me in the right 
> direction. 
>
> Luis
>
> On Thursday, December 6, 2012 4:26:50 PM UTC-5, Massimo Di Pierro wrote:
>>
>> I am not expert in this. The Database Abstraction Layer has API to use 
>> PostGIS and Spatialite. 
>> In the posrgesql case specifically the DAL supports field types 
>> "geometry" and "geography" 
>> and field 
>> functions st_asgeojson, st_astext, st_contained, st_contains, st_distance, 
>> st_equals, st_intersects, st_overlaps, st_simplify, st_touches, st_within.
>>
>> I cannot give you more details because this feature is still 
>> undocumented. Anyway, this sounds like what you are looking for I will try 
>> write some usage examples.
>>
>> Massimo
>>
>>
>>
>>
>> On Thursday, 6 December 2012 08:12:04 UTC-6, Luis wrote:
>>>
>>> Hello,
>>>
>>> I'm new to web2py and wanted to know if there is any way on web2py to 
>>> render geometry types (i.e. add layers to maps as web feature service or 
>>> web mapping service) from postgresql databases without using an external 
>>> web mapping service (such as map server or geoserver). I come from a 
>>> spatial analysis background and spend most of my time working with GIS and 
>>> databases. The way I'm currently GIS web development is through a framework 
>>> based on PostgreSQL+Postgis+GeoServer+OpenLayers, but I would like to know 
>>> if web2py has a way to simplify GIS web development and be able to query 
>>> both non spatial and spatial data (in tables and maps).
>>>
>>> It occurs to me that one could get the geometry of a set of records in 
>>> text format through a query and use Openlayers to render each of the record 
>>> geometry features. If this were feasible, any hints on what steps I could 
>>> follow to code the controller and view template?
>>>
>>> Any suggestion would be appreciated. Thanks in advance,
>>>
>>> Luis Carrasco
>>>
>>

-- 





[web2py] Re: Unable to update database

2012-12-07 Thread Anthony
You can try 
update_or_insert()
.

Anthony

On Friday, December 7, 2012 5:54:58 PM UTC-5, Daniele wrote:
>
> I am unable to update entries in my database. I think I have an idea of 
> why this may be, but I'm not sure how to go about fixing this.
>
> In my controller, I have:
>
> tform = SQLFORM.factory(
> Field('is_tutor', 'boolean'),
> *[f for f in db.tutor if f.name.startswith('t_')],
> table_name='tutor')
>
> if tform.process().accepted:
> if tform.vars.is_tutor:
> if not auth.has_membership('Tutors'):
> auth.add_membership('Tutors')
> db(db.tutor.user == auth.user_id).update(
> t_Hourly_Rate = tform.vars.t_Hourly_Rate,
> t_Image = tform.vars.t_Image,
> t_Qualifications = tform.vars.t_Qualifications,
> t_Subjects = tform.vars.t_Subjects,
> t_Location = tform.vars.t_Location,
> t_Biography = tform.vars.t_Biography
> )
> else:
> if auth.has_membership('Tutors'):
> auth.del_membership('Tutors')
> response.flash = T('Profile updated!')
> elif tform.errors:
> response.flash = T('There was an error with your submission')
>
>
> However, when I submit the form I am just getting a bunch of 'None' values. I 
> think the problem may be that
> I'm trying to update db(db.tutor.user == auth.user_id) but if db.tutor.user 
> does not exist, it is not being assigned
> the value of the currently logged in user (auth.user_id)
> How can I go about fixing this??
> Thanks
>
>
>

-- 





[web2py] Unable to update database

2012-12-07 Thread Daniele
I am unable to update entries in my database. I think I have an idea of why 
this may be, but I'm not sure how to go about fixing this.

In my controller, I have:

tform = SQLFORM.factory(
Field('is_tutor', 'boolean'),
*[f for f in db.tutor if f.name.startswith('t_')],
table_name='tutor')

if tform.process().accepted:
if tform.vars.is_tutor:
if not auth.has_membership('Tutors'):
auth.add_membership('Tutors')
db(db.tutor.user == auth.user_id).update(
t_Hourly_Rate = tform.vars.t_Hourly_Rate,
t_Image = tform.vars.t_Image,
t_Qualifications = tform.vars.t_Qualifications,
t_Subjects = tform.vars.t_Subjects,
t_Location = tform.vars.t_Location,
t_Biography = tform.vars.t_Biography
)
else:
if auth.has_membership('Tutors'):
auth.del_membership('Tutors')
response.flash = T('Profile updated!')
elif tform.errors:
response.flash = T('There was an error with your submission')


However, when I submit the form I am just getting a bunch of 'None' values. I 
think the problem may be that
I'm trying to update db(db.tutor.user == auth.user_id) but if db.tutor.user 
does not exist, it is not being assigned
the value of the currently logged in user (auth.user_id)
How can I go about fixing this??
Thanks


-- 





[web2py] How to customize when the top menu navigation collapses?

2012-12-07 Thread Luca
I would like to use a minimal top bar for my site, where there are items 
from response.menu on the left, and the login information on the right. 
 However, I notice that the menu items are collapsed when there is still a 
lot of space on the top bar -- I need to use a VERY wide browser window in 
order to have the menu items ('Home' in the attached screenshots) appear in 
the top menu bar.  
Is it possible to fine-tune when the menu items in response.menu are 
collapsed, and toggled on/off via the button, vs. displayed on the top bar? 
 Ideally, I would like collapsing only if the items clash with the login 
information. 
I hope this makes sense, but the screenshots really make it clear  I 
would like 'Home' to appear on the top even when the browser is in the 
narrower of the two screenshots. 

Many thanks! 
Luca

-- 



<><>

[web2py] Re: class nav-collapse in layout.html

2012-12-07 Thread Luca
I have the problem that the menus are collapsed even when there is ample 
space on the navbar for the items. 
Removing nav-collapse and replacing with nav solves this, but the menu 
button still appears before it is actually needed. 
Does anyone know how to fine tune the behavior of menu collapse? 
Luca

On Thursday, August 16, 2012 3:05:09 PM UTC-7, mweissen wrote:
>
> I have a program with a menu and I tried Firefox and Google Chrome:
> Chrom shows the menu, Firefox not.
>
> Line 76 in layout.html is:
> 
>
> I could not find a definition for the class "nav-collapse".
>
> Next step: I removed this class definition
>
>
>   
>   {{is_mobile=request.user_agent().is_mobile}}
>   {{if response.menu:}}
>   {{=MENU(response.menu, _class='mobile-menu nav' if is_mobile else 
> 'nav',mobile=is_mobile,li_class='dropdown',ul_class='dropdown-menu')}}
>   {{pass}}
> 
>
> and the menu is visible again in both browsers.
> What is the reason?
>
> Regards, Martin
>
>
> -- 
> Mit freundlichen Grüßen / With kind regards 
> Martin Weissenböck
> Gregor-Mendel-Str. 37, 1190 Wien
> Austria / European Union
> Tel  +43 1 31400 00
> Fax  +43 1 31400 70
>

-- 





Re: [web2py] Re: ('web2py' in pycon.us.talks) == False

2012-12-07 Thread Derek


>
>
> web2py is not the issue here.
>
> The issue is that in 2013 somebody can attend PyCon and not will not be 
> exposed to any other web framework but Django (12 talks + tutorials) and 
> Pyramid (2 talks).
>
>>
>>
Exactly, Even if web2py is not in the talks, the fact that there is only 
two web frameworks should be a concern, especially since there are 12 for 
Django alone. Where is Flask, Bottle, Turbogears,  or Web.py? If this is 
supposed to represent the Python community, it's a very poor one sided 
representation at best.

-- 





[web2py] Re: janrain logs in but stuck on login screen

2012-12-07 Thread Massimo Di Pierro
I think the problem is that you need this:

from gluon.contrib.login_methods.rpx_account import RPXAccount
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form = RPXAccount(request,
  api_key='...',
  domain='...',
  url = "
http://localhost:8080/%s/default/user/login"; % request.application)

or this (preferred):

from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth, filename='private/janrain.key')

not both. Moreover they should always come after auth.define_tables()


On Friday, 7 December 2012 11:18:40 UTC-6, Jeff Kusi wrote:
>
> Could somebody address this issue please?  Mine is also doing the same 
> thing.
> here's how my config looks:
> ---
> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
> auth = Auth(db)
> from gluon.contrib.login_methods.rpx_account import RPXAccount
>
> auth.settings.actions_disabled=['register','change_password','request_reset_password']
> auth.settings.login_form = RPXAccount(request,
>   api_key='...',
>   domain='...',
>   url = "
> http://localhost:8080/%s/default/user/login"; % request.application)
>
> crud, service, plugins = Crud(db), Service(), PluginManager()
> auth.define_tables(username=False, signature=False)
>
> from gluon.contrib.login_methods.rpx_account import use_janrain
> use_janrain(auth, filename='private/janrain.key')
> ---
>
> The janrain private file :
> ---
> helloworldApp:alsdkjfasldkjfa;sldkfjasdfads
> --
>
> On Tuesday, April 17, 2012 10:20:04 AM UTC-4, simon wrote:
>>
>> Is the janrain interface not currently working or have I missed 
>> something? I can login using janrain but I cannot navigate to any other 
>> pages. It is just stuck on a screen that says "welcome back".
>>
>>
>>
>>

-- 





[web2py] Re: raw web2py

2012-12-07 Thread Massimo Di Pierro
Hello dbv,

about nginx we will add something to the book but meanwhile we provide two 
setup scrpts:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-on-centos.sh

About gevent you can do:

python anyserver.py  -h
python anyserver.py  -s gevent

anyserver.py comes with web2py.

You cannot turn off features but since 2.2.x many of the features are lazy 
therefore off by default if unused. Specifically session and cache do not 
add overhead. there is still a small overhead in validating client ip, 
accept-language, and parsing the request environment.

You can move your models in a subfolder so they are only executed for a 
controller with the same name as the subfolder.

Massimo


On Friday, 7 December 2012 12:50:11 UTC-6, dbv wrote:
>
> We are considering using web2py because it offers strong access control 
> and user session management.  
>
> Our first application is not database-heavy and so db issues are not an 
> issue.  Performance is important but should be fine with Nginx:
>
> a. Why isn't Nginx configuration included in the web2py book?  Lighttpd is 
> included but their code hasn't been updated in nearly two years.
>
> For our 2nd application, performance is important:
>
> b. Is gevent supported in web2py with monkey-patching?  If so, is there a 
> reference to it?
> c. Is it possible to turn off the things that make web2py slower eg. 
> session management, db etc. to provide a 'raw' web2py (+ gevent + nginx) 
> whose only purpose is to take http requests and return data ie. no session 
> management, access control or db access?
>
>

-- 





[web2py] raw web2py

2012-12-07 Thread dbv
We are considering using web2py because it offers strong access control and 
user session management.  

Our first application is not database-heavy and so db issues are not an 
issue.  Performance is important but should be fine with Nginx:

a. Why isn't Nginx configuration included in the web2py book?  Lighttpd is 
included but their code hasn't been updated in nearly two years.

For our 2nd application, performance is important:

b. Is gevent supported in web2py with monkey-patching?  If so, is there a 
reference to it?
c. Is it possible to turn off the things that make web2py slower eg. 
session management, db etc. to provide a 'raw' web2py (+ gevent + nginx) 
whose only purpose is to take http requests and return data ie. no session 
management, access control or db access?

-- 





[web2py] Re: janrain logs in but stuck on login screen

2012-12-07 Thread Jeff Kusi
Could somebody address this issue please?  Mine is also doing the same 
thing.
here's how my config looks:
---
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
from gluon.contrib.login_methods.rpx_account import RPXAccount
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form = RPXAccount(request,
  api_key='...',
  domain='...',
  url = 
"http://localhost:8080/%s/default/user/login"; % request.application)

crud, service, plugins = Crud(db), Service(), PluginManager()
auth.define_tables(username=False, signature=False)

from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth, filename='private/janrain.key')
---

The janrain private file :
---
helloworldApp:alsdkjfasldkjfa;sldkfjasdfads
--

On Tuesday, April 17, 2012 10:20:04 AM UTC-4, simon wrote:
>
> Is the janrain interface not currently working or have I missed 
> something? I can login using janrain but I cannot navigate to any other 
> pages. It is just stuck on a screen that says "welcome back".
>
>
>
>

-- 





[web2py] Re: web2py and auto-generated RESTful views?

2012-12-07 Thread Niphlod
I don't understand: using js frameworks like angularjs requires to move the 
"logic" much more towards the View than the Controller...
anyway, what do you mean by "generating decoupled views" ? 
response.render() ?

On Friday, December 7, 2012 7:43:31 AM UTC+1, Alec Taylor wrote:
>
> AngularJS is a great MVC framework from Google. There are a bunch of 
> others also. 
>
> Currently I develop my web-apps by: 
> 1. Creating models in web2py 
> 2. Creating controllers in web2py 
> 3. Creating views in web2py* 
>
> Then I create my mobile app (PhoneGap): 
> 1. Create models using AngularJS* 
> 2. Create controllers using AngularJS, that talk RESTfully with my web2py 
> app 
> 3. Create views in AngularJS 
>
> *sometimes 
>
> Anything in the pipeline about generating decoupled views; so that I 
> don't need to reimplement my components "manually" in JavaScript? 
>
> Thanks for all suggestions, 
>
> Alec Taylor 
>

-- 





Re: [web2py] Re: need help: No space left on device

2012-12-07 Thread Vasile Ermicioi
yes,  it is because of tickets, after removing all of them it works(login)

thank you

-- 





Re: [web2py] what are groups, membership, and permissions?

2012-12-07 Thread Vinicius Assef
The basics is users and groups.
Users are people registered in your app. Groups are their roles:
manager, secretary, financial, and so on.

Each user has at least one role, ie, belongs to at least one group.
This is a membership.

Each group defines a profile, ie, a set of permissions users that
belong to it, can do in your system.
For example: managers can include new employess. Secretaries can add a
contat to the address book.

It's based on RBAC: http://en.wikipedia.org/wiki/Rbac

--
Vinicius Assef


On Fri, Dec 7, 2012 at 3:09 PM, sasogeek  wrote:
> I don't understand very well from the documentation what groups, membership
> and permissions are. I'm creating an app where i want to allow user to tag
> posts, and other users can see those posts if they are "subscribed" to any
> of those tags. if they're not, then they don't have permission to see those
> posts.
>
> --
>
>
>

-- 





[web2py] what are groups, membership, and permissions?

2012-12-07 Thread sasogeek
I don't understand very well from the documentation what groups, membership 
and permissions are. I'm creating an app where i want to allow user to tag 
posts, and other users can see those posts if they are "subscribed" to any 
of those tags. if they're not, then they don't have permission to see those 
posts.

-- 





[web2py] Re: need help: No space left on device

2012-12-07 Thread Massimo Di Pierro
Probably have lots of sessions/ticket files. Mind this can cause corruption 
of sqlite database.

On Friday, 7 December 2012 03:30:34 UTC-6, Vasile Ermicioi wrote:
>
> hi,
>
>
> I know that this is not because of web2py, but I am getting an error which 
> says "No space left on device"
> Is it because of no space on disk or can be also something else?
>
> Traceback (most recent call last):
>   File "/home/myuser/web2py/gluon/main.py", line 447, in wsgibase
> parse_get_post_vars(request, environ)
>   File "/home/myuser/web2py/gluon/main.py", line 275, in parse_get_post_vars
> request.body = copystream_progress(request) ### stores request body
>   File "/home/myuser/web2py/gluon/main.py", line 143, in copystream_progress
> copystream(source, dest, size, chunk_size)
>   File "/home/myuser/web2py/gluon/fileutils.py", line 386, in copystream
> dest.seek(0)
> IOError: [Errno 28] No space left on device
>
>

-- 





[web2py] Re: Allowing external access to web2py server ?

2012-12-07 Thread Massimo Di Pierro
python web2py.py -a passwd -i 0.0.0.0 -p 80

On Friday, 7 December 2012 03:21:55 UTC-6, Richard Shea wrote:
>
> I want to start a web2py server so that it can be accessed externally
> to the hosting server.
>
> I've read this http://web2py.com/books/default/chapter/29/03
>
> By default, web2py runs its web server on 127.0.0.1:8000 (port 8000
>> on localhost), but you can run it on any available IP address and
>> port. You can query the IP address of your network interface by
>> opening a command line and typing ipconfig on Windows or ifconfig on
>> OS X and Linux. From now on we assume web2py is running on localhost
>> (127.0.0.1:8000). Use 0.0.0.0:80 to run web2py publicly on any of your
>> network interfaces.
>>
>
> but I can't find how to "Use 0.0.0.0:80" ?
>
> There doesn't seem to be a command line argument which does that ? 
>
> I'm aware of the command line arg to change the port but how do I allow 
> access from all addresses.
>
> thanks
>
> Richard.
>
>

-- 





[web2py] Re: onaccept in CRUD

2012-12-07 Thread Massimo Di Pierro
The error you are getting is a database error, not a web2py error, it says 
you are trying to insert a record with a duplicate id. Perhaps the data is 
already corrupted in db.

On Friday, 7 December 2012 00:06:43 UTC-6, Kenneth wrote:
>
> Hi,
>
> this is a legacy table and asset_id is the id for the table. So it needs 
> to be unique. The migration is false, web2py is not able to change the 
> structure at all. 
>
> I'm only trying to update the asset_name not create an new that looks the 
> same. 
>
>
> Kenneth
>
>
> Den fredagen den 7:e december 2012 kl. 04:10:24 UTC+2 skrev Massimo Di 
> Pierro:
>>
>> I suspect your asset_id is declared as unique (or was declared as unique, 
>> then you made a migration but db still thinks it is unique).
>>
>> On Thursday, 6 December 2012 17:37:10 UTC-6, Kenneth wrote:
>>>
>>> Hello,
>>>
>>> I have a form created by CRUD with some extra fields. assets_label field 
>>> is a dropdown consisting of all old labels. Beside that I add an normal 
>>> text field where user can enter a new label. 
>>> I have then crud.settings.create_onaccept = insert_assets where I update 
>>> the label name if there is some text in the textfield. This works great.
>>>
>>> The problem comes with crud.settings.update_onaccept = update_assets
>>> and
>>> def update_assets(form):
>>> if form.request_vars.asset_name_2 != '':
>>> row = db(db.assets.asset_id == form.vars.id).update(asset_name 
>>> = form.request_vars.asset_name_2)
>>>
>>> I get an error ticket containg:
>>>  (1062, "Duplicate entry 
>>> '275-2012-12-07 10:26:41' for key 'asset_id'")
>>>
>>>
>>>  File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in 
>>> execute
>>> self.errorhandler(self, exc, value)
>>>   File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in 
>>> defaulterrorhandler
>>> raise errorclass, errorvalue
>>> IntegrityError: (1062, "Duplicate entry '275-2012-12-07 10:26:41' for key 
>>> 'asset_id'")
>>>
>>>
>>> Any ideas what I'm doing wrong?
>>>
>>>
>>> Kenneth
>>>
>>>
>>>

-- 





Re: [web2py] Re: ('web2py' in pycon.us.talks) == False

2012-12-07 Thread Marco Mansilla
Well, to me it seems that DjangoCon has moved to PyCon... so, whatever,
we must have our Web2pyCon and stop trying to be heard by deft people...

PS: i still remember this and is awesome
http://www.youtube.com/watch?v=i6Fr65PFqfk

> Hi folks --
> 
> I'm the program chair for PyCon 2013. I can see you've got some
> questions about how the talk selection works, so I'm hoping I can
> chime in and answer some of the questions.
> 
> First, Joe Barnhart asks "[w]ho in the overall structure of PyCon
> decides these things?  Do they live in the Bay Area?"
> 
> There isn't a single person who makes decisions; the decision is made
> by the PyCon Program Committee. This year we had about 80 members on
> the committee. I know we had at least a couple who lived in the Bay
> Area, but I think most don't. Membership on this committee is open to
> anyone who wants to join. We had a call for membership in July 
> (http://pycon.blogspot.com/2012/07/i-want-you-for-pycon-program-commitee.html)
>  
> and started our work in August. Everyone on the committee (myself
> included) volunteers their time, and the time was substantial -- we
> met daily for most of August and all of September and October.
> 
> It's a lot of work, and made quite hard by the volume of submissions
> we have to weigh, but it's actually quite fun most of the time. If
> anyone here's interested, please consider joining next year. It's a
> great way to give back to the Python community!
> 
> Next, let me try to answer questions about how the process itself
> works. I'll point you to https://us.pycon.org/2013/pc/guide/, where
> I've done as good a job as I can documenting how the review process
> worked this year. If anyone has questions about specifics after
> reading that I'd be happy to answer them; fire away.
> 
> I do specifically want to address something Massimo claims: he writes
> that "one negative vote by a self appointed reviewer could kill a
> talk". This isn't true: the decision really is made by the committee.
> We have several rounds of voting, and it takes a strong majority of
> votes to decide a talk in either direction. It has to be this way: no
> single person can be counted on to be totally dispassionate, so when
> we pull together a large committee we can hopefully balance out our
> various biases.
> 
> I understand there's a lot of disappointment about web2py not being
> on the program. We had nearly 500 proposals for just over 100 slots
> on the schedule, so we simply couldn't fit in all the good talks that
> were proposed. We did the best we could, but ultimately some things
> are always going to be left out. Many of my favorite topics aren't
> represented in the program, either.
> 
> However, the main conference track is just a part of PyCon -- and a 
> relatively small one at that. We have many other events, including 
> lightning talks (short, informal presentations), open spaces (ad-hoc
> talks and gatherings) and sprints (focused development efforts). For
> many people, these less formal parts are actually the highlights. I'm
> one of them: my favorite part of PyCon is the annual testing meetup,
> and event you won't find on the official schedule because it's far
> from formal. I expect web2py to be represented in this spaces, and
> I'd encourage you to come and help make that happen.
> 
> In the end, though, I understand your disappointment, and I doubt
> there's much I can tell you that'll change that. I hope you'll
> consider this added impetus to submit awesome web2py talks to PyCon
> next year. Ultimately, that's the only way to make sure your favorite
> topic is covered: submit proposals!
> 
> Once again if you've got any more questions I'm happy to answer them
> -- either here or in private email (ja...@jacobian.org).
> 
> Thanks for your understanding,
> 
> Jacob Kaplan-Moss
> Program Chair, PyCon 2013
> 

-- 





[web2py] need help with groupby in grid

2012-12-07 Thread Mark
Hello,

I have following records in a table for example:

id, key, value
10, AA, 838
11, BB, 135
12, BB, 147
13, AA, 400
14, AA, 999
15, AA, 625

db.define_table('test', Field('key'), Field('value'))

I want to display the max value in each key group in the grid, such as:
12, BB, 147
14, AA, 999

query = db.test
grid = SQLFORM.grid(query, orderby=~db.test.value, groupby=db.test.key) 
grid will display:
15, AA, 625 
12, BB, 147

I think the groupby always return the max(id) record. The groupby depend on 
record id instead of orderby. How can I modify the query or grid to display 
the max value in each group?

Any help will be greatly appreciated.

Mark


-- 





Re: [web2py] Re: REF: Adding a field to SQLFORM() from another table

2012-12-07 Thread Teddy Nyambe
Ok great, I have noted:

my_extra_element = TR(LABEL('Test:'), INPUT(_name='test',value='Some
text',_type='text'))
form[0].insert(-1,my_extra_element)


Now, in  view how do I show the field "test" using custom display as in
using {{=form}} its appearing:

{{=form.custom.widget.test}}

Kind regards,


On Thu, Dec 6, 2012 at 9:32 PM, Anthony  wrote:

> I haven't looked at this in detail, but if you want to add an extra field
> to a form, see
> http://web2py.com/books/default/chapter/29/07#Adding-extra-form-elements-to-SQLFORM
>  (you
> can also use the DOM manipulation methods described here:
> http://web2py.com/books/default/chapter/29/05#Server-side-DOM-and-parsing
> ).
>
> If you need to load options in a select dynamically based on other
> selections in the form, that gets more complicated. For some solutions, see
> here
> .
>
> Anthony
>
>
> On Thursday, December 6, 2012 4:02:37 AM UTC-5, software.ted wrote:
>>
>> Apologies for my ignorance but I want to add a field [list of items] to a
>> SQLFORM created from a table that does not have that field. So to add the
>> field I am using Field.Virtual as follows:
>>
>> db.staff_time_record.**departments = Field.Virtual(db.department)
>>
>> But this does not seem to allow me to create a virtual field with a
>> reference of all departments in the table as a list. Then what I want to do
>> if this works or is possible, use on the change of the drop down list of
>> departments field on the form to list only the offices in the selected
>> department using jQuery in the view as follows:
>>
>> jQuery('#department').on(**function(){
>>  ajax('update_office',['**departments'],
>> 'staff_time_record_office_id')**;
>>
>> My worry here again even if I have not tested this yet is, when the page
>> loads first time, it will load all Offices cause of the db defaults.
>>
>> Please correct me if am way out of line in the normal way of doing things
>> in web2pyI have added various components of application.
>>
>> Model:
>>
>> 
>> import datetime
>> now = datetime.datetime.today()
>> db.define_table("department",
>> Field("name"),
>> format="%(name)s"
>> )
>> db.define_table("office",
>> Field("name"),
>> Field("department_id",
>> db.department,
>> requires=IS_IN_DB(db, 'department.id', '%(name)s')),
>> format="%(name)s"
>> )
>> db.define_table("staff_time_**record",
>> Field("time_in","datetime", default=now),
>> Field("office_id", db.office, 
>> requires=IS_IN_DB(db,'office.**id
>> ','%(name)s'))
>> )
>>
>> 
>>
>> Controller:
>>
>> 
>> def index():
>> db.staff_time_record.**departments = Field.Virtual(db.department)
>> form = SQLFORM(db.staff_time_record)
>> if form.process().accepted:
>> response.flash("Time Card for the offer recorded")
>> elif form.errors:
>> response.flash("There was an error recording the employee record")
>> return dict(form=form)
>> def update_office():
>> return [OPTION(o.name, _value=o.id) for o in
>> db(db.office.department_id == request.vars.departments)]
>> 
>>
>> The View:
>>
>> 
>>
>> {{extend 'layout.html'}}
>> Please record time officer reported for work
>> {{=form.custom.start}}
>> 
>> 
>> Officer Department:
>> {{=form.custom.widget.**departments}}
>> 
>> 
>> Officer title:
>> {{=form.custom.widget.**office_id}}
>> 
>> 
>> Time Reported: 
>> {{=form.custom.widget.**time_in}}
>> 
>> 
>> 
>> {{=form.custom.submit}}
>> 
>> 
>> {{=form.custom.end}}
>>
>> 
>> jQuery('#department').on(**function(){
>> ajax('update_office',['**departments'],
>> 'staff_time_record_office_id')**;
>> }
>> 
>>
>> 
>>
>>
>> I think if I get this and understand whats really going on will really
>> want us to be part of web2py conf 2013!!!
>>
>> Ideas to clarify the gray areas above will be appreciated.
>>
>>
>>
>> --
>> ..**..**
>> ...
>> Teddy Lubasi Nyambe
>> Opensource Zambia
>> Lusaka, ZAMBIA
>>
>> Cell: +260 97 7760473
>> website: http://www.opensource.org.zm
>>
>> ~/
>> Human Knowledge belongs to the world! - AntiTrust
>>
>> Man is a tool-using animal. Without tools he is nothing, with tools he is
>> all - Thomas Carlyle 1795-1881
>>
>> /~
>>
>  --
>
>
>
>



-- 
...
Teddy Lubasi Nyambe
Opensource Zambia
Lusaka, ZAMBIA

Cell: +260 97 7760473
website: http://www.opensource.org.zm

~/
Human Knowledge belongs to the world! - AntiTrust

Man is a tool-using animal. Without tools he is nothing, with tools he is
all - Thomas Carlyle 1795-1881

/~

-- 





[web2py] Re: I do not use cache, but the system cache throws me errors .. : S

2012-12-07 Thread Anthony
I don't think the cache system is causing the problem. In this line:

plugin_inscripcion_temp = db.plugin_inscripcion_temp(id=
plugin_inscripcion_temp_id, user=id_user)

the value of either plugin_inscripcion_temp or id_user is 'cache' (i.e., a 
string literal, not the web2py cache object) rather than an integer. It's 
hard to say why that is the case without seeing more code.

Anthony

On Friday, December 7, 2012 8:31:07 AM UTC-5, www.diazluis.com wrote:
>
> greetings to all.
> Thanks for your time.
>
> lately I've been spending
> have my app cache error
> but I do not use the cache
>
> my app using sqlite database, and run on your own server.
>
> I use debian 6
> web2py v. 2.2.1
>
> the error I have is:
>
> 19 plugin_inscripcion_temp.py ValueError: invalid literal for int() with 
> base 10: 'cache' + details
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/restricted.py", line 209, in restricted
> exec ccode in environment
>   File 
> "/home/www-data/web2py/applications/sinca/controllers/plugin_inscripcion_temp.py",
>  
> line 264, in 
>   File "/home/www-data/web2py/gluon/globals.py", line 186, in 
> self._caller = lambda f: f()
>   File 
> "/home/www-data/web2py/applications/sinca/controllers/plugin_inscripcion_temp.py",
>  
> line 102, in planilla
> plugin_inscripcion_temp = 
> db.plugin_inscripcion_temp(id=plugin_inscripcion_temp_id, user=id_user)
>   File "/home/www-data/web2py/gluon/dal.py", line 7646, in __call__
> return 
> self._db(query).select(limitby=(0,1),for_update=for_update).first()
>   File "/home/www-data/web2py/gluon/dal.py", line 8766, in select
> return adapter.select(self.query,fields,attributes)
>   File "/home/www-data/web2py/gluon/dal.py", line 2094, in select
> return super(SQLiteAdapter, self).select(query, fields, attributes)
>   File "/home/www-data/web2py/gluon/dal.py", line 1581, in select
> sql = self._select(query, fields, attributes)
>   File "/home/www-data/web2py/gluon/dal.py", line 1444, in _select
> sql_w = ' WHERE ' + self.expand(query)
>   File "/home/www-data/web2py/gluon/dal.py", line 1277, in expand
> return op(first, second)
>   File "/home/www-data/web2py/gluon/dal.py", line 1160, in AND
> return '(%s AND %s)' % (self.expand(first), self.expand(second))
>   File "/home/www-data/web2py/gluon/dal.py", line 1277, in expand
> return op(first, second)
>   File "/home/www-data/web2py/gluon/dal.py", line 1205, in EQ
> self.expand(second, first.type))
>   File "/home/www-data/web2py/gluon/dal.py", line 1287, in expand
> return str(self.represent(expression,field_type))
>   File "/home/www-data/web2py/gluon/dal.py", line 1708, in represent
> return str(int(obj))
> ValueError: invalid literal for int() with base 10: 'cache'
>
> ## END
>
> cleared, the app works! ..
> but every morning when I arrive, I find a list of such errors.
>
> Currently the app is processing the registration (filled profile) from 
> 2900 users.
> sorry if I am not clear .. my language is Spanish
>
>

-- 





[web2py] I do not use cache, but the system cache throws me errors .. : S

2012-12-07 Thread www.diazluis.com
greetings to all.
Thanks for your time.

lately I've been spending
have my app cache error
but I do not use the cache

my app using sqlite database, and run on your own server.

I use debian 6
web2py v. 2.2.1

the error I have is:

19 plugin_inscripcion_temp.py ValueError: invalid literal for int() with 
base 10: 'cache' + details

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File 
"/home/www-data/web2py/applications/sinca/controllers/plugin_inscripcion_temp.py",
 
line 264, in 
  File "/home/www-data/web2py/gluon/globals.py", line 186, in 
self._caller = lambda f: f()
  File 
"/home/www-data/web2py/applications/sinca/controllers/plugin_inscripcion_temp.py",
 
line 102, in planilla
plugin_inscripcion_temp = 
db.plugin_inscripcion_temp(id=plugin_inscripcion_temp_id, user=id_user)
  File "/home/www-data/web2py/gluon/dal.py", line 7646, in __call__
return 
self._db(query).select(limitby=(0,1),for_update=for_update).first()
  File "/home/www-data/web2py/gluon/dal.py", line 8766, in select
return adapter.select(self.query,fields,attributes)
  File "/home/www-data/web2py/gluon/dal.py", line 2094, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File "/home/www-data/web2py/gluon/dal.py", line 1581, in select
sql = self._select(query, fields, attributes)
  File "/home/www-data/web2py/gluon/dal.py", line 1444, in _select
sql_w = ' WHERE ' + self.expand(query)
  File "/home/www-data/web2py/gluon/dal.py", line 1277, in expand
return op(first, second)
  File "/home/www-data/web2py/gluon/dal.py", line 1160, in AND
return '(%s AND %s)' % (self.expand(first), self.expand(second))
  File "/home/www-data/web2py/gluon/dal.py", line 1277, in expand
return op(first, second)
  File "/home/www-data/web2py/gluon/dal.py", line 1205, in EQ
self.expand(second, first.type))
  File "/home/www-data/web2py/gluon/dal.py", line 1287, in expand
return str(self.represent(expression,field_type))
  File "/home/www-data/web2py/gluon/dal.py", line 1708, in represent
return str(int(obj))
ValueError: invalid literal for int() with base 10: 'cache'

## END

cleared, the app works! ..
but every morning when I arrive, I find a list of such errors.

Currently the app is processing the registration (filled profile) from 2900 
users.
sorry if I am not clear .. my language is Spanish

-- 





[web2py] Re: IS_IN_SET problem.

2012-12-07 Thread Annet
Hi Alan,

Thanks for making it an "issue" and providing a possible patch.


Kind regards,

Annet

-- 





[web2py] Re: auth.wiki() writes apsolute links for wiki pages. Can I change it to write only relative url?

2012-12-07 Thread Alan Etkin
> On Friday, December 7, 2012 8:46:12 AM UTC-3, Dragan Matic 
wrote:Currently if I write markmin link in auth.wiki() like this: [[Some 
> link text @some-wiki-page]] - link is written as absolute URL. If I 
move my database to another site all the links in wiki pages 
> break. Can I change this behavior or is this a feature?

Dragan

I cannot reproduce it. I put the link in the body of a wiki and it gets 
stored as is (with wiki syntax) in the db. The absolute link is serialized 
as html when processed by the view, so it should change its form according 
to the app which hosts the wiki document. How are the links in the new app 
different?

-- 





[web2py] Allowing external access to web2py server ?

2012-12-07 Thread Richard Shea
I want to start a web2py server so that it can be accessed externally
to the hosting server.

I've read this http://web2py.com/books/default/chapter/29/03

By default, web2py runs its web server on 127.0.0.1:8000 (port 8000
> on localhost), but you can run it on any available IP address and
> port. You can query the IP address of your network interface by
> opening a command line and typing ipconfig on Windows or ifconfig on
> OS X and Linux. From now on we assume web2py is running on localhost
> (127.0.0.1:8000). Use 0.0.0.0:80 to run web2py publicly on any of your
> network interfaces.
>

but I can't find how to "Use 0.0.0.0:80" ?

There doesn't seem to be a command line argument which does that ? 

I'm aware of the command line arg to change the port but how do I allow 
access from all addresses.

thanks

Richard.

-- 





[web2py] auth.wiki() writes apsolute links for wiki pages. Can I change it to write only relative url?

2012-12-07 Thread Dragan Matic
Currently if I write markmin link in auth.wiki() like this: [[Some link 
text @some-wiki-page]] - link is written as absolute URL. If I move my 
database to another site all the links in wiki pages break. Can I change 
this behavior or is this a feature?

Dragan

-- 





[web2py] Re: need help: No space left on device

2012-12-07 Thread Alan Etkin
> I know that this is not because of web2py, but I am getting an error 
which says "No space left on device"
> Is it because of no space on disk or can be also something else?

Perhaps this can help:
http://stackoverflow.com/questions/6998083/python-causing-ioerror-errno-28-no-space-left-on-device-results-32766-h

It says you ought to look for filesystem issues like number of files, 
folders or file size limits.

-- 





[web2py] Re: IS_IN_SET problem.

2012-12-07 Thread Alan Etkin

>
> default=0,requires=IS_IN_SET([0,1,2,3,4,5,6,7,8,9,10])),
>
> When rating is 0 the drop down field is empty and the drop down list shows 
> the set of ints.
> When rating is greater than 0 the drop down field does display the int.
>


I think this this should be fixed:
http://code.google.com/p/web2py/issues/detail?id=1207

-- 





[web2py] need help: No space left on device

2012-12-07 Thread Vasile Ermicioi
hi,


I know that this is not because of web2py, but I am getting an error which 
says "No space left on device"
Is it because of no space on disk or can be also something else?

Traceback (most recent call last):
  File "/home/myuser/web2py/gluon/main.py", line 447, in wsgibase
parse_get_post_vars(request, environ)
  File "/home/myuser/web2py/gluon/main.py", line 275, in parse_get_post_vars
request.body = copystream_progress(request) ### stores request body
  File "/home/myuser/web2py/gluon/main.py", line 143, in copystream_progress
copystream(source, dest, size, chunk_size)
  File "/home/myuser/web2py/gluon/fileutils.py", line 386, in copystream
dest.seek(0)
IOError: [Errno 28] No space left on device

-- 





Re: [web2py] Re: controller that don't returns a view?

2012-12-07 Thread Jonas Fredriksson
Thanks.

Actually the call comes from a button: 

It has to provide the right result.id so the like addition relates to
the right post.
I will try using callbacks from the button call to see if it works.

On Thu, Dec 6, 2012 at 11:17 PM, Niphlod  wrote:
> Learned something also today! Nice one Anthony!
>
>
> On Thursday, December 6, 2012 11:11:05 PM UTC+1, Anthony wrote:
>>
>>
>>> def plus_minus(fakearg=0):
>>> .
>>>
>>
>> Note, rather than using a fake argument to prevent public access, you can
>> also simply start the function name with a double underscore:
>>
>> def __plus_minus():
>>
>> Anthony
>
> --
>
>
>

--