[web2py] Re: Django vs web2py pain points

2011-02-07 Thread cjrh
On Feb 6, 5:36 pm, Luther Goh Lu Feng  wrote:
> I am about to have a constructive discussion about web2py vs django
> with a team member of mine before we decide whether to implement a
> project. He is an expert with django while I consider myself an
> intermediate web2py user.

A skilled debater could successfully argue that the earth is flat.

I would much more strongly recommend that you two build a smaller-type
app in both Django and web2py, and get a taste for what the actual
experience is like.  Doing it far exceeds talking about it, in pretty
much every metric save time.


[web2py] Re: Can anyone recommend a good python forum in google groups or elsewhere?

2011-02-07 Thread cjrh
On Feb 7, 6:31 am, Rupesh Pradhan  wrote:
> Can anyone recommend a good python forum in google groups or elsewhere?

http://groups.google.com/group/comp.lang.python/topics


[web2py] web2py on IIS7.5, Windows Server 2008.

2011-02-07 Thread Panupat
A couple question.

Running web2py on Windows Server 2008 R2, IIS7.5. Following the
official online book I got the site working with 127.0.0.1:8000. But I
want to add the website to IIS service so I can access it with
subdomain.mydomain.com (got other sites running this way already)

1. IIS requires me to point to the root directory of the website. For
web2py, which directory should I point it to?

2. Will I need to create a URL rewrite rule? Are there any tutorial
explaining how to do this?

3. The online book mentioned "options.py" but I don't seem to have
that file anywhere in my web2py directory
http://web2py.com/book/default/chapter/11#Start-as-Windows-Service


[web2py] Re: Problem with DAL and Postgres

2011-02-07 Thread Bernardo
Sure Massimo, here it goes:

db.define_table(auth.settings.table_user_name,
Field('first_name', length=128, default=''),
Field('last_name', length=128, default=''),
Field('username', length=128, default=''),
Field('email', length=128, default='', unique=True),
Field('password', 'password', '''length=512, ''', readable=False,
label='Password'),
Field('registration_key', length=512, writable=False,
readable=False, default=''),
Field('reset_password_key', length=512, writable=False,
readable=False, default=''),
Field('registration_id', length=512, writable=False,
readable=False, default=''),
Field('imagen', 'upload', requires=IS_IMAGE()),
Field('texto_descriptivo', 'text'),
Field('activado', 'boolean', default=True, readable=False,
writable=False),
Field('karma', 'double', default=0, readable=False,
writable=False),
Field('acepta_registro', 'boolean', requires=IS_IN_SET(['on'],
error_message=T('You must accept the license terms.')), label=XML(T('I
\'ve read and I accept the ') + A(T('license terms'),
_href=URL('default', 'texto_registro'), _target='new')))
)

On 7 feb, 05:09, Massimo Di Pierro  wrote:
> Can you show your custom auth_user. I am still puzzled by the error.
>
> On Feb 6, 4:21 pm, Bernardo Botella Corbí  wrote:
>
>
>
>
>
>
>
> > Yes, the error is on my custom auth_user table. So, Do I reduce the leght
> > numbers?
>
> > Bernardo
>
> > 2011/2/6 Massimo Di Pierro 
>
> > > Do you have a custom auth_user table? Is seems to miss a length
> > > attribute and default to a number too large. I changed the default to
> > > 32768 in trunk but I am not sure.
>
> > > On Feb 6, 3:13 pm, Bernardo  wrote:
> > > > Dear all,
>
> > > > I am using web2py 1.91.6 and last version of Ubuntu. A model which
> > > > works perfectly using sqlite database, throws an error when using a
> > > > postgres database:
>
> > > > ProgrammingError: syntax error at or near "100"
> > > > LINE 1: ALTER TABLE auth_user ADD password VARCHAR(100);
>
> > > > posible bug in new DAL?
>
> > > > Thanks a lot for your help,
> > > > Bernardo


[web2py] Re: Django vs web2py pain points

2011-02-07 Thread Dane
In my opinion, the only advantages Django has are its admin interface
and the perks of a bigger and more established community, including
more stable documentation, better results when you google, a big
community on stack overflow, more name recognition (people won't
hesitate to let you do their project in Django because they've heard
of it, you have to convince them with web2py).

Some of these things have a fairly big impact, but overall web2py is
much simpler, more powerful, and gives you less headaches. If you're
willing to be more adventurous in terms of sifting through discussion
threads and google results and digging through the source instead of
usually finding a blog post that explains what you need to do, you
definitely get a major reward for working with web2py. Once you find
out how to do something, it's almost always simple and elegant. It can
just be hard to find out about it.

As far as being ready for production, it's doing fine on my vps after
following a few simple tutorials. I don't know how it scales yet, but
I think Massimo knows his stuff as well as the Django crew. And
doesn't choosing Python in the first place indicate priorities other
than raw speed? Developer productivity is a much more important factor
for the vast majority of sites, even ones with potential to be fairly
popular.

On Feb 6, 10:36 am, Luther Goh Lu Feng  wrote:
> Hi all,
>
> I am about to have a constructive discussion about web2py vs django
> with a team member of mine before we decide whether to implement a
> project. He is an expert with django while I consider myself an
> intermediate web2py user.
>
> This is not a flamebait, but I would like to mainly hear pain points
> about web2py and django, so that we can make a good decision. I am
> only familiar with web2py, and only brushed the surface of django.
>
> Thanks in advance.


[web2py] facebook insights

2011-02-07 Thread b0j3
Hi!

I'd like to use Facebook's insights in web2py, but after adding the
meta tag for the domain to the layout.html,
the only thing I get is "No admin data found.".

Did anybody successfully added Insights to web2py?

Boštjan


Re: [web2py] Re: postgresql error ... (relation "auth_user" already exists)

2011-02-07 Thread Tom Atkins
On 6 February 2011 15:51, Massimo Di Pierro wrote:

> The least comment in the issue thread says it is fixed after deleting
> the pyc. Is that not correct?
>
>
Yes - fixed after dal.pyc was recreated with new version.


[web2py] Re: web2py on IIS7.5, Windows Server 2008.

2011-02-07 Thread Anthony
On Monday, February 7, 2011 3:48:22 AM UTC-5, Panupat wrote: 
>
> 3. The online book mentioned "options.py" but I don't seem to have 
> that file anywhere in my web2py directory 
> http://web2py.com/book/default/chapter/11#Start-as-Windows-Service

 
You should find a file called 'options_std.py' in the web2py root directory 
(i.e., /web2py/options_std.py), not in your application directory. Copy it 
to 'options.py' and edit as needed.
 
Anthony


[web2py] password reset does not work

2011-02-07 Thread selecta
Traceback (most recent call last):
  File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 188, in
restricted
exec ccode in environment
  File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
default.py", line 101, in 
  File "/home/fkrause/Dev/web2py/gluon/globals.py", line 95, in

self._caller = lambda f: f()
  File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
default.py", line 61, in user
return dict(form=auth())
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 1037, in
__call__
elif args[0] == 'retrieve_username':
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2033, in
retrieve_password
onvalidation=DEFAULT,
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2009, in
request_reset_password
if self.settings.mailer.send(to=form.vars.email,
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1250, in 
else:
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4438, in
update_record
def __invert__(self):
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4399, in update
except:
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 854, in update
self.execute(sql)
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1061, in execute
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1058, in
log_execute
OperationalError: near "WHERE": syntax error

...

(self=, *a=('UPDATE auth_user SET
WHERE (auth_user.id = 1);',), **b={})

did I do something wrong?


[web2py] plugin_datatable

2011-02-07 Thread Neveen Adel
Hello,

 Am using to plugin_datatable and i want  to go to the update form
from  displayed table.
E.x:
The table display a list of records ,Is there a way on clicking on a
record the update form is displayed?

Is there a way to do that ? if not , is there any idea can lead me to
the target?

Another thing is there a way to display a set of columns not all
columns in the table?


Thanks in Advance


Re: [web2py] plugin_datatable

2011-02-07 Thread Bruno Rocha
It is all about JavasCRIPT.

To get selected row and perform an action i.e (javascript
window.location('') )
http://datatables.net/examples/api/select_single_row.html


To show/hide
columns
http://datatables.net/examples/api/show_hide.html

Mind that you can hide columns on the DAL select query.


in powerTable I put a variable 'selected' which triggers the selected row,
also in powerTable you can set the columns to display 'table.hiddencolumns =
['column1','column2']

https://bitbucket.org/rochacbruno/powertable/overview

http://powertable.blouweb.com/products

--
Bruno Rocha
http://about.me/rochacbruno/bio


2011/2/7 Neveen Adel 

> Hello,
>
>  Am using to plugin_datatable and i want  to go to the update form
> from  displayed table.
> E.x:
> The table display a list of records ,Is there a way on clicking on a
> record the update form is displayed?
>
> Is there a way to do that ? if not , is there any idea can lead me to
> the target?
>
> Another thing is there a way to display a set of columns not all
> columns in the table?
>
>
> Thanks in Advance


[web2py] Model with 2 fields were one field is required

2011-02-07 Thread grezly
i have a table with 3 fields:

title
start
end

For some reason i want to have the following; the title has to be
filled in always, but for the start and end field belongs a rule to
the fields; only 1 of the two fields can be filledin, They also can't
be either empty or filled in.

It's up to the user which one of the 2 fields he wants to fill in,
none of them is more important than the other.


[web2py] Updating computed fields

2011-02-07 Thread Johann Spies
If I have a table and add a computed field - how do I update existing
records?  I am speaking of tables with many thousands of records.

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: SQLFORM and read-only references

2011-02-07 Thread Juan Antonio
I have

db.define_table('article', Field('name'),,format='%(name)s')
db.define_table('lote', Field('name'),, Field('article',
db.article)
db.lote.article.requires = IS_IN_DB(db, db.article.id, '%(name)s')

And SQLFORM(db.lote,..,readonly=True) shows 'None' in field articulo

I think it is the same proble discussed here, or what am I doing
wrong?

I am using 1.91.6

Cheers,

Juan.

On 4 feb, 13:46, Kenneth  wrote:
> I´m having the same problem. In a SQLFORM I have a Field that is
> sometimes writable and sometimes not. If you are admin you can modify
> this field but not as user. Field is a reference to and other table,
> so admin gets a dropdown but the user gets None but he should get the
> selection that admin has made.
>
> Kenneth
>
> On Jan 26, 11:48 pm, Pawel Jasinski  wrote:
>
> > Hi,
>
> > > Are you sure you want the form readonly?
>
> > Yes
>
> > > What if you remove readonly?
>
> > The 'None' changes into drop down with ids or whatever is in the
> > format argument of the field.
>
> > > If you want readonly you do not need accepts
>
> > Good point, changed. It does not help with the main problem.
>
> > I also have another use case, where form is used on the confirmation
> > screen. Kind of "are you really sure ..."
> > All fields are made read only with db.table.filed.writable=False.
> > The references are also rendered as None.
>
> > Cheers,
> > Pawel


[web2py] Need help setting up a composite key

2011-02-07 Thread Mark Hayes
I'm new to web2py and can't seem to find out how to create a composite
key.  Specifically I'm trying to create the following tables:

db.define_table('volunteer',
Field('first_name', 'string', length=30, notnull=True),
Field('last_name', 'string', length=30, notnull=True),
Field('birthday', 'date', required=True),
Field('email', 'string', length=30))
db.define_table('opportunity',
Field('name', 'string', length=30, notnull=True))
db.define_table('interest',
Field('volunteer', db.volunteer),
Field('opportunity', db.opportunity))

In the 'interest' table I want to ensure that the combination of both
volunteer + opportunity is unique.  What is the best way to go about
doing this?  Any help would be greatly appreciated, thanks!


[web2py] Routing service with query args

2011-02-07 Thread Gabriel
Hi, I have this json service:

app/default.py
...
@service.json
def create(model, fields):
  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))

and I am trying to map this:

routes_in = (
  ('/service/$model/create', '/app/default/call/json/create?model=
$model'),
)

With this I'd want to do:

curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
app/person/create"

and in the create function get model="person" and in fields='{"name":
"test"}'
But it does not work, it is redirecting to default page.
In httpserver.log I get

127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055

If I do:
 curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
8000/app/default/call/json/create?model=person"
it works, so I think the problem is the routing.

Any help about what I'm doing wrong?
Thanks for advance.


[web2py] Re: Need help setting up a composite key

2011-02-07 Thread dederocks
Hi!
Check this thread:
http://groups.google.com/group/web2py/browse_thread/thread/caaf68de3fbc0baf/b9812b04ac70ba8b?lnk=gst&q=Multiple+constraint#b9812b04ac70ba8b

In summary, you want to create a computed combined field, and require
that it is unique. A bit odd, but that's what you need to be able to
have validators working at the DAL level. Otherwise, you can of course
add SQL-level combined indexes (but specific to the database
selected), which if not respected will generate an error instead of a
friendly validator message.
BR, Andre

On 7 fév, 08:43, Mark Hayes  wrote:
> I'm new to web2py and can't seem to find out how to create a composite
> key.  Specifically I'm trying to create the following tables:
>
> db.define_table('volunteer',
>     Field('first_name', 'string', length=30, notnull=True),
>     Field('last_name', 'string', length=30, notnull=True),
>     Field('birthday', 'date', required=True),
>     Field('email', 'string', length=30))
> db.define_table('opportunity',
>     Field('name', 'string', length=30, notnull=True))
> db.define_table('interest',
>     Field('volunteer', db.volunteer),
>     Field('opportunity', db.opportunity))
>
> In the 'interest' table I want to ensure that the combination of both
> volunteer + opportunity is unique.  What is the best way to go about
> doing this?  Any help would be greatly appreciated, thanks!


Re: [web2py] Updating computed fields

2011-02-07 Thread Bruno Rocha
I did it before, something like:

###

rows = db(db.table).select()

for row in rows:
row.update_record(mycomputedfield=lambda r:function(r))

###

where function(r) is the same function I used for the computed field.

Better to run this kind of thing using web2py Shell.

--
Bruno Rocha
http://about.me/rochacbruno/bio


2011/2/7 Johann Spies 

> If I have a table and add a computed field - how do I update existing
> records?  I am speaking of tables with many thousands of records.
>
> Regards
> Johann
>
> --
>  May grace and peace be yours in abundance through the full knowledge of
> God and of Jesus our Lord!  His divine power has given us everything we need
> for life and godliness through the full knowledge of the one who called us
> by his own glory and excellence.
> 2 Pet. 1:2b,3a
>
>


Re: [web2py] Updating computed fields

2011-02-07 Thread Johann Spies
Thanks!

Regards
Johann


-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] weird slash problem

2011-02-07 Thread rāma
Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 188, in restricted
exec ccode in environment
  File "C:\web2py\applications\beta/views\default/user.html", line
136, in 
TypeError: 'str' object does not support item assignment

Posting this because it started affecting my appplication functions as
well. More info: Some of my view's "edit controller" link has this
weird slashing problem thus the error in "invalid request" appears.

Platform: Windows.


Re: [web2py] Updating computed fields

2011-02-07 Thread Bruno Rocha
I just found a better way, you can point to the defined function for
compute.


rows = db(db.table).select()

for row in rows:
row.update_record( mycomputedfield =
db.mytable.mycomputefield.compute(row) )

###

I made a test now

#

db.define_table('products',
Field('quantity',integer'),
Field('price','double'),
Field('total','double',compute =
r:r.quantity*r.price),
   )

rows = db(db.products).select()

for *row* in rows:
row.update_record(*total=db.products.total.compute(row)*)

###

Running web2py from shell you prevent webserver timeout if you are running
multiple records

$python web2py.py -S yourappname -M -P



Bruno Rocha
http://about.me/rochacbruno/bio


2011/2/7 Johann Spies 

> Thanks!
>
>
> Regards
> Johann
>
>
> --
>  May grace and peace be yours in abundance through the full knowledge of
> God and of Jesus our Lord!  His divine power has given us everything we need
> for life and godliness through the full knowledge of the one who called us
> by his own glory and excellence.
> 2 Pet. 1:2b,3a
>
>


[web2py] Re: plugin_wiki suggestions

2011-02-07 Thread Massimo Di Pierro
If you are in mode 3 (code allowed) you can do ``{{=response.title}}
``:template

On Feb 7, 12:29 am, Plumo  wrote:
> I also made this change to set the page title.
>
> How can I access the page title from within a wiki page?
> response.title is empty


[web2py] Re: Deleting a cookie

2011-02-07 Thread Massimo Di Pierro
http://msdn.microsoft.com/en-us/library/ms178195.aspx

"You cannot directly delete a cookie on a user's computer. However,
you can direct the user's browser to delete the cookie by setting the
cookie's expiration date to a past date. The next time a user makes a
request to a page within the domain or path that set the cookie, the
browser will determine that the cookie has expired and remove it."

On Feb 7, 1:28 am, Dane  wrote:
> Hello,
>
> I've got my own user system (not using Auth), and I'm trying to
> implement a Remember Me option with cookies. It's working fine when
> the user selects 'Yes' for remember me. Setting and detecting the
> cookie is no problem, but I can't find a way to delete the cookie when
> the user logs out or selects 'No'. Here's my code which attempts
> everything I can think of.
>
> if request.cookies.has_key('user'):
>         request.cookies['user'].clear()
>         del request.cookies['user']
>         print 'remove request user cookie'
> if response.cookies.has_key('user'):
>         response.cookies['user'].clear()
>         del response.cookies['user']
>         print 'remove response user cookie'
>
> After running this, request.cookies.has_key('user') is still returning
> true and the cookie's data is still present.
>
> Ideas? Thanks.


[web2py] [Mysql] global name 'driver' is not defined

2011-02-07 Thread Martín Mulone
I'm trying to connect to mysql, with trunk.

global name 'driver' is not defined

Martin.


-- 
Pablo Martín Mulone (mar...@tecnodoc.com.ar)
http://www.tecnodoc.com.ar/
Paraná, Entre Ríos, Argentina (CP 3100).

My blog: http://martin.tecnodoc.com.ar
Expert4Solution Profile:
http://www.experts4solutions.com/e4s/default/expert/6


[web2py] Re: Problem with DAL and Postgres

2011-02-07 Thread Massimo Di Pierro
I am very puzzled.

In gluon/dal.py there is this line:

field.length = min(field.length,self._db and
self._db._adapter.maxcharlength or INFINITY)

can you print field.length before and field.length after this
statement?

Massimo

On Feb 7, 3:06 am, Bernardo  wrote:
> Sure Massimo, here it goes:
>
> db.define_table(auth.settings.table_user_name,
>     Field('first_name', length=128, default=''),
>     Field('last_name', length=128, default=''),
>     Field('username', length=128, default=''),
>     Field('email', length=128, default='', unique=True),
>     Field('password', 'password', '''length=512, ''', readable=False,
> label='Password'),
>     Field('registration_key', length=512, writable=False,
> readable=False, default=''),
>     Field('reset_password_key', length=512, writable=False,
> readable=False, default=''),
>     Field('registration_id', length=512, writable=False,
> readable=False, default=''),
>     Field('imagen', 'upload', requires=IS_IMAGE()),
>     Field('texto_descriptivo', 'text'),
>     Field('activado', 'boolean', default=True, readable=False,
> writable=False),
>     Field('karma', 'double', default=0, readable=False,
> writable=False),
>     Field('acepta_registro', 'boolean', requires=IS_IN_SET(['on'],
> error_message=T('You must accept the license terms.')), label=XML(T('I
> \'ve read and I accept the ') + A(T('license terms'),
> _href=URL('default', 'texto_registro'), _target='new')))
> )
>
> On 7 feb, 05:09, Massimo Di Pierro  wrote:
>
>
>
>
>
>
>
> > Can you show your custom auth_user. I am still puzzled by the error.
>
> > On Feb 6, 4:21 pm, Bernardo Botella Corbí  wrote:
>
> > > Yes, the error is on my custom auth_user table. So, Do I reduce the leght
> > > numbers?
>
> > > Bernardo
>
> > > 2011/2/6 Massimo Di Pierro 
>
> > > > Do you have a custom auth_user table? Is seems to miss a length
> > > > attribute and default to a number too large. I changed the default to
> > > > 32768 in trunk but I am not sure.
>
> > > > On Feb 6, 3:13 pm, Bernardo  wrote:
> > > > > Dear all,
>
> > > > > I am using web2py 1.91.6 and last version of Ubuntu. A model which
> > > > > works perfectly using sqlite database, throws an error when using a
> > > > > postgres database:
>
> > > > > ProgrammingError: syntax error at or near "100"
> > > > > LINE 1: ALTER TABLE auth_user ADD password VARCHAR(100);
>
> > > > > posible bug in new DAL?
>
> > > > > Thanks a lot for your help,
> > > > > Bernardo


[web2py] Re: password reset does not work

2011-02-07 Thread Massimo Di Pierro
Looks like you have a custom auth_user table that misses the field
reset_password_key

Massimo

On Feb 7, 5:29 am, selecta  wrote:
> Traceback (most recent call last):
>   File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
> default.py", line 101, in 
>   File "/home/fkrause/Dev/web2py/gluon/globals.py", line 95, in
> 
>     self._caller = lambda f: f()
>   File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
> default.py", line 61, in user
>     return dict(form=auth())
>   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 1037, in
> __call__
>     elif args[0] == 'retrieve_username':
>   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2033, in
> retrieve_password
>     onvalidation=DEFAULT,
>   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2009, in
> request_reset_password
>     if self.settings.mailer.send(to=form.vars.email,
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1250, in 
>     else:
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4438, in
> update_record
>     def __invert__(self):
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4399, in update
>     except:
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 854, in update
>     self.execute(sql)
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1061, in execute
>   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1058, in
> log_execute
> OperationalError: near "WHERE": syntax error
>
> ...
>
> (self=, *a=('UPDATE auth_user SET
> WHERE (auth_user.id = 1);',), **b={})
>
> did I do something wrong?


[web2py] Re: Model with 2 fields were one field is required

2011-02-07 Thread Massimo Di Pierro
first of all start and end and sql keywords you should choose another
name.

I suggest

db.define_table('event',Field('title'),Field('start_time'),Field('end_time'))

def exclusive(form):
if form.vars.start_time and form.vars.end_time:
form.errors.end_time = 'you already filled start time')
elif not form.vars.start_time and not form.vars.end_time:
form.errors.estart_time = 'you must fill start time or end
time')

then use
form = crud.create(db.event,onvalidation=exclusive)
and/or
form = crud.update(db.event,id,onvalidation=exclusive)

On Feb 7, 6:57 am, grezly  wrote:
> i have a table with 3 fields:
>
> title
> start
> end
>
> For some reason i want to have the following; the title has to be
> filled in always, but for the start and end field belongs a rule to
> the fields; only 1 of the two fields can be filledin, They also can't
> be either empty or filled in.
>
> It's up to the user which one of the 2 fields he wants to fill in,
> none of them is more important than the other.


[web2py] Re: SQLFORM and read-only references

2011-02-07 Thread Massimo Di Pierro
Should be fixed in trunk already. Try the nightly built.

On Feb 7, 4:46 am, Juan Antonio  wrote:
> I have
>
> db.define_table('article', Field('name'),,format='%(name)s')
> db.define_table('lote', Field('name'),, Field('article',
> db.article)
> db.lote.article.requires = IS_IN_DB(db, db.article.id, '%(name)s')
>
> And SQLFORM(db.lote,..,readonly=True) shows 'None' in field articulo
>
> I think it is the same proble discussed here, or what am I doing
> wrong?
>
> I am using 1.91.6
>
> Cheers,
>
> Juan.
>
> On 4 feb, 13:46, Kenneth  wrote:
>
>
>
>
>
>
>
> > I´m having the same problem. In a SQLFORM I have a Field that is
> > sometimes writable and sometimes not. If you are admin you can modify
> > this field but not as user. Field is a reference to and other table,
> > so admin gets a dropdown but the user gets None but he should get the
> > selection that admin has made.
>
> > Kenneth
>
> > On Jan 26, 11:48 pm, Pawel Jasinski  wrote:
>
> > > Hi,
>
> > > > Are you sure you want the form readonly?
>
> > > Yes
>
> > > > What if you remove readonly?
>
> > > The 'None' changes into drop down with ids or whatever is in the
> > > format argument of the field.
>
> > > > If you want readonly you do not need accepts
>
> > > Good point, changed. It does not help with the main problem.
>
> > > I also have another use case, where form is used on the confirmation
> > > screen. Kind of "are you really sure ..."
> > > All fields are made read only with db.table.filed.writable=False.
> > > The references are also rendered as None.
>
> > > Cheers,
> > > Pawel


[web2py] Re: SQLFORM.factory bug for field type = password

2011-02-07 Thread ionel
Done.

On 6 fév, 23:10, Massimo Di Pierro  wrote:
> can you please open an issue in googlecode?
>
> On Feb 6, 7:06 pm, ionel  wrote:
>
> > Hello,
>
> > In the controller I have a custom form that contains a password:
>
> > form = SQLFORM.factory(Field('afield', 'password'))
> > form.vars.afield = 'some initial password'
>
> > In view:
>
> > {{=form.custom.begin}}
> > {{=form.custom.widget.afield}}
> > {{=form.custom.submit}}
> > {{=form.custom.end}}
>
> > The problem is that the text field in the view doesn't display
> > '' (in fact the 'some initial password' string) when
> > the page is loaded. If I change the field type from 'password' to
> > 'string', 'some initial password' is displayed inside the text field:
>
> > form = SQLFORM.factory(Field('afield', 'string'))
>
> > I think this is a bug.
>
> > Thanks.
>
> > i.a.
>
>


[web2py] Security question: cookie manipulation & stealing cookies

2011-02-07 Thread devGS
I saw many explanations about web2py's built-in security, but does it
have some implemented security against cookie manipulation and
stealing cookies attacks? -For cases when the attacker is the user,
and when the attacker is not the user.  If not, can someone provide
some recommendations for a beginner on how to defend myself from those
vulnerabilities? Thanks.


[web2py] seems like a little mistake in book

2011-02-07 Thread LightOfMooN
auth.settings.long_expiration = 3600*30 # one month
maybe 3600*30*24?


[web2py] boolean in crud.read = Nice, what about crud.select

2011-02-07 Thread Richard Vézina
Hello,

I am happy to see that writeable false icons have been added for boolean
field in crud.read...

I am wondering to know if I should expected the same for crud.select??

Now I am having the unwriteable icons in crud.read, but not in crud.select

Thank you.

Richard


[web2py] Re: Security question: cookie manipulation & stealing cookies

2011-02-07 Thread devGS
And one more question, how to change session ID after user login?

On Feb 7, 5:13 pm, devGS  wrote:
> I saw many explanations about web2py's built-in security, but does it
> have some implemented security against cookie manipulation and
> stealing cookies attacks? -For cases when the attacker is the user,
> and when the attacker is not the user.  If not, can someone provide
> some recommendations for a beginner on how to defend myself from those
> vulnerabilities? Thanks.


Re: [web2py] drop support for python 2.4?

2011-02-07 Thread Vinicius Assef
Neither did I.


On Sat, Feb 5, 2011 at 10:30 AM, Vasile Ermicioi  wrote:
> never used python2.4


Re: [web2py] drop support for python 2.4?

2011-02-07 Thread Richard Vézina
Gohead!

Richard

On Mon, Feb 7, 2011 at 10:30 AM, Vinicius Assef wrote:

> Neither did I.
>
>
> On Sat, Feb 5, 2011 at 10:30 AM, Vasile Ermicioi 
> wrote:
> > never used python2.4
>


[web2py] Re: drop support for python 2.4?

2011-02-07 Thread Oleg
+1 for dropping support for python 2.4..

[web2py] Cloud hosting company

2011-02-07 Thread stargate
Does anybody know of a hosting company that will run web2py in a cloud
hosting environment?


Re: [web2py] [Mysql] global name 'driver' is not defined

2011-02-07 Thread Jonathan Lundell
On Feb 7, 2011, at 6:32 AM, Martín Mulone wrote:
> I'm trying to connect to mysql, with trunk.
> 
> global name 'driver' is not defined
> 

On dal.py line 1462, try changing driver to self.driver.

Re: [web2py] Cloud hosting company

2011-02-07 Thread Bruno Rocha
I am running in dotcloud (but it is in beta)

http://www.web2py.dotcloud.com/

 also Pydra is announcing they will run
web2py very soon.

For now, I know only Google App Engine and Amazon ECM running well on a
cloud.

Bruno Rocha
http://about.me/rochacbruno/bio


2011/2/7 stargate 

> Does anybody know of a hosting company that will run web2py in a cloud
> hosting environment?
>


Re: [web2py] Cloud hosting company

2011-02-07 Thread contatogilson...@gmail.com
How to the plan?
$$$
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/2/7 Bruno Rocha 

> I am running in dotcloud (but it is in beta)
>
> http://www.web2py.dotcloud.com/
>
>  also Pydra is announcing they will run
> web2py very soon.
>
> For now, I know only Google App Engine and Amazon ECM running well on a
> cloud.
>
> Bruno Rocha
> http://about.me/rochacbruno/bio
>
>
> 2011/2/7 stargate 
>
> Does anybody know of a hosting company that will run web2py in a cloud
>> hosting environment?
>>
>
>


Re: [web2py] [Mysql] global name 'driver' is not defined

2011-02-07 Thread Martín Mulone
affirmative, this is the bug.

Line 1462 . Have to be self.driver instead of driver.

2011/2/7 Jonathan Lundell 

> On Feb 7, 2011, at 6:32 AM, Martín Mulone wrote:
> > I'm trying to connect to mysql, with trunk.
> >
> > global name 'driver' is not defined
> >
>
> On dal.py line 1462, try changing driver to self.driver.




-- 
Pablo Martín Mulone (mar...@tecnodoc.com.ar)
http://www.tecnodoc.com.ar/
Paraná, Entre Ríos, Argentina (CP 3100).

My blog: http://martin.tecnodoc.com.ar
Expert4Solution Profile:
http://www.experts4solutions.com/e4s/default/expert/6


Re: [web2py] Routing service with query args

2011-02-07 Thread Jonathan Lundell
On Feb 6, 2011, at 4:47 PM, Gabriel wrote:
> 
> Hi, I have this json service:
> 
> app/default.py
> ...
> @service.json
> def create(model, fields):
>  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))
> 
> and I am trying to map this:
> 
> routes_in = (
>  ('/service/$model/create', '/app/default/call/json/create?model=
> $model'),
> )
> 
> With this I'd want to do:
> 
> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
> app/person/create"
> 
> and in the create function get model="person" and in fields='{"name":
> "test"}'
> But it does not work, it is redirecting to default page.
> In httpserver.log I get
> 
> 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055
> 
> If I do:
> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
> 8000/app/default/call/json/create?model=person"
> it works, so I think the problem is the routing.
> 
> Any help about what I'm doing wrong?

Is it as simple as 'app' in your incoming URL not matching 'service' in the 
routes pattern?


> Thanks for advance.




[web2py] Re: Security question: cookie manipulation & stealing cookies

2011-02-07 Thread Massimo Di Pierro
We do not have a simple mechanism yet to do it. I can add it, please
open an issue on google code.

On Feb 7, 9:28 am, devGS  wrote:
> And one more question, how to change session ID after user login?
>
> On Feb 7, 5:13 pm, devGS  wrote:
>
>
>
>
>
>
>
> > I saw many explanations about web2py's built-in security, but does it
> > have some implemented security against cookie manipulation and
> > stealing cookies attacks? -For cases when the attacker is the user,
> > and when the attacker is not the user.  If not, can someone provide
> > some recommendations for a beginner on how to defend myself from those
> > vulnerabilities? Thanks.


[web2py] Re: Cloud hosting company

2011-02-07 Thread stargate
Where is the prices on hosting?

On Feb 7, 11:10 am, Bruno Rocha  wrote:
> I am running in dotcloud (but it is in beta)
>
> http://www.web2py.dotcloud.com/
>
>  also Pydra is announcing they will run
> web2py very soon.
>
> For now, I know only Google App Engine and Amazon ECM running well on a
> cloud.
>
> Bruno Rochahttp://about.me/rochacbruno/bio
>
> 2011/2/7 stargate 
>
> > Does anybody know of a hosting company that will run web2py in a cloud
> > hosting environment?
>
>


[web2py] Re: [Mysql] global name 'driver' is not defined

2011-02-07 Thread Massimo Di Pierro
oops. sorry. Will fix it tonight.

On Feb 7, 10:17 am, Martín Mulone  wrote:
> affirmative, this is the bug.
>
> Line 1462 . Have to be self.driver instead of driver.
>
> 2011/2/7 Jonathan Lundell 
>
> > On Feb 7, 2011, at 6:32 AM, Martín Mulone wrote:
> > > I'm trying to connect to mysql, with trunk.
>
> > > global name 'driver' is not defined
>
> > On dal.py line 1462, try changing driver to self.driver.
>
> --
> Pablo Martín Mulone (mar...@tecnodoc.com.ar)http://www.tecnodoc.com.ar/
> Paraná, Entre Ríos, Argentina (CP 3100).
>
> My blog:http://martin.tecnodoc.com.ar
> Expert4Solution Profile:http://www.experts4solutions.com/e4s/default/expert/6


Re: [web2py] Re: Cloud hosting company

2011-02-07 Thread David J.

You can run on Rackspace cloud as well;


On 2/7/11 11:32 AM, stargate wrote:

Where is the prices on hosting?

On Feb 7, 11:10 am, Bruno Rocha  wrote:

I am running in dotcloud (but it is in beta)

http://www.web2py.dotcloud.com/

  also Pydra is announcing they will run
web2py very soon.

For now, I know only Google App Engine and Amazon ECM running well on a
cloud.

Bruno Rochahttp://about.me/rochacbruno/bio

2011/2/7 stargate


Does anybody know of a hosting company that will run web2py in a cloud
hosting environment?






[web2py] Re: Security question: cookie manipulation & stealing cookies

2011-02-07 Thread devGS
Thanks for your reply, I will do so.

On Feb 7, 6:31 pm, Massimo Di Pierro 
wrote:
> We do not have a simple mechanism yet to do it. I can add it, please
> open an issue on google code.
>
> On Feb 7, 9:28 am, devGS  wrote:
>
>
>
>
>
>
>
> > And one more question, how to change session ID after user login?
>
> > On Feb 7, 5:13 pm, devGS  wrote:
>
> > > I saw many explanations about web2py's built-in security, but does it
> > > have some implemented security against cookie manipulation and
> > > stealing cookies attacks? -For cases when the attacker is the user,
> > > and when the attacker is not the user.  If not, can someone provide
> > > some recommendations for a beginner on how to defend myself from those
> > > vulnerabilities? Thanks.


[web2py] Re: Cloud hosting company

2011-02-07 Thread John-Kim Murphy
Deploy Web2py on Amazon elastic computing infrastructure:
http://www.scribd.com/doc/26436821/Howto-deploy-Web2py-on-amazon-Ec2

You can get a free instance for a year: http://aws.amazon.com/free/


On Feb 8, 12:50 am, stargate  wrote:
> Does anybody know of a hosting company that will run web2py in a cloud
> hosting environment?


Re: [web2py] Routing service with query args

2011-02-07 Thread Gabriel Carmona
Hi Jonathan. It was a typo. It'd be service instead of app:

curl --data-urlencode 'fields={"name": "test"}'
"http://localhost:8000/service/person/create";

Thanks anyway.

On Mon, Feb 7, 2011 at 1:21 PM, Jonathan Lundell  wrote:
> On Feb 6, 2011, at 4:47 PM, Gabriel wrote:
>>
>> Hi, I have this json service:
>>
>> app/default.py
>> ...
>> @service.json
>> def create(model, fields):
>>  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))
>>
>> and I am trying to map this:
>>
>> routes_in = (
>>  ('/service/$model/create', '/app/default/call/json/create?model=
>> $model'),
>> )
>>
>> With this I'd want to do:
>>
>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
>> app/person/create"
>>
>> and in the create function get model="person" and in fields='{"name":
>> "test"}'
>> But it does not work, it is redirecting to default page.
>> In httpserver.log I get
>>
>> 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055
>>
>> If I do:
>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
>> 8000/app/default/call/json/create?model=person"
>> it works, so I think the problem is the routing.
>>
>> Any help about what I'm doing wrong?
>
> Is it as simple as 'app' in your incoming URL not matching 'service' in the 
> routes pattern?
>
>
>> Thanks for advance.
>
>
>


[web2py] Re: Redirect after GAE authorization.

2011-02-07 Thread howesc
i suspect there is, but i have not spent the time to make it work yet.  i 
assume you are using google accounts on GAE for authorization?


[web2py] Re: GAE Query

2011-02-07 Thread howesc
yes you have to set your GAE app on a subdomain.  but that is the *only* 
supported configuration that i know of.  google does not allow mapping of 
"naked domains" as they call it to a GAE app.


[web2py] Re: Few general questions

2011-02-07 Thread howesc
about the sample entries:  you must have some code (probably in one of your 
models files) that adds sample entries when an empty database is detected.  
not sure though without looking at the application.

your view error is provided in the traceback (though perhaps cryptic).  
something in index.html or one of the files it includes or extends is trying 
to access the 'replace' attribute of a variable that is None.  you may have 
the proper include/extend syntax but are not setting a required variable in 
the controller.

cfh


[web2py] book typo

2011-02-07 Thread Richard Vézina
Hello,

"," is missing :

db.define_table('dog',
   Field ('small_image',
'upload'), # here
   Field ('large_image',
'upload'))

In this page :

http://web2py.com/book/default/chapter/08?search=shell


Search for :


db.define_table('dog',
   Field ('small_image',
'upload')
   Field ('large_image',
'upload'))


Richard


[web2py] Re: Cloud hosting company

2011-02-07 Thread Art Zemon
Yes, we do (Hen's Teeth Network). Web2py is running great using
mod_wsgi in our Cirrus plans. I have not tried to make it work in a
Stratus plan, yet. See http://www.hens-teeth.net/html/hosting/ for
details.

For "proof," visit http://web2py.hens-teeth.net/ which is an internal
R&D site. We have already deployed our first production web2py app for
a client but I cannot give you the URL because it is on their
intranet.

-- Art Z.

On Feb 7, 9:50 am, stargate  wrote:
> Does anybody know of a hosting company that will run web2py in a cloud
> hosting environment?


[web2py] Re: Deleting a cookie

2011-02-07 Thread Dane
Thanks.

On Feb 7, 9:28 am, Massimo Di Pierro 
wrote:
> http://msdn.microsoft.com/en-us/library/ms178195.aspx
>
> "You cannot directly delete a cookie on a user's computer. However,
> you can direct the user's browser to delete the cookie by setting the
> cookie's expiration date to a past date. The next time a user makes a
> request to a page within the domain or path that set the cookie, the
> browser will determine that the cookie has expired and remove it."
>
> On Feb 7, 1:28 am, Dane  wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I've got my own user system (not using Auth), and I'm trying to
> > implement a Remember Me option with cookies. It's working fine when
> > the user selects 'Yes' for remember me. Setting and detecting the
> > cookie is no problem, but I can't find a way to delete the cookie when
> > the user logs out or selects 'No'. Here's my code which attempts
> > everything I can think of.
>
> > if request.cookies.has_key('user'):
> >         request.cookies['user'].clear()
> >         del request.cookies['user']
> >         print 'remove request user cookie'
> > if response.cookies.has_key('user'):
> >         response.cookies['user'].clear()
> >         del response.cookies['user']
> >         print 'remove response user cookie'
>
> > After running this, request.cookies.has_key('user') is still returning
> > true and the cookie's data is still present.
>
> > Ideas? Thanks.


Re: [web2py] Routing service with query args

2011-02-07 Thread Jonathan Lundell
On Feb 7, 2011, at 8:49 AM, Gabriel Carmona wrote:
> 
> Hi Jonathan. It was a typo. It'd be service instead of app:
> 
> curl --data-urlencode 'fields={"name": "test"}'
> "http://localhost:8000/service/person/create";
> 
> Thanks anyway.

The URL rewrite logic isn't handling the case of appending a query string to 
the incoming URL properly.

I'm checking to see if this was broken recently, or if it's been broken for a 
while. What version are you running?


> 
> On Mon, Feb 7, 2011 at 1:21 PM, Jonathan Lundell  wrote:
>> On Feb 6, 2011, at 4:47 PM, Gabriel wrote:
>>> 
>>> Hi, I have this json service:
>>> 
>>> app/default.py
>>> ...
>>> @service.json
>>> def create(model, fields):
>>>  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))
>>> 
>>> and I am trying to map this:
>>> 
>>> routes_in = (
>>>  ('/service/$model/create', '/app/default/call/json/create?model=
>>> $model'),
>>> )
>>> 
>>> With this I'd want to do:
>>> 
>>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
>>> app/person/create"
>>> 
>>> and in the create function get model="person" and in fields='{"name":
>>> "test"}'
>>> But it does not work, it is redirecting to default page.
>>> In httpserver.log I get
>>> 
>>> 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055
>>> 
>>> If I do:
>>> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
>>> 8000/app/default/call/json/create?model=person"
>>> it works, so I think the problem is the routing.
>>> 
>>> Any help about what I'm doing wrong?
>> 
>> Is it as simple as 'app' in your incoming URL not matching 'service' in the 
>> routes pattern?
>> 
>> 
>>> Thanks for advance.
>> 
>> 
>> 




Re: [web2py] Routing service with query args

2011-02-07 Thread Gabriel Carmona
I'm using "Version 1.91.6 (2011-01-03 17:55:14)"

On Mon, Feb 7, 2011 at 2:50 PM, Jonathan Lundell  wrote:
> On Feb 7, 2011, at 8:49 AM, Gabriel Carmona wrote:
>>
>> Hi Jonathan. It was a typo. It'd be service instead of app:
>>
>> curl --data-urlencode 'fields={"name": "test"}'
>> "http://localhost:8000/service/person/create";
>>
>> Thanks anyway.
>
> The URL rewrite logic isn't handling the case of appending a query string to 
> the incoming URL properly.
>
> I'm checking to see if this was broken recently, or if it's been broken for a 
> while. What version are you running?
>
>
>>
>> On Mon, Feb 7, 2011 at 1:21 PM, Jonathan Lundell  wrote:
>>> On Feb 6, 2011, at 4:47 PM, Gabriel wrote:

 Hi, I have this json service:

 app/default.py
 ...
 @service.json
 def create(model, fields):
  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))

 and I am trying to map this:

 routes_in = (
  ('/service/$model/create', '/app/default/call/json/create?model=
 $model'),
 )

 With this I'd want to do:

 curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
 app/person/create"

 and in the create function get model="person" and in fields='{"name":
 "test"}'
 But it does not work, it is redirecting to default page.
 In httpserver.log I get

 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055

 If I do:
 curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
 8000/app/default/call/json/create?model=person"
 it works, so I think the problem is the routing.

 Any help about what I'm doing wrong?
>>>
>>> Is it as simple as 'app' in your incoming URL not matching 'service' in the 
>>> routes pattern?
>>>
>>>
 Thanks for advance.
>>>
>>>
>>>
>
>
>


[web2py] Re: Problem with DAL and Postgres

2011-02-07 Thread ron_m
Why is this line

Field('password', 'password', '''length=512, ''', readable=False, 
label='Password'), 

should be

Field('password', 'password', length=512, readable=False, 
label='Password'), 


[web2py] Re: Django vs web2py pain points

2011-02-07 Thread Luther Goh Lu Feng
Thanks for the feedback everyone. I am happy to hear balanced view
points. For the record, we have decided to go along with django for
now, doing paired programming.

My current impression of django is that it does seem much more verbose
than web2py. I also miss the fact that I do not need to configure my
routes most of the time in web2py.

Hopefully I can post more when I get deeper into django.



[web2py] Re: Nice Error Screens

2011-02-07 Thread Tito Garrido
Nobody? :-/

On Sat, Feb 5, 2011 at 12:08 PM, Tito Garrido  wrote:

> Hi Folks,
>
> Is there a way to configure the error ticket screen to have a good looking?
> Today it just appears a white screen with the ticket number and a link...
> also, can I change the "invalid function" screen?
>
> Thanks,
>
> Tito
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


Re: [web2py] Routing service with query args

2011-02-07 Thread Jonathan Lundell
On Feb 7, 2011, at 10:02 AM, Gabriel Carmona wrote:
> 
> I'm using "Version 1.91.6 (2011-01-03 17:55:14)"

Thanks. I've got a working patch that hopefully we'll have time to get into 
1.92.

In the current version, you'll need to avoid rewrites that add a query string; 
that's broken.

> 
> On Mon, Feb 7, 2011 at 2:50 PM, Jonathan Lundell  wrote:
>> On Feb 7, 2011, at 8:49 AM, Gabriel Carmona wrote:
>>> 
>>> Hi Jonathan. It was a typo. It'd be service instead of app:
>>> 
>>> curl --data-urlencode 'fields={"name": "test"}'
>>> "http://localhost:8000/service/person/create";
>>> 
>>> Thanks anyway.
>> 
>> The URL rewrite logic isn't handling the case of appending a query string to 
>> the incoming URL properly.
>> 
>> I'm checking to see if this was broken recently, or if it's been broken for 
>> a while. What version are you running?
>> 
>> 
>>> 
>>> On Mon, Feb 7, 2011 at 1:21 PM, Jonathan Lundell  wrote:
 On Feb 6, 2011, at 4:47 PM, Gabriel wrote:
> 
> Hi, I have this json service:
> 
> app/default.py
> ...
> @service.json
> def create(model, fields):
>  return dict(id=get_model_or_404(model).insert(**json.loads(fields)))
> 
> and I am trying to map this:
> 
> routes_in = (
>  ('/service/$model/create', '/app/default/call/json/create?model=
> $model'),
> )
> 
> With this I'd want to do:
> 
> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:8000/
> app/person/create"
> 
> and in the create function get model="person" and in fields='{"name":
> "test"}'
> But it does not work, it is redirecting to default page.
> In httpserver.log I get
> 
> 127.0.0.1, 2011-02-06 20:41:12, POST, , HTTP/1.1, 200, 0.330055
> 
> If I do:
> curl --data-urlencode 'fields={"name": "test"}' "http://localhost:
> 8000/app/default/call/json/create?model=person"
> it works, so I think the problem is the routing.
> 
> Any help about what I'm doing wrong?
 
 Is it as simple as 'app' in your incoming URL not matching 'service' in 
 the routes pattern?
 
 
> Thanks for advance.
 
 
 
>> 
>> 
>> 




[web2py] Overriding the Default "verify_email"

2011-02-07 Thread David J.

I was wondering how I can execute a custom action on "verify_email"

I have an external system that I want to notify once a user has 
confirmed their email address;


Thanks.


[web2py] Re: Deleting a cookie

2011-02-07 Thread Dane
Ok, now I'm using this code:

for r in [request, response]:
if r.cookies.has_key('user'):
r.cookies['user']['expires'] =
datetime.datetime.strftime(datetime.datetime(2011,1,1,0,0), "%a, %d-%b-
%Y %H:%M:%S GMT")
print 'remove %s user cookie' % ('request' if r == request
else 'response')

And still my cookie isn't going away...

On Feb 7, 9:28 am, Massimo Di Pierro 
wrote:
> http://msdn.microsoft.com/en-us/library/ms178195.aspx
>
> "You cannot directly delete a cookie on a user's computer. However,
> you can direct the user's browser to delete the cookie by setting the
> cookie's expiration date to a past date. The next time a user makes a
> request to a page within the domain or path that set the cookie, the
> browser will determine that the cookie has expired and remove it."
>
> On Feb 7, 1:28 am, Dane  wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I've got my own user system (not using Auth), and I'm trying to
> > implement a Remember Me option with cookies. It's working fine when
> > the user selects 'Yes' for remember me. Setting and detecting the
> > cookie is no problem, but I can't find a way to delete the cookie when
> > the user logs out or selects 'No'. Here's my code which attempts
> > everything I can think of.
>
> > if request.cookies.has_key('user'):
> >         request.cookies['user'].clear()
> >         del request.cookies['user']
> >         print 'remove request user cookie'
> > if response.cookies.has_key('user'):
> >         response.cookies['user'].clear()
> >         del response.cookies['user']
> >         print 'remove response user cookie'
>
> > After running this, request.cookies.has_key('user') is still returning
> > true and the cookie's data is still present.
>
> > Ideas? Thanks.


Re: [web2py] Re: Django vs web2py pain points

2011-02-07 Thread Albert Abril
@Luther Goh Lu Feng : Keep us informed. ;)

On Mon, Feb 7, 2011 at 7:37 PM, Luther Goh Lu Feng  wrote:

> Thanks for the feedback everyone. I am happy to hear balanced view
> points. For the record, we have decided to go along with django for
> now, doing paired programming.
>
> My current impression of django is that it does seem much more verbose
> than web2py. I also miss the fact that I do not need to configure my
> routes most of the time in web2py.
>
> Hopefully I can post more when I get deeper into django.
>
>


Re: [web2py] Re: Nice Error Screens

2011-02-07 Thread Bruno Rocha
You can define a better HTML for error ticket message in routes.py:

http://code.google.com/p/web2py/source/browse/routes.example.py#73


2011/2/7 Tito Garrido 

> Nobody? :-/
>
>
> On Sat, Feb 5, 2011 at 12:08 PM, Tito Garrido wrote:
>
>> Hi Folks,
>>
>> Is there a way to configure the error ticket screen to have a good
>> looking? Today it just appears a white screen with the ticket number and a
>> link... also, can I change the "invalid function" screen?
>>
>> Thanks,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>


[web2py] Re: Django vs web2py pain points

2011-02-07 Thread Luther Goh Lu Feng
Actually, I also have a friend using Rails who wants to do pair
programming with me so that both of us can do a thorough and objective
comparison. Need to squeeze out time for that >.< There are too many
things to learn in web and mobile development >.<

Of course, I will still continue to use web2py for my other
projects :)

On Feb 8, 3:18 am, Albert Abril  wrote:
> @Luther Goh Lu Feng : Keep us informed. ;)
>
> On Mon, Feb 7, 2011 at 7:37 PM, Luther Goh Lu Feng  wrote:
>
>
>
>
>
>
>
> > Thanks for the feedback everyone. I am happy to hear balanced view
> > points. For the record, we have decided to go along with django for
> > now, doing paired programming.
>
> > My current impression of django is that it does seem much more verbose
> > than web2py. I also miss the fact that I do not need to configure my
> > routes most of the time in web2py.
>
> > Hopefully I can post more when I get deeper into django.


[web2py] Re: Cloud hosting company

2011-02-07 Thread Anthony
On Monday, February 7, 2011 11:32:28 AM UTC-5, stargate wrote: 
>
> Where is the prices on hosting?

 
They're still in beta and haven't finalized their pricing yet: 
http://docs.dotcloud.com/static/faq/#what-s-your-pricing
 
Other new options specifically for Python/WSGI hosting still in beta are:
http://www.ep.io/
http://stable.io/
http://www.pydra.com/ (someone already mentioned this)
 
Anthony


Re: [web2py] Re: Problem with DAL and Postgres

2011-02-07 Thread Bernardo Botella Corbí
Dear Massimo,

I've been busy today. I'll post it as soon as possible.

thanks for your help,
Bernardo

2011/2/7 Massimo Di Pierro 

> I am very puzzled.
>
> In gluon/dal.py there is this line:
>
> field.length = min(field.length,self._db and
> self._db._adapter.maxcharlength or INFINITY)
>
> can you print field.length before and field.length after this
> statement?
>
> Massimo
>
> On Feb 7, 3:06 am, Bernardo  wrote:
> > Sure Massimo, here it goes:
> >
> > db.define_table(auth.settings.table_user_name,
> > Field('first_name', length=128, default=''),
> > Field('last_name', length=128, default=''),
> > Field('username', length=128, default=''),
> > Field('email', length=128, default='', unique=True),
> > Field('password', 'password', '''length=512, ''', readable=False,
> > label='Password'),
> > Field('registration_key', length=512, writable=False,
> > readable=False, default=''),
> > Field('reset_password_key', length=512, writable=False,
> > readable=False, default=''),
> > Field('registration_id', length=512, writable=False,
> > readable=False, default=''),
> > Field('imagen', 'upload', requires=IS_IMAGE()),
> > Field('texto_descriptivo', 'text'),
> > Field('activado', 'boolean', default=True, readable=False,
> > writable=False),
> > Field('karma', 'double', default=0, readable=False,
> > writable=False),
> > Field('acepta_registro', 'boolean', requires=IS_IN_SET(['on'],
> > error_message=T('You must accept the license terms.')), label=XML(T('I
> > \'ve read and I accept the ') + A(T('license terms'),
> > _href=URL('default', 'texto_registro'), _target='new')))
> > )
> >
> > On 7 feb, 05:09, Massimo Di Pierro  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Can you show your custom auth_user. I am still puzzled by the error.
> >
> > > On Feb 6, 4:21 pm, Bernardo Botella Corbí  wrote:
> >
> > > > Yes, the error is on my custom auth_user table. So, Do I reduce the
> leght
> > > > numbers?
> >
> > > > Bernardo
> >
> > > > 2011/2/6 Massimo Di Pierro 
> >
> > > > > Do you have a custom auth_user table? Is seems to miss a length
> > > > > attribute and default to a number too large. I changed the default
> to
> > > > > 32768 in trunk but I am not sure.
> >
> > > > > On Feb 6, 3:13 pm, Bernardo  wrote:
> > > > > > Dear all,
> >
> > > > > > I am using web2py 1.91.6 and last version of Ubuntu. A model
> which
> > > > > > works perfectly using sqlite database, throws an error when using
> a
> > > > > > postgres database:
> >
> > > > > > ProgrammingError: syntax error at or near "100"
> > > > > > LINE 1: ALTER TABLE auth_user ADD password VARCHAR(100);
> >
> > > > > > posible bug in new DAL?
> >
> > > > > > Thanks a lot for your help,
> > > > > > Bernardo
>


[web2py] Upload file default

2011-02-07 Thread Bernardo
Dear all,

is there a way to use a default file in an upload field? Something
like:

Field('whatever', 'upload', 'default=...')

Which one is the best way to do this?

thanks a lot for your help,
Bernardo


[web2py] Google Chrome 9 crashes

2011-02-07 Thread Bernd Rothert
Today all of a sudden Google Chrome (9.0.597.84-r72991) hung loading a
simple web2py page. It couldn't even render the welcome page any more. Even
a blank new profile didn't work. It just hung and reported a crashed web
page after a while (the sad dialog).

Then I tried chromium - same behaviour, even with a mirror copy of the
welcome page as "file:///...".

It turned out that modernizr-1.6.min.js caused the crash when trying to
detect WebGL support.

Bug report for chromium:
http://code.google.com/p/chromium/issues/detail?id=69845

Bug report for modernizr:
https://github.com/Modernizr/Modernizr/issues/issue/156

It should help to disable WebGL in http://about:flags if this bug bites you.
You can also comment out the try...webgl... part in modernizr-1.6.js or just
remove modernizr from the layout.html. Its checks for WebGL  can be quite
expensive anyway and slow down page loading if you don't need it.

Funny: Trying to load http://www.modernizr.com/news/ fails in the same way
(Google Chrome 9.0.597.84-r72991).

Cheers
Bernd


[web2py] Re: Upload file default

2011-02-07 Thread Massimo Di Pierro
If you have an uploaded file (with name given by web2py) you can set
default='' its filename without path.
Did you try it?

On Feb 7, 1:40 pm, Bernardo  wrote:
> Dear all,
>
> is there a way to use a default file in an upload field? Something
> like:
>
> Field('whatever', 'upload', 'default=...')
>
> Which one is the best way to do this?
>
> thanks a lot for your help,
> Bernardo


[web2py] Re: Google Chrome 9 crashes

2011-02-07 Thread Massimo Di Pierro
I am using 9.0.597.84 beta on Mac with WebGL on and everything works
for me. Which os are you using?

Massimo

On Feb 7, 2:40 pm, Bernd Rothert  wrote:
> Today all of a sudden Google Chrome (9.0.597.84-r72991) hung loading a
> simple web2py page. It couldn't even render the welcome page any more. Even
> a blank new profile didn't work. It just hung and reported a crashed web
> page after a while (the sad dialog).
>
> Then I tried chromium - same behaviour, even with a mirror copy of the
> welcome page as "file:///...".
>
> It turned out that modernizr-1.6.min.js caused the crash when trying to
> detect WebGL support.
>
> Bug report for 
> chromium:http://code.google.com/p/chromium/issues/detail?id=69845
>
> Bug report for 
> modernizr:https://github.com/Modernizr/Modernizr/issues/issue/156
>
> It should help to disable WebGL inhttp://about:flagsif this bug bites you.
> You can also comment out the try...webgl... part in modernizr-1.6.js or just
> remove modernizr from the layout.html. Its checks for WebGL  can be quite
> expensive anyway and slow down page loading if you don't need it.
>
> Funny: Trying to loadhttp://www.modernizr.com/news/fails in the same way
> (Google Chrome 9.0.597.84-r72991).
>
> Cheers
> Bernd


[web2py] onaccept

2011-02-07 Thread David J.


Is there an example of how to use "onaccept" handler?

I tried

auth.settings.verify_email_onaccept = lambda f:_create_account(f)



def _create_account(f):
session.account  = f
return


I tried on my index page to display

{{= session.account }}

But I dont think it worked.

Thanks.




[web2py] Re: Google Chrome 9 crashes

2011-02-07 Thread Bernd Rothert
On 7 Feb., 21:50, Massimo Di Pierro 
wrote:
> I am using 9.0.597.84 beta on Mac with WebGL on and everything works
> for me. Which os are you using?
>

It's Chrome on Ubuntu 10.10 (Maverick Meerkat)! Bug reports refer to
Windows XP as well. Maybe it depends on the graphics hardware's
support for GL...

Bernd

> Massimo
>
> On Feb 7, 2:40 pm, Bernd Rothert  wrote:
>
>
>
>
>
>
>
> > Today all of a sudden Google Chrome (9.0.597.84-r72991) hung loading a
> > simple web2py page. It couldn't even render the welcome page any more. Even
> > a blank new profile didn't work. It just hung and reported a crashed web
> > page after a while (the sad dialog).
>
> > Then I tried chromium - same behaviour, even with a mirror copy of the
> > welcome page as "file:///...".
>
> > It turned out that modernizr-1.6.min.js caused the crash when trying to
> > detect WebGL support.
>
> > Bug report for 
> > chromium:http://code.google.com/p/chromium/issues/detail?id=69845
>
> > Bug report for 
> > modernizr:https://github.com/Modernizr/Modernizr/issues/issue/156
>
> > It should help to disable WebGL inhttp://about:flagsifthis bug bites you.
> > You can also comment out the try...webgl... part in modernizr-1.6.js or just
> > remove modernizr from the layout.html. Its checks for WebGL  can be quite
> > expensive anyway and slow down page loading if you don't need it.
>
> > Funny: Trying to loadhttp://www.modernizr.com/news/failsin the same way
> > (Google Chrome 9.0.597.84-r72991).
>
> > Cheers
> > Bernd


[web2py] Re: Few general questions

2011-02-07 Thread devGS
Thank you! The sample table is populated by "db_wizard_populate.py"
module. For those who had similar issue: comment all the lines in the
above file on deployment.

