Sarbjit | 29 Aug 06:54 2014
Picon

Document Expired/ Need to reload page on using browser back button

I have an application having the layout as :-

INDEX controller generates a view which have some drop-down and calls another controller RESULTS :

Snippet :
<form enctype="multipart/form-data" method="post" action={{=URL('default','results')}} >

Now the RESULTS controller creates a grid and populates the view corresponding to RESULT controller.

PROBLEM :-

When I view/edit any entry of GRID, then on using the browser back button, I get the following message :-

Document Expired (Firefox)
Need to conform form resubmissions (ERR_CACHE_MISS) -- Chrome

In the RESULTS controller, I just query request.vars for variables and store them in session and later on clear the session once the GRID is populated.

I don't see this problem if I use the BACK button provided by the GRID itself (URL contained a signature - Is it causing it to work?)

Can any one please suggest on how to address this problem. This is very annoying problem.

Thanks in advance
Sarbjit

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Mark Li | 28 Aug 22:17 2014
Picon

Both auth.login() and auth.register() on the same page, prevents password validation

I currently have both auth.login() and auth.register() forms on the same page. A simplified version of my code below:

def page():
    login_form
= auth.login()
    register_form
= auth.register()

   
return dict(login_form=login_form, register_form=register_form)

If you go to the page with both forms, and submit the register form with errors (such as completely blank), the password field is NOT validated for the submitted register form!

I have a test example here:
http://tedlee.pythonanywhere.com/welcome/default/formtest

If you define auth.register() first, instead of auth.login(), then this problem does not appear for register, but there might be problems with auth.login() (I have not tested this yet).

Is this a bug, or is there a proper way to include both login and register forms on the same page, while having correct server-side validation?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Vladimir Makarov | 28 Aug 20:32 2014
Picon

STYLE for GRID table

How to add class attr. for table inside web2py grid div?
Is there a way to manage styles for table or I need only duplicate styles in css file (.web2py_grid>table {some styles})?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Louis Amon | 28 Aug 17:04 2014
Picon

SQLFORM.grid links and inner join


I have a simple one-to-many relation like so:

db.define_table('person', Field('job'))
db
.define_table('thing', Field('owner_id', 'reference person'))

And I built a grid using SQLFORM.grid like so:
grid = SQLFORM.grid((db.person.id == db.thing.owner_id),
                    fields
=[db.thing.owner_id, db.person.job],
                    links
=[dict(header='Details for thing',
                                body
=thing_link)
                         
],
                   
)

With the function thing_link defined like this:
def thing_link(row):
   
print row
   
return A('controller', 'function', args=[row.thing.uuid])


I get a ticket when loading the grid, and as far as I can tell looking at the print in thing_link, the row passed in the body of the link does not contain both tables of the inner join : it only contains whichever comes first (so row.person in this case, in terms or alphabetical order).

Is there a way around this ?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard Penman | 28 Aug 15:08 2014
Picon

Setting default app on GAE

Hello,

how is the default app set on GAE?
In routes.py I have "default_application = 'places'" but still redirects to welcome.

app.yaml states:
    # Warning! Static mapping - below - isn't compatible with 
    # the parametric router's language logic. 
    # You cannot use them together.
I have been using this for setting /robots.txt, /sitemap.xml, etc, so does that disable routes.py?

Also I noticed the default app.yaml now uploads the admin app - can admin be used on GAE?

Richard

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
'sasogeek' via web2py-users | 28 Aug 14:40 2014

How does one get their web2py sites on the poweredby page?

If I made a web app with web2py, how do I get it listed on the poweredby page?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard Penman | 28 Aug 09:59 2014
Picon

How to call rows format?

Hello,
my database table defines 'format' - what is the proper way to use this in a view?
Currently I have been using what I found in internals of SQLFORM:
db.tablename._format(record)
Richard

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Quint | 27 Aug 14:44 2014
Picon

approve my post for dev group

Hi all,

Could someone approve my post on the developers group?

Thanks!

Quint

--

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

Louis Amon | 27 Aug 11:50 2014
Picon

Delegated validation in an SQLFORM

I'm trying to build a form based on Google Places (geocoding) based on the following table:

db.define_table('place',
               
Field('address'),
               
Field('street_number'),
               
Field('route'),
               
Field('locality'),
               
Field('lat'),
               
Field('lng'),
               
)

All fields except 'address' are rendered in the form as hidden inputs.

I want my form to be validated if and only if 'lat' and 'lng' are not empty.


If I put a validator like IS_FLOAT_IN_RANGE(), these fields are indeed validated but since they are hidden there is no error message displayed.


Is there a way to invalidate 'address' if 'lat' or 'lng' is empty ? If so, I could then display an error message attached to the input users actually type into.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
José L. | 26 Aug 21:13 2014
Picon

IS_EMPTY_OR(IS_IN_DB incompatible with custom form?

Hi, I'm using a custom form to represent the fields of a table. This table has referenced fields.
If I use:
db.define_table('department',
    Field('dept_id'),
    Field('nombre'),format='%(nombre)s')

db.define_table('employee',
    Field('firstName'),
    Field('lastName'),
    Field('dept_id', db.department))

The table employee represents correctly the dept names. But if I do:


db.define_table('employee',
    Field('firstName'),
    Field('lastName'),
    Field('dept_id', db.department), requires=IS_EMPTY_OR(IS_IN_DB(db, db.department.id,
                                        '%(nombre)s')))

{{=form.custom.widget.dept_id}} shows the departament id instead of the name.
I need to add the "IS_EMPTY_OR" condition, I've also tried adding notnull=False without success.

Any hint?

Thanks.
José L.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
lpg | 26 Aug 16:29 2014
Picon

Spontaneous .table file corruption?

Anyone else seen this?
Database .table files are getting corrupted spontaneously. This happened overnight on a testing server that doesn't get users. No updates on application code, nor web2py.

https://www.dropbox.com/s/p34vdbdszdpsr1q/Screenshot%202014-08-26%2010.14.24.png?dl=0

Relevant information:
Migrate tables = True
Apache 
Linode Host

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane