[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-09 Thread Gliese 581 g
Hi Massimo,
Thanks for suggesting this solution. I am now able to display a gird on my 
page with pagination and sorting options available. But whenever I click on 
page number or try to sort a column by clicking on its header, nothing 
happens. I get a blank page. I tried to debug it and found that when I 
click on any page number, post back takes place but form doesnt get 
validated(validation fails) and I do not get to see any grid. I am posting 
my code here. Please correct me if I have done anything wrong in it.
 
def index():
result=None
x=None
searchform=SQLFORM.factory(
Field('id', 'unicode',requires=empty_to_none),
Field('account','unicode',requires=empty_to_none),
Field('fromdate','unicode',requires=empty_to_none),
Field('todate','unicode',requires=empty_to_none),
Field('name','unicode',requires=empty_to_none),
Field('status','integer'),

Field('method',requires=IS_EMPTY_OR(IS_IN_SET(['Method1','Method2','Method3'], 
sort=True, zero='Select'))), 

Field('type','unicode',requires=IS_EMPTY_OR(IS_IN_SET(['Type1','Type2',], 
sort=True, zero='Select'))), 
Field('altname','unicode',requires=empty_to_none),

Field('group','unicode',requires=IS_EMPTY_OR(IS_IN_SET(['Group1','Group2',], 
sort=True, zero='Select'))), 
Field('assignee','unicode',requires=empty_to_none),
submit_button = 'Search'
)
if searchform.accepts(request.vars,keepvalues=True):
searchform.process()
id=searchform.vars.id
status=searchform.vars.status
method=searchform.vars.method
name=searchform.vars.name 
account=searchform.vars.account 
fromdate=searchform.vars.fromdate 
todate=searchform.vars.todate 
type=searchform.vars.type
altname=searchform.vars.altname
assignee=searchform.vars.assignee 
group=searchform.vars.group
##THIS METHOD RETURNS A LIST OF OBJECTS
result=__get_objects(id, status, method, name, 
  account, fromdate, todate, type, altname,
  assignee, group)
##THIS IS CODE TO CREATE IN MEMORY TEMPORARY DATABASE
fields = [Field('ID'), Field('Method'), Field('Date'), 
  Field('Status'), Field('Account'), Field('Name'),
  Field('Amount1'), Field('Amount2'), Field('Type') 
]

temp_db = cache.ram('tmp_db',lambda: 
DAL('sqlite:memory').define_table('mytable',*fields)._db, None)   
temp_db.mytable.truncate()   
for obj in result['output']:
temp_db.mytable.insert(ID=obj['id'],
Method=obj['method'],
Date=obj['date'],
Status=obj['status'],
Account=obj['account'],
Name=obj['name'],
Amount1=obj['amount1'],
Amount2=obj['amount2'],
Type=obj['type'])

x = SQLFORM.grid(temp_db.mytable,create=False, deletable=False, 
 editable=False, maxtextlength=64, 
paginate=2,searchable=False,details=False)
else:
response.flash = 'please fill the form' 
return dict(form=searchform,result=result,x=x)
 
 
When postback happens due to any sorting or paging action, 
*searchform.accepts(request.vars,keepvalues=True) 
*fails and no grid gets displayed. Please help me to fix this.
 
Thank you

On Sunday, 8 September 2013 19:17:03 UTC+5:30, Massimo Di Pierro wrote:

> You cannot unless you first load the data in a database. You can use a 
> temporary in memory database like this:
>
> fields = [Field('one'), Field('two'), Field('three'), ...]
> temp_db = cache.ram('tmp_db',lambda: 
> DAL('sqlite:memory').define_table('mytable',*fields)._db, None)
>
> temp_db.mytable.truncate()
> temp_db.mytable.insert()
> form = SQLFORM.grid(temp_db.mytable)
>
>
> On Sunday, 8 September 2013 05:35:13 UTC-5, Gliese 581 g wrote:
>>
>> Hi Massimo,
>> I will try to be more specific.
>> I am developing a web2py application(APP1) which works on the data which 
>> it gets from another web2py application(APP2).
>> We do not have access to the database of APP2, we access their data 
>> through jsonrpc web services exposed by APP2.
>> Now, there is an API(get_objects) of APP2 which gives us a list of 
>> certain type of objects. APP2 internally fetch this data from its database 
>> and convert it to a list of specific type of objects.
>> I want it to be displayed in a table with sorting and paging 
>> capabilities. 
>> Can I use web2py's SQLFORM.grid to achieve this?
>> Please suggest me any solution.
>>
>> Thank you.
>>
>> On Friday, 6 September 2013 20:26:54 UTC+5:30, Gliese 581 g wrote:
>>>
>>>  **
>>>
>>> I am working on a project where we have a different subsystem whose API 
>>> returns a list of certain type of objects. 
>>>
>>> I want it to

[web2py] Re: Please help me to design my database structure

2013-09-09 Thread Luc Chase
You have thought of the correct solution ( I would call it project_steps ) 
.  




On Monday, 9 September 2013 17:12:04 UTC+1, Andreas Wienes wrote:
>
> Hello,
>
> I've three models called project, project_type and steps.
>
> A project belongs to a certain project_type and depending on what kind of 
> project it is, includes different steps. For example "writing a book" is a 
> new project and belongs to the project_type "hobby project".
>  
> "making a plan" and "get feedback" are steps for a "hobby project".  So 
> the project "writing a book" should contain this steps.
>
> *My question:*
> After creating a second project and saying it's also a "hobby project" the 
> new project is connected to the same steps like my first project. And if I 
> modify anything in a step, like mark "making a plan" as completed, it's 
> also completed for any other project. You can imagine that this is not what 
> I want to do.
>
> How can I create several steps for a new project, based on which 
> project_type it is?
>
> I thought about creating a new table "project-with-steps" and insert the 
> project_id and each project_steps for the project_type into it, but maybe 
> there is a smarter solution? 
>
> This is my current database definition:
>
> db.define_table('project_type',
> Field('title', notnull=True, unique=True),
> Field('description', 'text', notnull=True),
> format='%(title)s')
>
> db.define_table('project',
> Field('name', notnull=True),
> Field('description', 'text', notnull=True),
> Field('project_type', db.project_type, notnull=True),
> format='%(name)s')
>
> db.define_table('step',
> Field('title',  notnull=True, unique=True),
> Field('description', 'text', notnull=True),
> Field('project_id', db.project),
> format='%(title)s')
>
>
> db.define_table('project_type_with_steps',
> Field('type_id', db.project_type),
> Field('step_id', db.step))
>
>
>
>
> Thanks for your help!
> Andreas
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: Updating the auth_user profile that also has a one-to-many field?

2013-09-09 Thread Apple Mason
Ah, okay. Thanks!

On Monday, September 9, 2013 3:57:38 PM UTC-4, Niphlod wrote:
>
> your user_image is a reference to the id of the images table: you're the 
> one choosing to have it instead of the image itself on the auth_user table. 
> You have to deal with your model and your requirements making your own 
> profile update/insert page, dealing with all the things you explained .
>
> On Monday, September 9, 2013 9:50:40 PM UTC+2, Apple Mason wrote:
>>
>> I created a custom profile view so that the user can create/update his 
>> profile. Currently I have something like:
>>
>> models/db.py:
>>
>> db.define_table('images',
>>Field('image', 'upload', requires = IS_EMPTY_OR(IS_IMAGE()))
>>
>> auth.settings.extra_fields['auth_user'] = [
>>Field('user_image', 'reference images', requires=IS_NULL_OR(IS_IN_DB(
>> db, db.images.id)))
>> ]
>>
>>
>>
>> controller/default.py:
>> def user():
>> return dict(form=auth())
>>
>>
>>
>> view (for editing):
>>
>> {{=form.custom.begin}}
>>...
>>
>> Your Image: 
>>{{=form.custom.widget.user_image}}
>> {{=form.custom.end}}
>>
>> The problem is {{=form.custom.widget.user_image}} will render a dropdown 
>> of all image ids that are in the images table. Instead, I want a file 
>> upload, so that the user can change the image and it will be reflected in 
>> the database. How would I change the form to do this?
>>
>> Also, since an image doesn't initially exist for a user, web2py will have 
>> to first do the insert into the image table, and then update/insert it to 
>> the auth_user table. The other problem is if a user decides to change his 
>> user picture, then web2py has to deal with deleting the old picture in the 
>> database *and *on the filesystem.
>>
>> How can I handle these problems in 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/groups/opt_out.


[web2py] SQLFORM.grid and count field (web2py 2.6.0. test)

2013-09-09 Thread damufo


Hi,

I'm using web2py 2.6.0. test.

on  line sqlhtml 1916
columns = [f for f in fields if f.tablename in tablenames]

AttributeError: 'Expression' object has no attribute 'tablename'


when field count, count not attribute 'tablename'

My code:
submenus = db.menus.with_alias('menusoptions')
query = (db.menus.parent_id == 0)
count = submenus.id.count()

table = SQLFORM.grid(query,
 fields = [
   db.menus.title,
   count,
   ],
 left=submenus.on(db.menus.id == 
submenus.parent_id),
 groupby=db.menus.title,
)
---
I think that de problem is count, this not attribute tablename

fiel count is: Expression: COUNT(menusoptions.id)


when:
submenus = db.menus.with_alias('menusoptions')
query = (db.menus.parent_id == 0) 
count = submenus.id.count()
menus = db(query).select(db.menus.id, 
count,left=submenus.on(db.menus.id == submenus.parent_id), groupby=db.menus.id )
work fine.


Thanks.

-- 
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/groups/opt_out.


[web2py] Re: Please help me to design my database structure

2013-09-09 Thread Andreas Wienes
Thanks for your advice! I corrected the small error and created the new 
table. Now I'm trying to copy the steps for a specific project_type to a 
new created project.

I tried the following:

def start():
form = SQLFORM(db.project).process()
if form.accepted:
project_type = form.vars.project_type
for row in db(db.step.project_type_id==project_type).select():
# copy each step to the project_step table

redirect(URL('index', args=form.vars.project_type))
return locals()

But I don't know how to copy from one table to another. Any ideas?

-- 
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/groups/opt_out.


[web2py] Updating the auth_user profile that also has a one-to-many field?

2013-09-09 Thread Apple Mason
I created a custom profile view so that the user can create/update his 
profile. Currently I have something like:

models/db.py:

db.define_table('images',
   Field('image', 'upload', requires = IS_EMPTY_OR(IS_IMAGE()))

auth.settings.extra_fields['auth_user'] = [
   Field('user_image', 'reference images', requires=IS_NULL_OR(IS_IN_DB(db,db
.images.id)))
]



controller/default.py:
def user():
return dict(form=auth())



view (for editing):

{{=form.custom.begin}}
   ...
   
Your Image: 
   {{=form.custom.widget.user_image}}
{{=form.custom.end}}

The problem is {{=form.custom.widget.user_image}} will render a dropdown of 
all image ids that are in the images table. Instead, I want a file upload, 
so that the user can change the image and it will be reflected in the 
database. How would I change the form to do this?

Also, since an image doesn't initially exist for a user, web2py will have 
to first do the insert into the image table, and then update/insert it to 
the auth_user table. The other problem is if a user decides to change his 
user picture, then web2py has to deal with deleting the old picture in the 
database *and *on the filesystem.

How can I handle these problems in 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/groups/opt_out.


[web2py] Re: Crowdsourcing platform in Web2Py?

2013-09-09 Thread samuel bonill
link : 
https://github.com/codeupstudio/chipincode/wiki/O-que-%C3%A9-o-Chip-In-Code

link 2: https://github.com/codeupstudio/chipincode


El jueves, 4 de julio de 2013 04:35:01 UTC-5, D.P. escribió:
>
> Hello,
>
> it is my first post in this group, and it is a pleasure to be in, as I 
> really think that web2py is a great tool.
>
> I am trying to see if there is any opensource crowdsoucing platform made 
> in web2py? Does any know any of any code example?
>
> Regards,
>
> D.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Newby, can't connect to a Postgresl database

2013-09-09 Thread Massimo Di Pierro
You need postgresql 8.2+. postgresql 8.1 does not allow you changing the 
string escaping and, by default, it is non conform to the SQL standard. 
This results in a security issue with web2py. You must upgrade.

On Monday, 9 September 2013 10:43:55 UTC-5, Sartglider wrote:
>
> Change the platform: windows XP and postgresql 8.1,
> everything local, no root user, but now trys 5 seconds
> and give this error:
>  Failure to connect, tried 5 times: 
> Traceback (most recent call last): File 
> "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7413, in __init__ 
> File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 2648, in 
> __init__ File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 627, 
> in reconnect File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 
> 579, in after_connection_hook File 
> "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 2652, in 
> after_connection File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", 
> line 1784, in execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 1778, in 
> log_execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line 
> 246, in _fn File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line 
> 317, in execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line 
> 322, in _execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/interface.py", 
> line 399, in execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/interface.py", 
> line 169, in execute File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line 
> 943, in _fn File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line 
> 1142, in bind File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line 
> 911, in handle_messages File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line 
> 1181, in _bind_nodata File 
> "/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line 
> 916, in handle_messages ProgrammingError: ('ERROR', '55P02', 'parameter 
> "standard_conforming_strings" cannot be changed') 
>
>
>
>
>
>
> On 9 September 2013 08:35, Johann Spies 
> > wrote:
>
>> Postgresql would not allow root as a database user.  It is also not safe 
>> to work with 'postgres' as your normal user for normal day-to-day usage as 
>> postgres is the superuser for Postgresql.  So you have to create a user in 
>> postgresql, create the correct database with the user you created as owner, 
>> modify your pg_hba.conf if necessary, apply the correct configuration for 
>> that user in web2py.
>>
>> Regards
>> Johann
>>
>>
>> On 8 September 2013 23:07, starglider.dev 
>> > wrote:
>>
>>> Actually it as a root user because all application connect to the server 
>>> by root, the other software is made with
>>> python & pscopg2.
>>>
>>> I try to connect by psql from the server that as web2py and it worked,
>>> also create a model with this script: 
>>> https://github.com/phektus/cvstash/blob/master/scripts/extract_pgsql_models.py
>>>
>>> and it try to connect endlessly.
>>>
>>> Thank for your replay.
>>>
>>>  
>>>
>>>
>>> On 8 September 2013 21:56, Dragan Matic 
>>> > wrote:
>>>
 Postgres probably doesn't have 'root' as user. Its root user is 
 'postgres'. 

 After that check if your address is allowed to connect to postgres 
 server in pg_hba.conf  and if server is listening on your network 
 ('listen_addresses' setting in postgresql.conf). It could also be a 
 firewall issue, check is port 5432 is open. 

 On Sunday, September 8, 2013 5:47:38 PM UTC+2, Sartglider wrote:
>
> Hi,
> I'm really new to web2py - less than 24 hours - 
> Trying to follow this example http://web2py.com/books/**
> default/chapter/29/03/**overview#Say-hello
> it worked fine with sqlite, so I try to connect to a postgresql 
> database in another server:
> the model is this one:
> db = DAL("postgres://root:<**password>@192.168.0.98/teste")
>
> db.define_table('equipments',
>Field('eq_id', unique=True),
>Field('eq_model'),
>Field('eq_aka'),
>format = '%(title)s')
>
> db.equipments.eq_id.requires = IS_NOT_IN_DB(db, db.equipments.eq_model)
> db.equipments.eq_model.**requires = IS_IN_DB(db, db.equipments.eq_id, 
> '%(title)s')
>
> db.equipments.eq_id.writable = False
>
> but I get no errors just the browser trying to connect.
>
> Thank you in advance for your help.
>
>
> Postgresq server: debian 6 & postgresql 8.4
> web2Py server: debian 7, python 2.7
>
>  -- 
  
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiv

[web2py] wey2py+apache+windows

2013-09-09 Thread agosalo
Hello everyone,

just attached to web2py framework. 
Can anybody guide me install web2py+apache+windows in intranet environment. 
I've found tutorials but somewhat misleading or I can't perceive it 
properly. Tried 
http://ochiba77.blogspot.com/2011/10/how-to-setup-web2py-apache-wsgi-uniform.html
 
but have no luck

thanks in advance
  

-- 
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/groups/opt_out.


[web2py] Re: Defining one extra auth table

2013-09-09 Thread Massimo Di Pierro
Probably this is the easiest solution:

http://www.web2py.com/books/default/chapter/29/09/access-control?search=extra_fields

You can always defined your own additional tables with db.define_table(...)

On Monday, 9 September 2013 11:07:30 UTC-5, ranjith wrote:
>
> Hi,
>
> I want to define one extra auth table. Could you pls explain me how to do 
> that?
> Currently the auth class has user, role,group and permission tables.
> I want to develop a web application related to colleges. So, I want to 
> define one more extra table which contain the colleges and the users table 
> need to have link to the college table and the group is the combination of 
> college, user, role.
>
> Or else is it possible to include the college related info in the existing 
> table itself? Could you pls let me know which one is good. Thanks
>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Why doesnt web2py need to be installed?

2013-09-09 Thread Richard Vézina
Yes you can copy/paste the app and it will work as long as there a is a
web2py properly setup and running on the remote machine. Notice that is you
want to improve execution time you can put in prod/staging the bytecomplied
app. There is a button in the admin to compile your app.

Richard


On Mon, Sep 9, 2013 at 11:42 AM, Muzaffar  wrote:

> I am currently using CodeIgniter and now moving to web2py and noticed its
> similar in how easy it is to start. I like the feature of web2py not having
> to be installed. Does this sacrifice anything performance-wise for example?
> Whats the tech/reasoning behind not making this more common among web MVC
> frameworks? Because it doesnt need to be installed, I would be able to copy
> the folder over to another server and get it running quickly correct? I
> recently tried setting up RoR and have tremendous problems with gems, RVM
> and incompatibility issues, and I am thankful for this web2py feature.
>
> --
>
> ---
> 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/groups/opt_out.
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: link to item on list.

2013-09-09 Thread אבי אברמוביץ
Alright, that works for me:
items = db().select(db.t_items.ALL, cache=(cache.ram, 60))

I guess there is a method to create a select request on the background? for 
the list the user is currently watching or even to other queries that the 
user might get to via the page links? Thanks. 

On Monday, September 9, 2013 6:25:54 PM UTC+3, Anthony wrote:
>
> On Monday, September 9, 2013 11:20:02 AM UTC-4, אבי אברמוביץ wrote:
>
>> Thanks, yes, I know of the item.id problem for next and previous, I just 
>> used it for now I'll try to do something with the 
>> http://docs.python.org/2/library/functions.html#enumerate later on.Will 
>> I also have to ask from the controller to change each item page meta data 
>> for google indexing?
>>
>
> Sure, you could change some of the page metadata from the controller as 
> well.
>
>

-- 
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/groups/opt_out.


[web2py] Re: We deployed web2py with apache2 but when we need password to access https://outser.com/appadmin

2013-09-09 Thread Massimo Di Pierro
When you start web2py, you set the password. How do you start web2py?

On Monday, 9 September 2013 14:18:39 UTC-5, D Dan wrote:
>
> What is the password to admin access? Where to set this password?
>
>
> Thanks
>

-- 
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/groups/opt_out.


[web2py] About Python Logo

2013-09-09 Thread Massimo Di Pierro
Quote from: 
http://pythonconquerstheuniverse.wordpress.com/2009/10/03/python-java-a-side-by-side-comparison/#comment-2495



The Python logo is obviously a snake. The name of the language, however, 
was based on Monty Python. So what this means is that you are going to have 
good laughs when the python bytes you. Specially when the code is too long 
to debug or understand.

The Java logo is a cup of coffee. What this means is that you are going to 
need coffee when programming in Java or you will fall asleep. In fact you 
are going to need loads of coffee when your code is near production stage. 
BTW I don’t drink coffee, so my job is twice as hard.

Jython is when you give coffee to a snake. Jython users are people that 
drank toomuch coffee and over time it doesn’t have any effect anymore. 
Since the python needs to sleep, the solution is giving coffee so that Java 
programmers can also have laughs at late hours of the day.



-- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Christopher Morlier
Okay, that is what I what I was anticipating when I asked, "Do the 
validators not check required fields?"

The behavior is still a little surprising to me, since 
validate_and_insert() is part of the DAL, and it has an explicit method of 
reporting errors.  It is also surprising to me that an error returns a 200 
code on an error, but maybe that is just a problem for my use case.

Wrapping the call with a try block and handling the exceptions seems to be 
working for me.

Thanks for the clarification!

On Monday, September 9, 2013 3:19:17 PM UTC-5, Anthony wrote:
>
> From the book:
>
> Notice that requires=... is enforced at the level of forms, required=True is 
> enforced at the level of the DAL (insert), while notnull,unique and 
> ondelete are enforced at the level of the database. While they sometimes 
> may seem redundant, it is important to maintain the distinction when 
> programming with the DAL.
>
> If you specified required=True, that is not handled by form validation or 
> .validate_and_insert(). Instead, that is enforced by the DAL during an 
> .insert(), and failure simply results in an exception being thrown, not a 
> validation error being returned.
>
> Anthony
>
> On Monday, September 9, 2013 12:07:46 PM UTC-4, Christopher Morlier wrote:
>>
>> At the moment, I am not explicitly providing any validators; so I expect 
>> only the default validators for my field types.
>>
>> Actually, the test where this arises is when I leave out a required 
>> field, and I get the error "Table: missing required field: time_stamp".  Do 
>> the validators not check required fields?
>>
>>
>> On Monday, September 9, 2013 10:28:56 AM UTC-5, Niphlod wrote:
>>>
>>> how do you specify the validators for your required fields ?
>>>
>>> On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:

 Hello,

 I am implementing a RESTful API and have the following code in my POST 
 handler:

 ret = db.recording.validate_and_insert(**fixed_fields)
 if ret.errors:
 raise HTTP(400, 'Validation failed: ' + str(ret.errors))

 url = URL('api', args=('recording',ret.id))
 response.headers['Location'] = url
 response.status = 201
 return dict(link=A('Recording ', ret.id, _href=url))

 On success, things work as expected.  However, if I omit a required 
 field, none of my code after validate_and_insert() is called.  The client 
 receives a HTTP 200 response as if all is well, albeit with an appropriate 
 text description of the error.

 This is not how validate_and_insert() is described in chapter 6 of the 
 book.  Is there a reason it is different?

 As a work around I added a try-except block around the 
  validate_and_insert() call, expecting an HTTP exception, but discovered 
 it 
 is actually a RuntimeError exception.
 Is this the recommended work around or is there a better solution?

 I browsed through the code, but it isn't clear to me where the 
 exception is thrown.  However, I believe I noticed two typos in the 
 "validate_and_insert, validate_and_update" section:"ret.error" should be 
 "ret.errors" and "res.updated" should be "ret.updated".

 BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
 Apache/2.2.16 (Debian)

 Thanks for your help,
 Chris

>>>

-- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Anthony
On Monday, September 9, 2013 4:40:43 PM UTC-4, Christopher Morlier wrote:

> Okay, that is what I what I was anticipating when I asked, "Do the 
> validators not check required fields?"
>
> The behavior is still a little surprising to me, since 
> validate_and_insert() is part of the DAL, and it has an explicit method of 
> reporting errors.
>

The "validators" are the things you put in the "requires" attribute of a 
field, typically for use with forms. The .validate_and_insert() method was 
added to enable manual (i.e., non-form) inserts that still run the 
validators. The "required" attribute is not a validator in this sense -- it 
is enforced directly by the DAL on any insert. The intention of 
.validate_and_insert() is to behave as form validation would -- that is why 
it doesn't do anything special with the "required" attribute. The 
"required" attribute is still processed as usual, but by the .insert() 
method that gets called by .validate_and_insert(). If your goal is to use 
validators to require values, simply use the IS_NOT_EMPTY() validator.
 

>  It is also surprising to me that an error returns a 200 code on an error, 
> but maybe that is just a problem for my use case.
>

That does seem odd -- can you show the full code and how you are making the 
call?

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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Anthony
>From the book:

Notice that requires=... is enforced at the level of forms, required=True is 
enforced at the level of the DAL (insert), while notnull,unique and ondelete 
are 
enforced at the level of the database. While they sometimes may seem 
redundant, it is important to maintain the distinction when programming 
with the DAL.

If you specified required=True, that is not handled by form validation or 
.validate_and_insert(). Instead, that is enforced by the DAL during an 
.insert(), and failure simply results in an exception being thrown, not a 
validation error being returned.

Anthony

On Monday, September 9, 2013 12:07:46 PM UTC-4, Christopher Morlier wrote:
>
> At the moment, I am not explicitly providing any validators; so I expect 
> only the default validators for my field types.
>
> Actually, the test where this arises is when I leave out a required field, 
> and I get the error "Table: missing required field: time_stamp".  Do the 
> validators not check required fields?
>
>
> On Monday, September 9, 2013 10:28:56 AM UTC-5, Niphlod wrote:
>>
>> how do you specify the validators for your required fields ?
>>
>> On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:
>>>
>>> Hello,
>>>
>>> I am implementing a RESTful API and have the following code in my POST 
>>> handler:
>>>
>>> ret = db.recording.validate_and_insert(**fixed_fields)
>>> if ret.errors:
>>> raise HTTP(400, 'Validation failed: ' + str(ret.errors))
>>>
>>> url = URL('api', args=('recording',ret.id))
>>> response.headers['Location'] = url
>>> response.status = 201
>>> return dict(link=A('Recording ', ret.id, _href=url))
>>>
>>> On success, things work as expected.  However, if I omit a required 
>>> field, none of my code after validate_and_insert() is called.  The client 
>>> receives a HTTP 200 response as if all is well, albeit with an appropriate 
>>> text description of the error.
>>>
>>> This is not how validate_and_insert() is described in chapter 6 of the 
>>> book.  Is there a reason it is different?
>>>
>>> As a work around I added a try-except block around the 
>>>  validate_and_insert() call, expecting an HTTP exception, but discovered it 
>>> is actually a RuntimeError exception.
>>> Is this the recommended work around or is there a better solution?
>>>
>>> I browsed through the code, but it isn't clear to me where the exception 
>>> is thrown.  However, I believe I noticed two typos in the 
>>> "validate_and_insert, validate_and_update" section:"ret.error" should be 
>>> "ret.errors" and "res.updated" should be "ret.updated".
>>>
>>> BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
>>> Apache/2.2.16 (Debian)
>>>
>>> Thanks for your help,
>>> Chris
>>>
>>

-- 
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/groups/opt_out.


[web2py] Re: wey2py+apache+windows

2013-09-09 Thread Niphlod
does this work ?

http://web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-and-mod_wsgi

On Monday, September 9, 2013 8:21:26 PM UTC+2, ago...@gmail.com wrote:
>
> Hello everyone,
>
> just attached to web2py framework. 
> Can anybody guide me install web2py+apache+windows in intranet 
> environment. I've found tutorials but somewhat misleading or I can't 
> perceive it properly. Tried 
> http://ochiba77.blogspot.com/2011/10/how-to-setup-web2py-apache-wsgi-uniform.htmlbut
>  have no luck
>
> thanks in advance
>   
>

-- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Christopher Morlier
Basically it is this:

db.define_table('recording',
Field('time_stamp','bigint',required=
True,
  comment='Recording creation time in milliseconds.'),
Field('system_id', 'reference system',  required=
True,
  comment='Reference to recording system.'),
Field('video', 'upload',required=
True,
  uploadfolder=os.path.join(request.folder,'upload/videos'),
  uploadseparate=True, length=256,
  comment='Filename for the uploaded file.'),
Field('description',   'string',   length=256,
  comment='Optional description for recordings.'),
format=format_recording
)


On Monday, September 9, 2013 1:52:43 PM UTC-5, Niphlod wrote:
>
> ok, let me rephrase: what is your model ?
>
> On Monday, September 9, 2013 6:07:46 PM UTC+2, Christopher Morlier wrote:
>>
>> At the moment, I am not explicitly providing any validators; so I expect 
>> only the default validators for my field types.
>>
>> Actually, the test where this arises is when I leave out a required 
>> field, and I get the error "Table: missing required field: time_stamp".  Do 
>> the validators not check required fields?
>>
>>
>> On Monday, September 9, 2013 10:28:56 AM UTC-5, Niphlod wrote:
>>>
>>> how do you specify the validators for your required fields ?
>>>
>>> On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:

 Hello,

 I am implementing a RESTful API and have the following code in my POST 
 handler:

 ret = db.recording.validate_and_insert(**fixed_fields)
 if ret.errors:
 raise HTTP(400, 'Validation failed: ' + str(ret.errors))

 url = URL('api', args=('recording',ret.id))
 response.headers['Location'] = url
 response.status = 201
 return dict(link=A('Recording ', ret.id, _href=url))

 On success, things work as expected.  However, if I omit a required 
 field, none of my code after validate_and_insert() is called.  The client 
 receives a HTTP 200 response as if all is well, albeit with an appropriate 
 text description of the error.

 This is not how validate_and_insert() is described in chapter 6 of the 
 book.  Is there a reason it is different?

 As a work around I added a try-except block around the 
  validate_and_insert() call, expecting an HTTP exception, but discovered 
 it 
 is actually a RuntimeError exception.
 Is this the recommended work around or is there a better solution?

 I browsed through the code, but it isn't clear to me where the 
 exception is thrown.  However, I believe I noticed two typos in the 
 "validate_and_insert, validate_and_update" section:"ret.error" should be 
 "ret.errors" and "res.updated" should be "ret.updated".

 BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
 Apache/2.2.16 (Debian)

 Thanks for your help,
 Chris

>>>

-- 
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/groups/opt_out.


Re: [web2py] Re: How to leverage web2py popularity and usage?

2013-09-09 Thread Anthony
There was one: http://www.web2py.com.ar/planet/. Looks like it's returning 
an error ticket now.

Anthony

On Monday, September 9, 2013 12:39:48 PM UTC-4, Julie Bouillon wrote:
>
>  If there's enough enough bloggers out there writing about web2py, I'll 
> be happy to put a "planet web2py" in place.
> Just let me know if there's an interest for that.
>
> Julie
>
> On 09/07/2013 06:01 PM, Massimo Di Pierro wrote:
>  
> yes the number time distance between releases has increased, mostly 
> because the new features we are adding are more complex (or would have done 
> it before). 
>
>  I do not know about the number of users.
>
>  I definitively think we need more people to blog about web2py.
>
>  massimo
>
> On Saturday, 7 September 2013 05:07:53 UTC-5, LightDot wrote: 
>>
>> I'm always sorry to see a good open source project with little or no 
>> documentation and a myriad of them are in this sad state. Luckily, web2py 
>> doesn't have this problem.
>>
>> The existence of the documentation is this fairly complete form is one of 
>> the reasons I chose web2py over other python frameworks. I don't think 
>> having 40 pages more or less would make me consider web2py faster or 
>> slower. But a lack of a chapter in the book might have made me choose 
>> another framework.
>>
>> I agree that new users need simple examples, but not at the expense of an 
>> in depth manual. If there is a consensus that web2py book can be 
>> intimidating for a complete begginer, perhaps someone can write a short "My 
>> first web2py project" in a book form, or something similar? I personally 
>> think this can be better served with blog articles and publishing of slices.
>>
>> Perhaps the growh of web2py userbase has slowed a bit..? I'm not sure 
>> that it did though. I don't have any insight into statistics to think one 
>> way or another and I don't trust my perception with this.
>>
>> What did slow down is the pace of web2py releases, hasn't it? The period 
>> between releases is longer than it used to be.
>>
>>
>> On Saturday, September 7, 2013 9:54:45 AM UTC+2, webpypy wrote: 
>>>
>>>
>>> As Massimo said, " the main advantage/objective of web2py framework is 
>>> to be the easiest and fastest to develop web applications".
>>>
>>>  I think the rate of growing popularity/interest was high for versions 
>>> < 2.0 , compared with versions >= 2.0 .
>>> Maybe because of the big size of manual for versions >2.0 , The big 
>>> manual means it is not expected to be the easiest and fastest anymore.
>>>
>>>  I suggest explaining the features through well documented 
>>> examples/appliances, keeping the manual small... 
>>>
>>> -- 
>  
> --- 
> 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/groups/opt_out.
>
>
>  

-- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Niphlod
ok, let me rephrase: what is your model ?

On Monday, September 9, 2013 6:07:46 PM UTC+2, Christopher Morlier wrote:
>
> At the moment, I am not explicitly providing any validators; so I expect 
> only the default validators for my field types.
>
> Actually, the test where this arises is when I leave out a required field, 
> and I get the error "Table: missing required field: time_stamp".  Do the 
> validators not check required fields?
>
>
> On Monday, September 9, 2013 10:28:56 AM UTC-5, Niphlod wrote:
>>
>> how do you specify the validators for your required fields ?
>>
>> On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:
>>>
>>> Hello,
>>>
>>> I am implementing a RESTful API and have the following code in my POST 
>>> handler:
>>>
>>> ret = db.recording.validate_and_insert(**fixed_fields)
>>> if ret.errors:
>>> raise HTTP(400, 'Validation failed: ' + str(ret.errors))
>>>
>>> url = URL('api', args=('recording',ret.id))
>>> response.headers['Location'] = url
>>> response.status = 201
>>> return dict(link=A('Recording ', ret.id, _href=url))
>>>
>>> On success, things work as expected.  However, if I omit a required 
>>> field, none of my code after validate_and_insert() is called.  The client 
>>> receives a HTTP 200 response as if all is well, albeit with an appropriate 
>>> text description of the error.
>>>
>>> This is not how validate_and_insert() is described in chapter 6 of the 
>>> book.  Is there a reason it is different?
>>>
>>> As a work around I added a try-except block around the 
>>>  validate_and_insert() call, expecting an HTTP exception, but discovered it 
>>> is actually a RuntimeError exception.
>>> Is this the recommended work around or is there a better solution?
>>>
>>> I browsed through the code, but it isn't clear to me where the exception 
>>> is thrown.  However, I believe I noticed two typos in the 
>>> "validate_and_insert, validate_and_update" section:"ret.error" should be 
>>> "ret.errors" and "res.updated" should be "ret.updated".
>>>
>>> BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
>>> Apache/2.2.16 (Debian)
>>>
>>> Thanks for your help,
>>> Chris
>>>
>>

-- 

--- 
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/groups/opt_out.


[web2py] Re: Updating the auth_user profile that also has a one-to-many field?

2013-09-09 Thread Niphlod
your user_image is a reference to the id of the images table: you're the 
one choosing to have it instead of the image itself on the auth_user table. 
You have to deal with your model and your requirements making your own 
profile update/insert page, dealing with all the things you explained .

On Monday, September 9, 2013 9:50:40 PM UTC+2, Apple Mason wrote:
>
> I created a custom profile view so that the user can create/update his 
> profile. Currently I have something like:
>
> models/db.py:
>
> db.define_table('images',
>Field('image', 'upload', requires = IS_EMPTY_OR(IS_IMAGE()))
>
> auth.settings.extra_fields['auth_user'] = [
>Field('user_image', 'reference images', requires=IS_NULL_OR(IS_IN_DB(db
> , db.images.id)))
> ]
>
>
>
> controller/default.py:
> def user():
> return dict(form=auth())
>
>
>
> view (for editing):
>
> {{=form.custom.begin}}
>...
>
> Your Image: 
>{{=form.custom.widget.user_image}}
> {{=form.custom.end}}
>
> The problem is {{=form.custom.widget.user_image}} will render a dropdown 
> of all image ids that are in the images table. Instead, I want a file 
> upload, so that the user can change the image and it will be reflected in 
> the database. How would I change the form to do this?
>
> Also, since an image doesn't initially exist for a user, web2py will have 
> to first do the insert into the image table, and then update/insert it to 
> the auth_user table. The other problem is if a user decides to change his 
> user picture, then web2py has to deal with deleting the old picture in the 
> database *and *on the filesystem.
>
> How can I handle these problems in 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/groups/opt_out.


[web2py] We deployed web2py with apache2 but when we need password to access https://outser.com/appadmin

2013-09-09 Thread D Dan
What is the password to admin access? Where to set this password?


Thanks

-- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Christopher Morlier
At the moment, I am not explicitly providing any validators; so I expect 
only the default validators for my field types.

Actually, the test where this arises is when I leave out a required field, 
and I get the error "Table: missing required field: time_stamp".  Do the 
validators not check required fields?


On Monday, September 9, 2013 10:28:56 AM UTC-5, Niphlod wrote:
>
> how do you specify the validators for your required fields ?
>
> On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:
>>
>> Hello,
>>
>> I am implementing a RESTful API and have the following code in my POST 
>> handler:
>>
>> ret = db.recording.validate_and_insert(**fixed_fields)
>> if ret.errors:
>> raise HTTP(400, 'Validation failed: ' + str(ret.errors))
>>
>> url = URL('api', args=('recording',ret.id))
>> response.headers['Location'] = url
>> response.status = 201
>> return dict(link=A('Recording ', ret.id, _href=url))
>>
>> On success, things work as expected.  However, if I omit a required 
>> field, none of my code after validate_and_insert() is called.  The client 
>> receives a HTTP 200 response as if all is well, albeit with an appropriate 
>> text description of the error.
>>
>> This is not how validate_and_insert() is described in chapter 6 of the 
>> book.  Is there a reason it is different?
>>
>> As a work around I added a try-except block around the 
>>  validate_and_insert() call, expecting an HTTP exception, but discovered it 
>> is actually a RuntimeError exception.
>> Is this the recommended work around or is there a better solution?
>>
>> I browsed through the code, but it isn't clear to me where the exception 
>> is thrown.  However, I believe I noticed two typos in the 
>> "validate_and_insert, validate_and_update" section:"ret.error" should be 
>> "ret.errors" and "res.updated" should be "ret.updated".
>>
>> BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
>> Apache/2.2.16 (Debian)
>>
>> Thanks for your help,
>> Chris
>>
>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: How to leverage web2py popularity and usage?

2013-09-09 Thread Mirko Scavazzin
I'm interested in.

Julie Bouillon  a écrit :

>If there's enough enough bloggers out there writing about web2py, I'll be 
>happy to put a "planet web2py" in place.
>Just let me know if there's an interest for that.
>
>Julie
>
>On 09/07/2013 06:01 PM, Massimo Di Pierro wrote:
>
>yes the number time distance between releases has increased, mostly because 
>the new features we are adding are more complex (or would have done it 
>before). 
>
>
>I do not know about the number of users.
>
>
>I definitively think we need more people to blog about web2py.
>
>
>massimo
>
>On Saturday, 7 September 2013 05:07:53 UTC-5, LightDot wrote: 
>
>I'm always sorry to see a good open source project with little or no 
>documentation and a myriad of them are in this sad state. Luckily, web2py 
>doesn't have this problem.
>
>The existence of the documentation is this fairly complete form is one of the 
>reasons I chose web2py over other python frameworks. I don't think having 40 
>pages more or less would make me consider web2py faster or slower. But a lack 
>of a chapter in the book might have made me choose another framework.
>
>I agree that new users need simple examples, but not at the expense of an in 
>depth manual. If there is a consensus that web2py book can be intimidating for 
>a complete begginer, perhaps someone can write a short "My first web2py 
>project" in a book form, or something similar? I personally think this can be 
>better served with blog articles and publishing of slices.
>
>Perhaps the growh of web2py userbase has slowed a bit..? I'm not sure that it 
>did though. I don't have any insight into statistics to think one way or 
>another and I don't trust my perception with this.
>
>What did slow down is the pace of web2py releases, hasn't it? The period 
>between releases is longer than it used to be.
>
>
>On Saturday, September 7, 2013 9:54:45 AM UTC+2, webpypy wrote: 
>
>
>As Massimo said, " the main advantage/objective of web2py framework is to be 
>the easiest and fastest to develop web applications".
>
>
>I think the rate of growing popularity/interest was high for versions < 2.0 , 
>compared with versions >= 2.0 .
>
>Maybe because of the big size of manual for versions >2.0 , The big manual 
>means it is not expected to be the easiest and fastest anymore.
>
>
>I suggest explaining the features through well documented examples/appliances, 
>keeping the manual small... 
>
>
>-- 
> 
>--- 
>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/groups/opt_out.
>
>
>-- 
> 
>--- 
>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/groups/opt_out.

-- 

--- 
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/groups/opt_out.


[web2py] Re: how to create rickshaw graph in the web2py

2013-09-09 Thread Dave S
Just to be sure the question is understood, you're talking about using this 
tool in web2py?





On Friday, September 6, 2013 4:35:04 AM UTC-7, Pramod Jadhav wrote:
>
> h
>


/dps "newbie with no answers"
 

-- 

--- 
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/groups/opt_out.


[web2py] Re: how to create rickshaw graph in the web2py

2013-09-09 Thread Dave S


On Monday, September 9, 2013 10:41:53 AM UTC-7, Dave S wrote:
>
> Just to be sure the question is understood, you're talking about using 
> this tool in web2py?
>
> 
>
>
>
> On Friday, September 6, 2013 4:35:04 AM UTC-7, Pramod Jadhav wrote:
>>
>> h
>>
>
>
> /dps "newbie with no answers"
>

Bust as a first guess, since this appears to be a javascript library, you'd 
have it in location it can be downloaded from (static/js ?) and then you'd 
put something in your views to invoke the javascript





 function myRickshawWrapper(){
   var myData=getMyData()

   
   
 vargraphnewRickshaw.graph(
{...})

graph.render

}


















 Hope that reads sensibly, gmail is being twitchy for me today so the 
whitespace might be ... awkward.

/dps

-- 

--- 
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/groups/opt_out.


[web2py] Re: Why doesnt web2py need to be installed?

2013-09-09 Thread Niphlod
"installed" in python barely means "put in a std dir, append that dir to 
the sys.path".
web2py will be eventually re-integrated with pipy, in order to be able to 
do "pip install web2py" and have it working just fine, but as of right now 
you can just download the zip and run it from wherever it is: no 
performance penalties at all.
BTW: any standard with no-dependencies package in python can be downloaded 
as source and be run as a standalone without having to install it. 

On Monday, September 9, 2013 5:42:37 PM UTC+2, Muzaffar wrote:
>
> I am currently using CodeIgniter and now moving to web2py and noticed its 
> similar in how easy it is to start. I like the feature of web2py not having 
> to be installed. Does this sacrifice anything performance-wise for example? 
> Whats the tech/reasoning behind not making this more common among web MVC 
> frameworks? Because it doesnt need to be installed, I would be able to copy 
> the folder over to another server and get it running quickly correct? I 
> recently tried setting up RoR and have tremendous problems with gems, RVM 
> and incompatibility issues, and I am thankful for this web2py feature. 
>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Newby, can't connect to a Postgresl database

2013-09-09 Thread starglider.dev
Change the platform: windows XP and postgresql 8.1,
everything local, no root user, but now trys 5 seconds
and give this error:
 Failure to connect, tried 5 times:
Traceback (most recent call last): File
"/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 7413, in __init__
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 2648, in
__init__ File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 627,
in reconnect File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line
579, in after_connection_hook File
"/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 2652, in
after_connection File "/home/mdipierro/make_web2py/web2py/gluon/dal.py",
line 1784, in execute File
"/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 1778, in
log_execute File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line
246, in _fn File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line
317, in execute File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/dbapi.py", line
322, in _execute File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/interface.py",
line 399, in execute File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/interface.py",
line 169, in execute File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line
943, in _fn File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line
1142, in bind File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line
911, in handle_messages File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line
1181, in _bind_nodata File
"/home/mdipierro/make_web2py/web2py/gluon/contrib/pg8000/protocol.py", line
916, in handle_messages ProgrammingError: ('ERROR', '55P02', 'parameter
"standard_conforming_strings" cannot be changed')






On 9 September 2013 08:35, Johann Spies  wrote:

> Postgresql would not allow root as a database user.  It is also not safe
> to work with 'postgres' as your normal user for normal day-to-day usage as
> postgres is the superuser for Postgresql.  So you have to create a user in
> postgresql, create the correct database with the user you created as owner,
> modify your pg_hba.conf if necessary, apply the correct configuration for
> that user in web2py.
>
> Regards
> Johann
>
>
> On 8 September 2013 23:07, starglider.dev wrote:
>
>> Actually it as a root user because all application connect to the server
>> by root, the other software is made with
>> python & pscopg2.
>>
>> I try to connect by psql from the server that as web2py and it worked,
>> also create a model with this script:
>> https://github.com/phektus/cvstash/blob/master/scripts/extract_pgsql_models.py
>>
>> and it try to connect endlessly.
>>
>> Thank for your replay.
>>
>>
>>
>>
>> On 8 September 2013 21:56, Dragan Matic wrote:
>>
>>> Postgres probably doesn't have 'root' as user. Its root user is
>>> 'postgres'.
>>>
>>> After that check if your address is allowed to connect to postgres
>>> server in pg_hba.conf  and if server is listening on your network
>>> ('listen_addresses' setting in postgresql.conf). It could also be a
>>> firewall issue, check is port 5432 is open.
>>>
>>> On Sunday, September 8, 2013 5:47:38 PM UTC+2, Sartglider wrote:

 Hi,
 I'm really new to web2py - less than 24 hours -
 Trying to follow this example http://web2py.com/books/**
 default/chapter/29/03/**overview#Say-hello
 it worked fine with sqlite, so I try to connect to a postgresql
 database in another server:
 the model is this one:
 db = DAL("postgres://root:<**password>@192.168.0.98/teste")

 db.define_table('equipments',
Field('eq_id', unique=True),
Field('eq_model'),
Field('eq_aka'),
format = '%(title)s')

 db.equipments.eq_id.requires = IS_NOT_IN_DB(db, db.equipments.eq_model)
 db.equipments.eq_model.**requires = IS_IN_DB(db, db.equipments.eq_id,
 '%(title)s')

 db.equipments.eq_id.writable = False

 but I get no errors just the browser trying to connect.

 Thank you in advance for your help.


 Postgresq server: debian 6 & postgresql 8.4
 web2Py server: debian 7, python 2.7

  --
>>>
>>> ---
>>> 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/groups/opt_out.
>>>
>>
>>  --
>>
>> ---
>> 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/groups/opt_out.
>>
>
>
>
> --
> Because experiencing

Re: [web2py] Re: How to leverage web2py popularity and usage?

2013-09-09 Thread Julie Bouillon
If there's enough enough bloggers out there writing about web2py, I'll
be happy to put a "planet web2py" in place.
Just let me know if there's an interest for that.

Julie

On 09/07/2013 06:01 PM, Massimo Di Pierro wrote:
> yes the number time distance between releases has increased, mostly
> because the new features we are adding are more complex (or would have
> done it before).
>
> I do not know about the number of users.
>
> I definitively think we need more people to blog about web2py.
>
> massimo
>
> On Saturday, 7 September 2013 05:07:53 UTC-5, LightDot wrote:
>
> I'm always sorry to see a good open source project with little or
> no documentation and a myriad of them are in this sad state.
> Luckily, web2py doesn't have this problem.
>
> The existence of the documentation is this fairly complete form is
> one of the reasons I chose web2py over other python frameworks. I
> don't think having 40 pages more or less would make me consider
> web2py faster or slower. But a lack of a chapter in the book might
> have made me choose another framework.
>
> I agree that new users need simple examples, but not at the
> expense of an in depth manual. If there is a consensus that web2py
> book can be intimidating for a complete begginer, perhaps someone
> can write a short "My first web2py project" in a book form, or
> something similar? I personally think this can be better served
> with blog articles and publishing of slices.
>
> Perhaps the growh of web2py userbase has slowed a bit..? I'm not
> sure that it did though. I don't have any insight into statistics
> to think one way or another and I don't trust my perception with this.
>
> What did slow down is the pace of web2py releases, hasn't it? The
> period between releases is longer than it used to be.
>
>
> On Saturday, September 7, 2013 9:54:45 AM UTC+2, webpypy wrote:
>
>
> As Massimo said, " the main advantage/objective of web2py
> framework is to be the easiest and fastest to develop web
> applications".
>
> I think the rate of growing popularity/interest was high for
> versions < 2.0 , compared with versions >= 2.0 .
> Maybe because of the big size of manual for versions >2.0 ,
> The big manual means it is not expected to be the easiest and
> fastest anymore.
>
> I suggest explaining the features through well documented
> examples/appliances, keeping the manual small... 
>
> -- 
>  
> ---
> 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/groups/opt_out.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: web2py on GoDaddy shared hosting

2013-09-09 Thread Richard Vézina
http://support.godaddy.com/help/category/436/web-hosting-languages-and-scripts-linuxbased-languages-and-scripts-python

Difficult to say...

You need Python and middleware wsgi, fastcgi, etc.

You will need an advice from someone that has godaddy shared server...

Richard


On Mon, Sep 9, 2013 at 12:10 PM, ranjith  wrote:

> If web2py installation in GoDaddy shared server  is not possible, let me
> know any of the good servers(cheap). My user base is in Tamil Nadu,India
>
>
> On Friday, 23 August 2013 12:58:56 UTC+5:30, ranjith wrote:
>>
>> Hi,
>>
>> I am new to web2py. I have a shared hosting account in Godaddy. Will I be
>> able to deploy my web2py app in GoDaddy??
>>
>  --
>
> ---
> 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/groups/opt_out.
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: smartgrid of grid and list of dictionary

2013-09-09 Thread keiser1080
thank you for your help Massimo.
I think there are a misunderstanding sory for that. (usualy i speak french, 
so sometime i say something and i would say otherting)
I don't mean it easy to do a function for converting a list of dictionary 
to a rows.
I mean if a fonction like that exist that would by easy to use any type of 
data, 
for example a mix between xml, json, any webservice.

I will explain I do an application for a monitoring of many network host.
I have an external script for an import of a uptodate hostdatabase.
In my controler I do  a select of a range of host, sometime the result of 
the select is more than 300.
>From the web2py controler I call my backend rabbitrpc ping service.
The call can take more than 10 secondes. Actualy i use the 
DAL('sqlite:memory') tu store the result and the web2pygrid to list the 
ping result and easyly filter short ect...

But is not efficient because for each sort the controler do (selct in table 
=> call rabbit ping => create temp databse) so more then 10 secondes.

Sorry for the misunderstanding 

-- 

--- 
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/groups/opt_out.


[web2py] Defining one extra auth table

2013-09-09 Thread ranjith
Hi,

I want to define one extra auth table. Could you pls explain me how to do 
that?
Currently the auth class has user, role,group and permission tables.
I want to develop a web application related to colleges. So, I want to 
define one more extra table which contain the colleges and the users table 
need to have link to the college table and the group is the combination of 
college, user, role.

Or else is it possible to include the college related info in the existing 
table itself? Could you pls let me know which one is good. Thanks

-- 

--- 
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/groups/opt_out.


[web2py] Please help me to design my database structure

2013-09-09 Thread Andreas Wienes
Hello,

I've three models called project, project_type and steps.

A project belongs to a certain project_type and depending on what kind of 
project it is, includes different steps. For example "writing a book" is a 
new project and belongs to the project_type "hobby project".
 
"making a plan" and "get feedback" are steps for a "hobby project".  So the 
project "writing a book" should contain this steps.

*My question:*
After creating a second project and saying it's also a "hobby project" the 
new project is connected to the same steps like my first project. And if I 
modify anything in a step, like mark "making a plan" as completed, it's 
also completed for any other project. You can imagine that this is not what 
I want to do.

How can I create several steps for a new project, based on which 
project_type it is?

I thought about creating a new table "project-with-steps" and insert the 
project_id and each project_steps for the project_type into it, but maybe 
there is a smarter solution? 

This is my current database definition:

db.define_table('project_type',
Field('title', notnull=True, unique=True),
Field('description', 'text', notnull=True),
format='%(title)s')

db.define_table('project',
Field('name', notnull=True),
Field('description', 'text', notnull=True),
Field('project_type', db.project_type, notnull=True),
format='%(name)s')

db.define_table('step',
Field('title',  notnull=True, unique=True),
Field('description', 'text', notnull=True),
Field('project_id', db.project),
format='%(title)s')


db.define_table('project_type_with_steps',
Field('type_id', db.project_type),
Field('step_id', db.step))




Thanks for your help!
Andreas

-- 

--- 
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/groups/opt_out.


[web2py] Why doesnt web2py need to be installed?

2013-09-09 Thread Muzaffar
I am currently using CodeIgniter and now moving to web2py and noticed its 
similar in how easy it is to start. I like the feature of web2py not having 
to be installed. Does this sacrifice anything performance-wise for example? 
Whats the tech/reasoning behind not making this more common among web MVC 
frameworks? Because it doesnt need to be installed, I would be able to copy 
the folder over to another server and get it running quickly correct? I 
recently tried setting up RoR and have tremendous problems with gems, RVM 
and incompatibility issues, and I am thankful for this web2py feature. 

-- 

--- 
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/groups/opt_out.


Re: [web2py] Crowdsourcing platform in Web2Py?

2013-09-09 Thread Ykä Marjanen
Hi,

check out Massimo's appliances from Git. There are lots of good example 
sources for web2py projects:

https://github.com/mdipierro/web2py-appliances

Ykä

On Monday, September 9, 2013 11:40:58 AM UTC+3, D.P. wrote:
>
> Sorry about the long time to answer. I will would be please to take a look 
> and help you testing it.
>
> Regards,
> D.
>
> On Thursday, July 4, 2013 4:35:23 PM UTC+2, Relsi Hur Maron wrote:
>>
>> What features you need?
>>
>> I'm developing a project of crowdsourcing here, is commercial but I'll 
>> release a part of the application opensource, with the following features
>> :
>>
>> - add/listing of jobs
>> - add/listing workers and portfolios
>> - signup employee and company
>> - submission of Proposals
>> - internal messages
>>
>> is a very alpha release, but if it fit for you, I can send the app to my 
>> repository on github and you get it.
>>
>>
>>
>> 2013/7/4 D.P. 
>>
>>> Hello,
>>>
>>> it is my first post in this group, and it is a pleasure to be in, as I 
>>> really think that web2py is a great tool.
>>>
>>> I am trying to see if there is any opensource crowdsoucing platform made 
>>> in web2py? Does any know any of any code example?
>>>
>>> Regards,
>>>
>>> D.
>>>
>>> -- 
>>>  
>>> --- 
>>> 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/groups/opt_out.
>>>  
>>>  
>>>
>>
>>

-- 

--- 
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/groups/opt_out.


[web2py] Re: web2py on GoDaddy shared hosting

2013-09-09 Thread ranjith
If web2py installation in GoDaddy shared server  is not possible, let me 
know any of the good servers(cheap). My user base is in Tamil Nadu,India

On Friday, 23 August 2013 12:58:56 UTC+5:30, ranjith wrote:
>
> Hi,
>
> I am new to web2py. I have a shared hosting account in Godaddy. Will I be 
> able to deploy my web2py app in GoDaddy??
>

-- 

--- 
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/groups/opt_out.


[web2py] Master-detail CRUD

2013-09-09 Thread Luc Chase
Given two joined tables, I can see how things work for  generating a CRUD 
form to manage each one.  But are there any examples of code available that 
show how to generate a view that allows both to be edited and saved at the 
same time?
e.g. Invoice header with Invoice-lines and one save button.

I think to do thing I would need to override the view 
for  linked_tables=['t_detail_table'], so that instead of presenting the 
detail table as a link it is as a nested CRUD form.  Is that correct?

-- 

--- 
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/groups/opt_out.


[web2py] Re: Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Niphlod
how do you specify the validators for your required fields ?

On Monday, September 9, 2013 5:09:04 AM UTC+2, Christopher Morlier wrote:
>
> Hello,
>
> I am implementing a RESTful API and have the following code in my POST 
> handler:
>
> ret = db.recording.validate_and_insert(**fixed_fields)
> if ret.errors:
> raise HTTP(400, 'Validation failed: ' + str(ret.errors))
>
> url = URL('api', args=('recording',ret.id))
> response.headers['Location'] = url
> response.status = 201
> return dict(link=A('Recording ', ret.id, _href=url))
>
> On success, things work as expected.  However, if I omit a required field, 
> none of my code after validate_and_insert() is called.  The client receives 
> a HTTP 200 response as if all is well, albeit with an appropriate text 
> description of the error.
>
> This is not how validate_and_insert() is described in chapter 6 of the 
> book.  Is there a reason it is different?
>
> As a work around I added a try-except block around the 
>  validate_and_insert() call, expecting an HTTP exception, but discovered it 
> is actually a RuntimeError exception.
> Is this the recommended work around or is there a better solution?
>
> I browsed through the code, but it isn't clear to me where the exception 
> is thrown.  However, I believe I noticed two typos in the 
> "validate_and_insert, validate_and_update" section:"ret.error" should be 
> "ret.errors" and "res.updated" should be "ret.updated".
>
> BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
> Apache/2.2.16 (Debian)
>
> Thanks for your help,
> Chris
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: link to item on list.

2013-09-09 Thread Anthony
On Monday, September 9, 2013 11:20:02 AM UTC-4, אבי אברמוביץ wrote:

> Thanks, yes, I know of the item.id problem for next and previous, I just 
> used it for now I'll try to do something with the 
> http://docs.python.org/2/library/functions.html#enumerate later on.Will I 
> also have to ask from the controller to change each item page meta data for 
> google indexing?
>

Sure, you could change some of the page metadata from the controller as 
well.

-- 

--- 
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/groups/opt_out.


[web2py] Re: link to item on list.

2013-09-09 Thread אבי אברמוביץ
Thanks, yes, I know of the item.id problem for next and previous, I just 
used it for now I'll try to do something with the 
http://docs.python.org/2/library/functions.html#enumerate later on.Will I 
also have to ask from the controller to change each item page meta data for 
google indexing?

On Monday, September 9, 2013 3:55:36 PM UTC+3, Anthony wrote:
>
> The query will happen on every page request, though you can cache 
> it.
>  
> There's another problem, though -- in the list view, the arg in the link is 
> the item.id, but in the individual item view, you use that arg to simply 
> subset the returned list of items. Note, the item.id (which is the 
> auto-incrementing primary key in the database) will not necessarily be 
> equivalent to the index of the item in the returned Rows object (e.g., as 
> you delete records, the id values in the database will be non-consecutive 
> integers).
>
> Anthony
>
> On Monday, September 9, 2013 7:11:14 AM UTC-4, אבי אברמוביץ wrote:
>>
>> After some tries I got to this, which works fine:
>> My question is if the controller "saves" the "items" dict, or it queries 
>> for it on every time the view calls it (when moving between pages using the 
>> next/previous links?
>>
>> Thanks.
>>
>> controller
>> def index():
>> items = db(db.t_items).select()
>> return dict(items=items)
>>
>> view:
>>
>> {{if request.args(0):}}
>> {{item=items[int(request.args(0))-1]}}
>> 
>> {{if int(request.args(0)) > 1 :}}
>> << 
>> Previous item
>> {{pass}}
>>
>> {{if int(request.args(0)) < len(items) :}}
>> Next 
>> item >>
>> {{pass}}
>>
>> {{=item.f_item_name}}
>>  
>> {{=item.f_item_description}}
>> {{=item.f_item_price}}
>> 
>> {{else:}}
>> {{for item in items:}}
>> 
>> {{=item.f_item_name}}
>> {{=item.f_item_description}}
>> {{=item.f_item_price}}
>> 
>> 
>> {{pass}}
>> {{pass}}
>>
>> On Sunday, September 1, 2013 8:56:16 PM UTC+3, אבי אברמוביץ wrote:
>>>
>>> Great, thanks.
>>>
>>> On Sunday, September 1, 2013 9:40:25 AM UTC+3, אבי אברמוביץ wrote:

 Hi,
 I understand the url structure: app/function/view
 but assuming I have a list of items on the view, How do I get to a view 
 page for each one of them and where can I build that page template? 
 Thanks.

>>>

-- 

--- 
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/groups/opt_out.


[web2py] Re: Managing Greenlet Queues

2013-09-09 Thread archeaneon
I am using gevent and I was planning on using a list of queues to perhaps 
manage individual communications between users (rather than broadcast 
communications).

On Monday, September 9, 2013 8:58:35 AM UTC-4, Massimo Di Pierro wrote:
>
> Please tell us more about what you are doing. Web2py is based on cpython 
> which does not has greenlets. Are you using gevent? What the greenlets for? 
> What's the web server?
>
> On Sunday, 8 September 2013 21:50:28 UTC-5, arche...@gmail.com wrote:
>>
>> For the purpose of managing greenlet queues, is there a safe way of 
>> globally (across web2py threads) maintaining a list of these?
>>
>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-09 Thread Johann Spies
On 9 September 2013 14:43, Niphlod  wrote:

> if you don't need the grid to search through the table, the moment you
> turn off the search widget you won't get the "performance penalty" of
> creating the dropbox for the IS_IN_DB requirement you have in your models.
>

Of cause yes.  Thanks.  I forgot about the possibility to turn the search
widget off.  I will  just have to turn off the option so sort by column
also.

Regards
Johann

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-09 Thread Anthony
On Monday, September 9, 2013 4:24:48 AM UTC-4, Johann Spies wrote:

> Thanks Anthony.  That explains some of the delays when I am using the 
> grid.  As a result of this experience I will try to avoid using it for 
> queries involving large tables and look at alternatives like Solidtable.
>

I think the main problem is just with the grid's search widget, so you can 
either set searchable=False, create your own search widget, or simply do:

db.isi_alt_countrynames.rsc_id.requires = [db.isi_alt_countrynames.rsc_id.
requires]
 
to prevent the creation of the massive dropdown list. Otherwise, the grid 
should be reasonable efficient.

Fortunately with the possibility (probably (co)created by you) to get a 
> result of db.executesql into the 'Row' type it is fairly straigtforward to 
> SQLTABLE-related stuff in views combined with db.executesql.
>

I think converting db.executesql results to a Rows object and passing that 
to SQLTABLE will be roughly equivalent to just using the grid.

Anthony

-- 

--- 
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/groups/opt_out.


[web2py] Why doesn't validate_and_insert() return on error?

2013-09-09 Thread Christopher Morlier
Hello,

I am implementing a RESTful API and have the following code in my POST 
handler:

ret = db.recording.validate_and_insert(**fixed_fields)
if ret.errors:
raise HTTP(400, 'Validation failed: ' + str(ret.errors))

url = URL('api', args=('recording',ret.id))
response.headers['Location'] = url
response.status = 201
return dict(link=A('Recording ', ret.id, _href=url))

On success, things work as expected.  However, if I omit a required field, 
none of my code after validate_and_insert() is called.  The client receives 
a HTTP 200 response as if all is well, albeit with an appropriate text 
description of the error.

This is not how validate_and_insert() is described in chapter 6 of the 
book.  Is there a reason it is different?

As a work around I added a try-except block around the 
 validate_and_insert() call, expecting an HTTP exception, but discovered it 
is actually a RuntimeError exception.
Is this the recommended work around or is there a better solution?

I browsed through the code, but it isn't clear to me where the exception is 
thrown.  However, I believe I noticed two typos in the 
"validate_and_insert, validate_and_update" section:"ret.error" should be 
"ret.errors" and "res.updated" should be "ret.updated".

BTW, I am running 2.5.1-stable+timestamp.2013.06.06.15.39.19 on 
Apache/2.2.16 (Debian)

Thanks for your help,
Chris

-- 

--- 
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/groups/opt_out.


Re: [web2py] Crowdsourcing platform in Web2Py?

2013-09-09 Thread D.P.
Sorry about the long time to answer. I will would be please to take a look 
and help you testing it.

Regards,
D.

On Thursday, July 4, 2013 4:35:23 PM UTC+2, Relsi Hur Maron wrote:
>
> What features you need?
>
> I'm developing a project of crowdsourcing here, is commercial but I'll 
> release a part of the application opensource, with the following features:
>
> - add/listing of jobs
> - add/listing workers and portfolios
> - signup employee and company
> - submission of Proposals
> - internal messages
>
> is a very alpha release, but if it fit for you, I can send the app to my 
> repository on github and you get it.
>
>
>
> 2013/7/4 D.P. >
>
>> Hello,
>>
>> it is my first post in this group, and it is a pleasure to be in, as I 
>> really think that web2py is a great tool.
>>
>> I am trying to see if there is any opensource crowdsoucing platform made 
>> in web2py? Does any know any of any code example?
>>
>> Regards,
>>
>> D.
>>
>> -- 
>>  
>> --- 
>> 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/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: smartgrid of grid and list of dictionary

2013-09-09 Thread Massimo Di Pierro
While it would be easy to create a torows function it would not help you. 
The grid does not take rows, it takes a query and modifies when you 
interact with it. It paginates it, sorts it, etc. You cannot do these 
things with a rows object.

On Monday, 9 September 2013 04:10:37 UTC-5, keiser1080 wrote:
>
> thanks massimo that work.
> But that could be more simple if there are an opposit methode to 
>
> rows.as_list()
>
> Is there any function in web2py  like this rows = torows(mylistofdict)?
>
> With a function like tihs we can easy past any data to a grid, smartgrid and 
> sqltable.
>
>
> Le lundi 9 septembre 2013 02:56:24 UTC+2, Massimo Di Pierro a écrit :
>>
>> You can make is unique
>>
>> unique_key = response.session_id+'.temptable'
>> db = cache.ram(unique_key,lambda:DAL('sqlite:memory'), None)
>>
>>
>> On Sunday, 8 September 2013 09:40:53 UTC-5, keiser1080 wrote:
>>>
>>> thanks 
>>> this kinfd of table is unique for each session or user?
>>>
>>> Le dimanche 8 septembre 2013 04:03:40 UTC+2, Massimo Di Pierro a écrit :

 You can make a fate table in ram or in cache (DAL('sqlite:memory') or 
 MEMDB),

 On Saturday, 7 September 2013 16:49:12 UTC-5, Anthony wrote:
>
> I think he wants the list of dictionaries to be the data displayed in 
> the table, not to be used to construct a query.
>
> On Saturday, September 7, 2013 2:34:01 PM UTC-4, Massimo Di Pierro 
> wrote:
>>
>> Something like this?
>>
>> def parse(table,d):
>>return reduce(lambda a,b:a&b,[table[k]==v for k,v in 
>> d.iteritems()])
>>
>> SQLFORM.smartgrid(parse(db.yourtable, {'name':'alex', 'age':'55'}))
>>
>>
>>
>>
>>
>> On Saturday, 7 September 2013 11:07:31 UTC-5, keiser1080 wrote:
>>>
>>> hi,
>>>
>>> It is possible tu use smartgrid with a list of dictionary in place 
>>> of a query?
>>> Can i do something like this?
>>>
>>> smartgrid
>>> (table, constraints=None, linked_tables=None, links=None, 
>>> links_in_grid=True, args=None,user_signature=True, divider='>', 
>>> breadcrumbs_class='', **kwargs)
>>>
>>> smartgrid([{'name':'alex', 'age':'55'},  {'name':'albert', 'age':'44
>>> '}])
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 

--- 
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/groups/opt_out.


[web2py] Re: Managing Greenlet Queues

2013-09-09 Thread Massimo Di Pierro
Please tell us more about what you are doing. Web2py is based on cpython 
which does not has greenlets. Are you using gevent? What the greenlets for? 
What's the web server?

On Sunday, 8 September 2013 21:50:28 UTC-5, arche...@gmail.com wrote:
>
> For the purpose of managing greenlet queues, is there a safe way of 
> globally (across web2py threads) maintaining a list of these?
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: link to item on list.

2013-09-09 Thread Anthony
The query will happen on every page request, though you can cache 
it.
 
There's another problem, though -- in the list view, the arg in the link is 
the item.id, but in the individual item view, you use that arg to simply 
subset the returned list of items. Note, the item.id (which is the 
auto-incrementing primary key in the database) will not necessarily be 
equivalent to the index of the item in the returned Rows object (e.g., as 
you delete records, the id values in the database will be non-consecutive 
integers).

Anthony

On Monday, September 9, 2013 7:11:14 AM UTC-4, אבי אברמוביץ wrote:
>
> After some tries I got to this, which works fine:
> My question is if the controller "saves" the "items" dict, or it queries 
> for it on every time the view calls it (when moving between pages using the 
> next/previous links?
>
> Thanks.
>
> controller
> def index():
> items = db(db.t_items).select()
> return dict(items=items)
>
> view:
>
> {{if request.args(0):}}
> {{item=items[int(request.args(0))-1]}}
> 
> {{if int(request.args(0)) > 1 :}}
> << 
> Previous item
> {{pass}}
>
> {{if int(request.args(0)) < len(items) :}}
> Next 
> item >>
> {{pass}}
>
> {{=item.f_item_name}}
>  
> {{=item.f_item_description}}
> {{=item.f_item_price}}
> 
> {{else:}}
> {{for item in items:}}
> 
> {{=item.f_item_name}}
> {{=item.f_item_description}}
> {{=item.f_item_price}}
> 
> 
> {{pass}}
> {{pass}}
>
> On Sunday, September 1, 2013 8:56:16 PM UTC+3, אבי אברמוביץ wrote:
>>
>> Great, thanks.
>>
>> On Sunday, September 1, 2013 9:40:25 AM UTC+3, אבי אברמוביץ wrote:
>>>
>>> Hi,
>>> I understand the url structure: app/function/view
>>> but assuming I have a list of items on the view, How do I get to a view 
>>> page for each one of them and where can I build that page template? 
>>> Thanks.
>>>
>>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-09 Thread Niphlod
if you don't need the grid to search through the table, the moment you turn 
off the search widget you won't get the "performance penalty" of creating 
the dropbox for the IS_IN_DB requirement you have in your models.

On Monday, September 9, 2013 10:24:48 AM UTC+2, Johann Spies wrote:
>
> Thanks Anthony.  That explains some of the delays when I am using the 
> grid.  As a result of this experience I will try to avoid using it for 
> queries involving large tables and look at alternatives like Solidtable.
>
> Fortunately with the possibility (probably (co)created by you) to get a 
> result of db.executesql into the 'Row' type it is fairly straigtforward to 
> SQLTABLE-related stuff in views combined with db.executesql.
>
> Regards
> Johann
>
>
> On 5 September 2013 23:34, Anthony >wrote:
>
>>
>> SELECT  rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id 
>>>
>>>
>>> FROM rresearch 
>>> WHERE (rresearch.id IS NOT NULL) 
>>> ORDER BY rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id;
>>>
>>> 2920.90ms
>>>
>>>
>> The above query is not used for the grid. Rather, it is used to generate 
>> a dropdown list for the db.isi_alt_countrynames.rsc_id field in the grid's 
>> search widget. The db.isi_alt_countrynames.rsc_id is a reference field 
>> that references db.rresearch, so it gets a default IS_IN_DB(db, '
>> rresearch.id', ...) validator. In forms (including the grid search 
>> widget), that validator results in a  widget with an option for 
>> each item in db.rresearch.id (note, you won't see the select widget 
>> unless you first click in the grid's search box and then select the 
>> "rsc_id" field). Not only does the query take a long time to run and parse, 
>> but it also takes a long time to generate the  widget with all the 
>> options and send the HTML to the browser.
>>
>> In general, if you create a reference field that references a table with 
>> a large number of records, you should avoid the default  widget for 
>> that field. You can do this by putting the validator in a list, which will 
>> prevent the  from being created:
>>
>> db.isi_alt_countrynames.rsc_id.requires = [db.isi_alt_countrynames.rsc_id
>> .requires]
>>
>>   
>>
>>>
>>> and then one query for each of the rows in the result of the previous query 
>>> like this 
>>> (taking between 0.44ms and 0.72ms each):
>>>
>>>
>>>
>>> SELECT  rresearch.id, rresearch.cn, rresearch.nf, rresearch.nc, 
>>>
>>>
>>> rresearch.nd, rresearch.nn, rresearch.ny, rresearch.np, rresearch.nu, 
>>> rresearch.nz, rresearch.uuid 
>>>
>>> FROM rresearch WHERE (rresearch.id = 642117) LIMIT 1 OFFSET 0;
>>>
>>> 0.50ms
>>>
>>
>> I think the above queries are due to an unnecessary select in the 
>> "represent" attribute of db.rresearch.id:
>>
>> vars = dict(country = str(db.rresearch[id].nu))
>>
>> Note, above, there is no reason to do db.rresearch[id].nu, which results 
>> in a select. Instead, just do:
>>
>> vars = dict(country = str(row.nu))
>>
>> Anthony
>>
>>   -- 
>>  
>> --- 
>> 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/groups/opt_out.
>>
>
>
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>  

-- 

--- 
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/groups/opt_out.


[web2py] Re: deployment on Windows - errors

2013-09-09 Thread Niphlod
Please use this recipe. The windows service integration has slowly stopped 
working and we're going to remove it from future releases

http://www.web2pyslices.com/slice/show/1614/nssm-webserver-and-scheduler-as-services-in-windows-oses

On Monday, September 9, 2013 11:01:47 AM UTC+2, Dmitry Ermolaev wrote:
>
>
> If I use web2py.exe from download "For Normal Users" - error on start 
> windows service:
>
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>
> C:\web2py>web2py  -W install -L options.py
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
>
> Installing service web2py
> Changing service configuration
> Service updated
> Installing service web2py
> Changing service configuration
> Service updated
>
> C:\web2py>web2py  -W start
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
> Starting service web2py
> *Error starting service: The service did not respond to the start or 
> control requ*
> *est in a timely fashion.*
>
> If I use web2py.py from download "For Developers" - error on install 
> service:
> C:\web2py-m>python web2py.py -W install
> No handlers could be found for logger "web2py"
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.6.0-development+timestamp.2013.09.06.16.28.32
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
> Warning, winservice is unable to install the Mark Hammond Win32 extensions
> Error: Missing python module winservice
>
> C:\web2py-m>cd ../web2py
>
> C:\web2py>web2py  -W remove
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
> Removing service web2py
> Service removed
>
> C:\web2py>cd ../web2py-m
>
> C:\web2py-m>web2py  -W install -L options.py
> 'web2py' is not recognized as an internal or external command,
> operable program or batch file.
>
> C:\web2py-m>python web2py.y  -W install -L options.py
> python: can't open file 'web2py.y': [Errno 2] No such file or directory
>
> C:\web2py-m>python web2py.py -W install -L options.py
> No handlers could be found for logger "web2py"
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.6.0-development+timestamp.2013.09.06.16.28.32
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
> Cannot import config file [options]
>
> C:\web2py-m>python web2py.py -W install -L options.py
> No handlers could be found for logger "web2py"
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.6.0-development+timestamp.2013.09.06.16.28.32
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000),
>  MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), 
> IMAP(imaplib)
> ip: ic-pool   server_name: ic-pool   folder: C:\web2py-m
> Warning, winservice is unable to install the Mark Hammond Win32 extensions
> Error: Missing python module winservice
>
> C:\web2py-m>
>
>

-- 

--- 
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/groups/opt_out.


[web2py] Re: link to item on list.

2013-09-09 Thread אבי אברמוביץ
After some tries I got to this, which works fine:
My question is if the controller "saves" the "items" dict, or it queries 
for it on every time the view calls it (when moving between pages using the 
next/previous links?

Thanks.

controller
def index():
items = db(db.t_items).select()
return dict(items=items)

view:

{{if request.args(0):}}
{{item=items[int(request.args(0))-1]}}

{{if int(request.args(0)) > 1 :}}
<< 
Previous item
{{pass}}

{{if int(request.args(0)) < len(items) :}}
Next 
item >>
{{pass}}

{{=item.f_item_name}}
 
{{=item.f_item_description}}
{{=item.f_item_price}}

{{else:}}
{{for item in items:}}

{{=item.f_item_name}}
{{=item.f_item_description}}
{{=item.f_item_price}}


{{pass}}
{{pass}}

On Sunday, September 1, 2013 8:56:16 PM UTC+3, אבי אברמוביץ wrote:
>
> Great, thanks.
>
> On Sunday, September 1, 2013 9:40:25 AM UTC+3, אבי אברמוביץ wrote:
>>
>> Hi,
>> I understand the url structure: app/function/view
>> but assuming I have a list of items on the view, How do I get to a view 
>> page for each one of them and where can I build that page template? 
>> Thanks.
>>
>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Custom form updating field not in view

2013-09-09 Thread Johann Spies
On 6 September 2013 20:23, SimonD  wrote:

>
> I have a complex table, where I want to expose just some of the fields in
> a custom form, and am using SQLFORM with a custom form.
>

I would not use SQLFORM in this case but SQLFORM.factory.  In that way you
can handle the updates explicitly and not let SQLFORM handle it in the
default way.

Regards
Johann

-- 

--- 
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/groups/opt_out.


[web2py] Re: smartgrid of grid and list of dictionary

2013-09-09 Thread keiser1080
thanks massimo that work.
But that could be more simple if there are an opposit methode to 

rows.as_list()

Is there any function in web2py  like this rows = torows(mylistofdict)?

With a function like tihs we can easy past any data to a grid, smartgrid and 
sqltable.


Le lundi 9 septembre 2013 02:56:24 UTC+2, Massimo Di Pierro a écrit :
>
> You can make is unique
>
> unique_key = response.session_id+'.temptable'
> db = cache.ram(unique_key,lambda:DAL('sqlite:memory'), None)
>
>
> On Sunday, 8 September 2013 09:40:53 UTC-5, keiser1080 wrote:
>>
>> thanks 
>> this kinfd of table is unique for each session or user?
>>
>> Le dimanche 8 septembre 2013 04:03:40 UTC+2, Massimo Di Pierro a écrit :
>>>
>>> You can make a fate table in ram or in cache (DAL('sqlite:memory') or 
>>> MEMDB),
>>>
>>> On Saturday, 7 September 2013 16:49:12 UTC-5, Anthony wrote:

 I think he wants the list of dictionaries to be the data displayed in 
 the table, not to be used to construct a query.

 On Saturday, September 7, 2013 2:34:01 PM UTC-4, Massimo Di Pierro 
 wrote:
>
> Something like this?
>
> def parse(table,d):
>return reduce(lambda a,b:a&b,[table[k]==v for k,v in d.iteritems()])
>
> SQLFORM.smartgrid(parse(db.yourtable, {'name':'alex', 'age':'55'}))
>
>
>
>
>
> On Saturday, 7 September 2013 11:07:31 UTC-5, keiser1080 wrote:
>>
>> hi,
>>
>> It is possible tu use smartgrid with a list of dictionary in place of 
>> a query?
>> Can i do something like this?
>>
>> smartgrid
>> (table, constraints=None, linked_tables=None, links=None, 
>> links_in_grid=True, args=None,user_signature=True, divider='>', 
>> breadcrumbs_class='', **kwargs)
>>
>> smartgrid([{'name':'alex', 'age':'55'},  {'name':'albert', 'age':'44'
>> }])
>>
>>
>>
>>
>>
>>
>>

-- 

--- 
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/groups/opt_out.


[web2py] Re: wsgihandler.py not exist!

2013-09-09 Thread Dmitry Ermolaev


суббота, 7 сентября 2013 г., 12:23:43 UTC пользователь Niphlod написал:
>
> if you dowloaded the trunk version, all handlers are in the /handlers 
> directory: just copy the one you need to the root and you're good to go.
>
> On Saturday, September 7, 2013 7:33:38 AM UTC+2, Dmitry Ermolaev wrote:
>>
>> I install on MS Server2000 Apache 2.2 + python2.7 + web2py
>>
>> but wsgihandler.py not exit in c:/web2py folder and anywhere
>>
>
If I download  "For Normal Users" - here  /handlers directory not exist
if I download "For Developers" and copy from /handlers directory - error: 
Unable install win32 extentions (

-- 

--- 
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/groups/opt_out.


[web2py] deployment on Windows - errors

2013-09-09 Thread Dmitry Ermolaev

If I use web2py.exe from download "For Normal Users" - error on start 
windows service:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\web2py>web2py  -W install -L options.py
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)

Installing service web2py
Changing service configuration
Service updated
Installing service web2py
Changing service configuration
Service updated

C:\web2py>web2py  -W start
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
Starting service web2py
*Error starting service: The service did not respond to the start or 
control requ*
*est in a timely fashion.*

If I use web2py.py from download "For Developers" - error on install 
service:
C:\web2py-m>python web2py.py -W install
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.6.0-development+timestamp.2013.09.06.16.28.32
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
Warning, winservice is unable to install the Mark Hammond Win32 extensions
Error: Missing python module winservice

C:\web2py-m>cd ../web2py

C:\web2py>web2py  -W remove
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
Removing service web2py
Service removed

C:\web2py>cd ../web2py-m

C:\web2py-m>web2py  -W install -L options.py
'web2py' is not recognized as an internal or external command,
operable program or batch file.

C:\web2py-m>python web2py.y  -W install -L options.py
python: can't open file 'web2py.y': [Errno 2] No such file or directory

C:\web2py-m>python web2py.py -W install -L options.py
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.6.0-development+timestamp.2013.09.06.16.28.32
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
Cannot import config file [options]

C:\web2py-m>python web2py.py -W install -L options.py
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.6.0-development+timestamp.2013.09.06.16.28.32
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000),
 MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
ip: ic-pool   server_name: ic-pool   folder: C:\web2py-m
Warning, winservice is unable to install the Mark Hammond Win32 extensions
Error: Missing python module winservice

C:\web2py-m>

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Newby, can't connect to a Postgresl database

2013-09-09 Thread Johann Spies
Postgresql would not allow root as a database user.  It is also not safe to
work with 'postgres' as your normal user for normal day-to-day usage as
postgres is the superuser for Postgresql.  So you have to create a user in
postgresql, create the correct database with the user you created as owner,
modify your pg_hba.conf if necessary, apply the correct configuration for
that user in web2py.

Regards
Johann


On 8 September 2013 23:07, starglider.dev  wrote:

> Actually it as a root user because all application connect to the server
> by root, the other software is made with
> python & pscopg2.
>
> I try to connect by psql from the server that as web2py and it worked,
> also create a model with this script:
> https://github.com/phektus/cvstash/blob/master/scripts/extract_pgsql_models.py
>
> and it try to connect endlessly.
>
> Thank for your replay.
>
>
>
>
> On 8 September 2013 21:56, Dragan Matic  wrote:
>
>> Postgres probably doesn't have 'root' as user. Its root user is
>> 'postgres'.
>>
>> After that check if your address is allowed to connect to postgres server
>> in pg_hba.conf  and if server is listening on your network
>> ('listen_addresses' setting in postgresql.conf). It could also be a
>> firewall issue, check is port 5432 is open.
>>
>> On Sunday, September 8, 2013 5:47:38 PM UTC+2, Sartglider wrote:
>>>
>>> Hi,
>>> I'm really new to web2py - less than 24 hours -
>>> Trying to follow this example http://web2py.com/books/**
>>> default/chapter/29/03/**overview#Say-hello
>>> it worked fine with sqlite, so I try to connect to a postgresql database
>>> in another server:
>>> the model is this one:
>>> db = DAL("postgres://root:<**password>@192.168.0.98/teste")
>>>
>>> db.define_table('equipments',
>>>Field('eq_id', unique=True),
>>>Field('eq_model'),
>>>Field('eq_aka'),
>>>format = '%(title)s')
>>>
>>> db.equipments.eq_id.requires = IS_NOT_IN_DB(db, db.equipments.eq_model)
>>> db.equipments.eq_model.**requires = IS_IN_DB(db, db.equipments.eq_id,
>>> '%(title)s')
>>>
>>> db.equipments.eq_id.writable = False
>>>
>>> but I get no errors just the browser trying to connect.
>>>
>>> Thank you in advance for your help.
>>>
>>>
>>> Postgresq server: debian 6 & postgresql 8.4
>>> web2Py server: debian 7, python 2.7
>>>
>>>  --
>>
>> ---
>> 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/groups/opt_out.
>>
>
>  --
>
> ---
> 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/groups/opt_out.
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 

--- 
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/groups/opt_out.


Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-09 Thread Johann Spies
Thanks Anthony.  That explains some of the delays when I am using the
grid.  As a result of this experience I will try to avoid using it for
queries involving large tables and look at alternatives like Solidtable.

Fortunately with the possibility (probably (co)created by you) to get a
result of db.executesql into the 'Row' type it is fairly straigtforward to
SQLTABLE-related stuff in views combined with db.executesql.

Regards
Johann


On 5 September 2013 23:34, Anthony  wrote:

>
> SELECT  rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id
>>
>> FROM rresearch
>> WHERE (rresearch.id IS NOT NULL)
>> ORDER BY rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id;
>>
>> 2920.90ms
>>
>>
> The above query is not used for the grid. Rather, it is used to generate a
> dropdown list for the db.isi_alt_countrynames.rsc_id field in the grid's
> search widget. The db.isi_alt_countrynames.rsc_id is a reference field
> that references db.rresearch, so it gets a default IS_IN_DB(db, '
> rresearch.id', ...) validator. In forms (including the grid search
> widget), that validator results in a  widget with an option for
> each item in db.rresearch.id (note, you won't see the select widget
> unless you first click in the grid's search box and then select the
> "rsc_id" field). Not only does the query take a long time to run and parse,
> but it also takes a long time to generate the  widget with all the
> options and send the HTML to the browser.
>
> In general, if you create a reference field that references a table with a
> large number of records, you should avoid the default  widget for
> that field. You can do this by putting the validator in a list, which will
> prevent the  from being created:
>
> db.isi_alt_countrynames.rsc_id.requires = [db.isi_alt_countrynames.rsc_id.
> requires]
>
>
>
>>
>> and then one query for each of the rows in the result of the previous query 
>> like this
>> (taking between 0.44ms and 0.72ms each):
>>
>>
>>
>> SELECT  rresearch.id, rresearch.cn, rresearch.nf, rresearch.nc,
>>
>> rresearch.nd, rresearch.nn, rresearch.ny, rresearch.np, rresearch.nu, 
>> rresearch.nz, rresearch.uuid
>> FROM rresearch WHERE (rresearch.id = 642117) LIMIT 1 OFFSET 0;
>>
>> 0.50ms
>>
>
> I think the above queries are due to an unnecessary select in the
> "represent" attribute of db.rresearch.id:
>
> vars = dict(country = str(db.rresearch[id].nu))
>
> Note, above, there is no reason to do db.rresearch[id].nu, which results
> in a select. Instead, just do:
>
> vars = dict(country = str(row.nu))
>
> Anthony
>
>  --
>
> ---
> 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/groups/opt_out.
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 

--- 
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/groups/opt_out.