Your pointed me to the line that causes the view error: in user.html-
the default one, there is a line with
{{=T(request.args(0).replace('_',' ').capitalize()}} . My question is
what does the line do and why args(0) is None when rendering through
index.html?

On Feb 7, 7:04 pm, howesc  wrote:
> about the sample entries:  you must have some code (probably in one of your
> models files) that adds sample entries when an empty database is detected.  
> not sure though without looking at the application.
>
> your view error is provided in the traceback (though perhaps cryptic).  
> something in index.html or one of the files it includes or extends is trying
> to access the 'replace' attribute of a variable that is None.  you may have
> the proper include/extend syntax but are not setting a required variable in
> the controller.
>
> cfh


[web2py] Re: GAE Query

2011-02-07 Thread bee
So if using GAE on a subdomain for a homepage would use redirect users
to the subdomain? I think i am even more confused now1

On Feb 7, 4:57 pm, howesc  wrote:
> yes you have to set your GAE app on a subdomain.  but that is the *only*
> supported configuration that i know of.  google does not allow mapping of
> "naked domains" as they call it to a GAE app.


[web2py] Re: Can anyone recommend a good python forum in google groups or elsewhere?

2011-02-07 Thread Plumo
http://stackoverflow.com/questions/tagged/python

If you are after a forum written in Python: http://pyforum.org/


[web2py] Re: plugin_wiki suggestions

2011-02-07 Thread Plumo
yes mode 3, but as mentioned response.title is empty (None).

Where do I need to define response.title for the plugin to use it? I tried 
models/menu.py and controllers/plugin_wiki.py without success. 
views/layout.html is able to use response.title.


[web2py] Re: GAE timeout when wsgihandler.py is missing

2011-02-07 Thread Charles Law
I went to remove wsgihandler.py to check the logs and reloaded the
page, but the timeout issue wasn't showing up.  I made some changes to
the html files to make sure that the changes made it online, and it
loaded quickly.

Maybe the issue was on the GAE side?  Either way, it looks like it's
gone.


On Feb 6, 10:28 am, dlypka  wrote:
> I suggest checking the logs for any clues.
> Slow running often = exceptions are happening.
>
> On Feb 5, 6:12 pm, Charles Law  wrote:
>
>
>
>
>
>
>
> > I am uploading an app to GAE. Through some experimentation I've found
> > that if I don't include wsgihandler.py, the app loads very slowly. It
> > feels like it's looking for this file and them timing out. Besides the
> > slow loading, everything works perfectly without wsgihandler.py, so I
> > want to know if there is a simple way to remove the references to the
> > file. I searched through all the uploaded files, but it doesn't look
> > like there are direct references.
>
> > Also, here is a list of the files I'm including:
> > web2py/app.yaml
> > web2py/gaehandler.py
> > web2py/VERSION
> > web2py/gluon/* (and subfolders)
> > web2py/applications/appname/* (and subfolders)
> > Thanks


[web2py] Oh, Reddit :(

2011-02-07 Thread Anthony
http://www.reddit.com/r/Python/comments/fh4by/special_cases_arent_special_enough_to_break_the/

Re: [web2py] Re: plugin_wiki suggestions

2011-02-07 Thread Bruno Rocha
You can do that in meta-code page,

create a wiki page called meta-code, this code will be executed before the
execution of any page.


2011/2/7 Plumo 

> yes mode 3, but as mentioned response.title is empty (None).
>
> Where do I need to define response.title for the plugin to use it? I tried
> models/menu.py and controllers/plugin_wiki.py without success.
> views/layout.html is able to use response.title.
>


[web2py] EuroPython in Florence

2011-02-07 Thread carlo
Massimo, any plans to attend?


[web2py] Re: Oh, Reddit :(

2011-02-07 Thread villas
For those of us who cannot understand the point of this please have an
indication as to the 'rules' are that are being broken?
Just curious.  If the answer would be too verbose and technical,
please just put a note saying something like 'for advanced pythonistas
only'.
Thanks. D


[web2py] Re: EuroPython in Florence

2011-02-07 Thread Massimo Di Pierro
I cannot make, I have another conference at the same time.

On Feb 7, 4:50 pm, carlo  wrote:
> Massimo, any plans to attend?


[web2py] Re: EuroPython in Florence

2011-02-07 Thread Massimo Di Pierro
PS. I would be great is somebody else could make it and give a talk.

On Feb 7, 4:50 pm, carlo  wrote:
> Massimo, any plans to attend?


[web2py] PyPy faster than C ...

2011-02-07 Thread elffikk
I think this is cool

http://morepypy.blogspot.com/2011/02/pypy-faster-than-c-on-carefully-crafted.html


Re: [web2py] Re: plugin_wiki suggestions

2011-02-07 Thread Plumo
that would require an additional database request and replicating the logic 
from controllers/plugin_wiki.py - is there no way to reuse the data from the 
controller?

[web2py] Re: book typo

2011-02-07 Thread villas
Ok I did it.  Thanks. D

On Feb 7, 5:17 pm, Richard Vézina  wrote:
> Hello,
>
> "," is missing :
>
> db.define_table('dog',
>    Field ('small_image',
> 'upload'), # here
>    Field ('large_image',
> 'upload'))
>
> In this page :
>
> http://web2py.com/book/default/chapter/08?search=shell
>
> Search for :
>
> db.define_table('dog',
>    Field ('small_image',
> 'upload')
>    Field ('large_image',
> 'upload'))
>
> Richard


[web2py] Re: Overriding the Default "verify_email"

2011-02-07 Thread mattynoce
here's what i do:
in db.py:
auth.settings.verify_email_onaccept = lambda form: __afterVerify(form)
def __afterVerify(form):
# any custom actions you want, including calling funtions in
either the model or the controller
# in my case, i log in my user.
logInUser(db.auth_user[form.id])
auth.settings.verify_email_next = '/init/default/verified'


so i use __afterVerify to log in the user, then i send them to /init/
default/verified where i have all actions usable in a controller.

here's the login info, in case you want that too.

def __logInUser(user):
# function to log in a user. taken from
http://groups.google.com/group/web2py/browse_thread/thread/84f27e0a06312da2/a3c48ec55d9ceb05?hl=en&lnk=gst&q=session+auth+user#a3c48ec55d9ceb05
from gluon.storage import Storage
session.auth = Storage(user=user, last_visit=request.now,
   expiration=auth.settings.expiration)

hope that helps,

matt

On Feb 7, 11:10 am, "David J."  wrote:
> I was wondering how I can execute a custom action on "verify_email"
>
> I have an external system that I want to notify once a user has
> confirmed their email address;
>
> Thanks.


[web2py] Re: seems like a little mistake in book

2011-02-07 Thread villas
Yes,  I believe you're right,  so I've changed it.
Thanks,  D

On Feb 7, 3:14 pm, LightOfMooN  wrote:
> auth.settings.long_expiration = 3600*30 # one month
> maybe 3600*30*24?


[web2py] Re: Oh, Reddit :(

2011-02-07 Thread Massimo Di Pierro
No rule is being broken. The guy just does not understand what the
code is for. I posted my response there.

On Feb 7, 5:05 pm, villas  wrote:
> For those of us who cannot understand the point of this please have an
> indication as to the 'rules' are that are being broken?
> Just curious.  If the answer would be too verbose and technical,
> please just put a note saying something like 'for advanced pythonistas
> only'.
> Thanks. D


[web2py] Trying to use a plugin_wiki page as default for a web2py site

2011-02-07 Thread Offray Vladimir Luna Cárdenas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

I'm trying to use plugin_wiki as my first approach to having a
functional web2py site and using it to publish easily some info. I tried
also Instant Press but it doesn't installed because a time out error a
got no feedback on the Spanish or English list and I would like to test
more plugin_wiki for a more techie approach to publishing in web2py even
making a blog on it (but I plan to go to Instant Press again for some
not technical inclined friends who I want to introduce to web2py).

Anyway I'm trying to make a page in plugin_wiki a default page when
people load the web2py powered site, so I modified the routes.example.py
naming it routes.py and restarted cherokee. My change was this:

- --->
default_application = 'welcome'# ordinarily set in base routes.py
default_controller = 'plugin_wiki'  # ordinarily set in app-specific
routes.py
default_function = 'page'   # ordinarily set in app-specific..
<---

and it shows the page for pages creation with all the created ones. If I
tryed adding parenthesis to "page" function, making it "page()" and it
shows a more specif message for page creation. When I tried
"page(test)", using a previously created "test" page, web2py send me an
error message of the form:

invalid function (plugin_wiki/page(test))

May be I'm understanding wrong about how to use routes.py or calling a
specific pages as an argument of page function. Any advice about how to
make a specific plugin_wiki default home page will be appreciated.

Thanks in advance,

Offray
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNUJUvAAoJEGiex2828ICwAQUH/jDyi+ppJ/B35IJqeHfp8VGK
wpOhXLRldBqq2UfEQJfnR1YqIRYAeJX2kgGuyo0A4L8emF+ELeld1/de86R51E/2
M+IvMTtovfoCfA0mQf+hiHQU/vHLgX+IEv6LPJXvvSK2BoFnNq5mT9Fs9LA/ukdv
3x8Vor5jfANW9CHEndDZzUf34UrB0ZkmPJSYyOypkpdOvoVP/vzufBmWwbE1G1n5
lhusdbdauHagiKDx9ZpnvKXduMQSeX2yWbAreo59mUaaQ+w4jGUwx+vUAXZDqik8
NoleBeGsCXvuQzYH4RZCg0cG43ODI/K6o24v/mrB/dTdEKgg0wOPwopOkg5ZuOA=
=ZiUF
-END PGP SIGNATURE-


Re: [web2py] Trying to use a plugin_wiki page as default for a web2py site

2011-02-07 Thread Offray Vladimir Luna Cárdenas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi again,

I have an error:


El 07/02/11 19:58, Offray Vladimir Luna Cárdenas escribió:


[]
> --->
> default_application = 'welcome'# ordinarily set in base routes.py
> default_controller = 'plugin_wiki'  # ordinarily set in app-specific
> routes.py
> default_function = 'page'   # ordinarily set in app-specific..
> <---
> 
> and it shows the page for pages creation with all the created ones. If I
> tryed adding parenthesis to "page" function, making it "page()" and it
> shows a more specif message for page creation. 


> When I tried
> "page(test)", using a previously created "test" page, web2py send me an
> error message of the form:
> 
> invalid function (plugin_wiki/page(test))


Is not true (bad memory). default_function = 'index', shows the form
with all the created pages and default_function = 'page' shows the more
specific message for a page creation. default_function = 'page()' gives
the same error message that trying with a specific page name. Also when
I tried default_funtion = 'page/test' for example.

Thanks,

Offray
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNUJf3AAoJEGiex2828ICwb5sH/0QvGsdpnhM2JUwJiepTPeLo
puNNTOyXrhaifpuW21BEBnVVgyEjfEtRo/vJrlF8lDGZ3eacxCr0WoR5lSWpnkcT
TKYy8lCb2CrW/BuwBHaPsX3qZVjvLGBm7SyxiS0pD+jj4xgBiGqiQmIcabSjs82s
HBwEkeChbakAmOG2R8W6TW30J0VdVsgfDRiI/zdJ4O48ffT4s1LlhKApPn9VFlt7
CKhox9it/4aFMMpzmrjEtgyL+Gc4zJmx1KKhTYrRnKniC5TA91jX5HqhUKlFuXHT
2OX3mBpkL0rdqoy21aus0/TATDazf32I/Z/yC52/EAgOD4MsF0R+ivd9q6iZ0cg=
=5CZF
-END PGP SIGNATURE-


[web2py] Question about 0.py

2011-02-07 Thread devGS
I saw that object 'settings' is defined at 0.py, but I didn't see any
usage of 'settings'. For instance, in db.py, instead of reusing the
0.py's 'settings', the stings are redefined, even though realize about
some modules that use 'settings' instead of db.py set variables. Can
this point be cleared please? Why is there mail.settings.XYZ = '...'
instead of 'mail.settings.XYZ = settings.XYZ'? Thanks.


[web2py] Database data in layout?

2011-02-07 Thread pbreit
How can I insert data from my controller to layout.html? From what I can 
tell, layout.html does not have access to the dict returned from a 
controller. Do I need to or can I put it in globals, response, flash?

It seems like a block could work except that it requires that the 
{{include}} be above the {{block}}?


[web2py] Re: Question about 0.py

2011-02-07 Thread Massimo Di Pierro
0.py is not a web2py file. It is created by the wizard. If a variable
is not used is a bug in the wizard.

Massimo

On Feb 7, 7:21 pm, devGS  wrote:
> I saw that object 'settings' is defined at 0.py, but I didn't see any
> usage of 'settings'. For instance, in db.py, instead of reusing the
> 0.py's 'settings', the stings are redefined, even though realize about
> some modules that use 'settings' instead of db.py set variables. Can
> this point be cleared please? Why is there mail.settings.XYZ = '...'
> instead of 'mail.settings.XYZ = settings.XYZ'? Thanks.


Re: [web2py] Re: Oh, Reddit :(

2011-02-07 Thread Lars Hansson
But what exactly is his complaint? Would it have hurt for him to
actually, you know, explain?

---
Lars


[web2py] Re: Oh, Reddit :(

2011-02-07 Thread Vidul Petrov
It's a nice evidence, that Web2py does matter.

Otherwise the idiots won't care to bark against this splendid
technology.

On Feb 8, 12:15 am, Anthony  wrote:
> http://www.reddit.com/r/Python/comments/fh4by/special_cases_arent_spe...


[web2py] Re: Database data in layout?

2011-02-07 Thread pbreit
Any ideas?

[web2py] Re: Database data in layout?

2011-02-07 Thread pbreit
Yet again, I am mistaken. It does indeed look like templates all get jammed 
together before the code is executed. I was getting some unexpected errors 
which caused me to wonder.

  1   2   >