Re: [web2py] auth_user and pool_size?

2014-04-30 Thread Niphlod
If you don't change this line both in production and in test

auth.define_tables(migrate=False, username=True, signature=False)

the error that you are getting will NEVER pop up. 
If migrate=False, web2py doesn't attempt to create the auth tables, so the 
error
 "table_auth_user already exists"
DOESN'T pop up.
are you sure that what you're reporting is exatcly what's happening ?

On Wednesday, April 30, 2014 8:13:43 AM UTC+2, Annet wrote:
>
> Hi Richard,
>
> Thanks for you reply.
>
> Personally, because I didn't have the control I want on migration, and I 
>> don't want to lost data. I don't do that. I update the prod database 
>> manually...
>>
>  
>
> I've considered this too but wasn't sure about how to proceed. What you do 
> is alter your database in the admin tool on the database (pgAdmin3 or 
> phpPgAdmin in my case),
> in the connection string set  migrate=False, fake_migrate=True and in the 
> table definition set migrate = 'table_name.table'.
>
> Is that correct.
>
> Regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Autocomplete and list:string

2014-04-30 Thread Johann Spies
On 28 April 2014 21:38, Miguel Andrés Moya Rojas
wrote:

Hello! My issue is this: I want to use the autocomplete widget (
> SQLFORM.widgets.autocomplete) but my field is a list:string, and now it
> shows all data in only one field, resulting in an awkward input. How can I
> use this widget with a list:string field? Thanks in advance. :)
>
>
And your code is ...?

Regards
Johann

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

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Bootstrap3 package - help to test

2014-04-30 Thread Rob Goldsmith
Hi - I'm very late to this thread but just wanted to say thank you to Paolo 
... your package massively helped me get up and running quickly on a new 
project without having to hack away at the old code. I'd also be happy to 
contribute via Github if there are areas that need work?

On Monday, 23 December 2013 20:20:48 UTC, Paolo Caruccio wrote:
>
> I just completed a package that applies the bootstrap3 style to some 
> web2py elements - the current version covers the navigation menus, the auth 
> navbar and SQLFORMs (via formstyle) - but I need your help for testing it.
>
> The package includes the following files:
>
>  - bootstrap3.py
>  - web2py-bootstrap3.css
>  - web2py-bootstrap3.js
>  - example of layout.html
>  - a readme file containing the istallation and usage instructions
>  - license (please report if the license is right for a future inclusion 
> in web2py)
>
> Here attached some screenshots and a web2py app with examples. 
>
> Thank you in advance for your feedbacks, suggestions for optimizing the 
> code and any additions and everything else useful to improve the package.
>
> Marry Christmas. 
>
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Removing all tables filter_out. before_inset and before_update works?

2014-04-30 Thread Diogo Munaro
Hey guys! Nowadays I'm using a some filter_outs but they got update and
insert erros on record versioning.

I'm solving update issue using before_update like this:

def remove_filter(s,field):
field_obj = s.query.db[str(s.query).split('.')[0][1:]][field]
field_obj.filter_out = ''

for t in db.tables:
db[t]._before_update.insert(0, lambda s, f: not [remove_filter(s,
field) for field in f])

s.query.db is the returned db;

str(s.query).split('.')[0][1:] is an ugly way to get table name

field is the field_name.

With update I got an ugly solution, but I got a solution. With insert I
can't do it because before_insert don't have a Query object and I can't get
table name

Is there a better way to solve it and remove filter_outs before inserts and
updates?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] auth_user and pool_size?

2014-04-30 Thread Richard Vézina
Yes I use pgAdmin3. I set "migrate=False" on every table and in the
connection string I set "migrate_enabled=False". No fake_migrate... I just
deactivate the migration stuff of web2py.

I didn't read the book about migration for a long time so there is maybe
new way of doing thing... But so far I didn't experiment any issue about
migration.

Richard


On Wed, Apr 30, 2014 at 2:13 AM, Annet  wrote:

> Hi Richard,
>
> Thanks for you reply.
>
> Personally, because I didn't have the control I want on migration, and I
>> don't want to lost data. I don't do that. I update the prod database
>> manually...
>>
>
>
> I've considered this too but wasn't sure about how to proceed. What you do
> is alter your database in the admin tool on the database (pgAdmin3 or
> phpPgAdmin in my case),
> in the connection string set  migrate=False, fake_migrate=True and in the
> table definition set migrate = 'table_name.table'.
>
> Is that correct.
>
> Regards,
>
> Annet
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: GAE: Downloading uploaded images

2014-04-30 Thread Christian Foster Howes
are you storing your images in the datastore or in blobstore, or in google 
cloud storage?  if blobstore you can use 
https://developers.google.com/appengine/docs/python/images/functions#Image_get_serving_url
 
to store a URL that serves it directly from blobstore.


cfh

On Monday, April 28, 2014 3:28:24 PM UTC-7, St. Pirsch wrote:
>
> Hi,
> i am trying to find an efficient way to display images uploaded to GAE.
> Currently, im using the download action:
> * background-image: url({{=URL('download', 
> args=line.contents.vorschaubild)}});*
> Since there are a lot images to display, there should be a less power 
> consuming way to get the image files.
> Is it possible to let GAE directly serve the images, without the web2py 
> download action, like it works for static files?
> Or is it possible to cache the output of the download action?
> Thanks for Your help.
> Stephan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: request.is_local is false?

2014-04-30 Thread Cássio Botaro

>
> Nice explanation Anthony. Thank you.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py conference, next week!

2014-04-30 Thread Richard Vézina
Just one week!!

Is there a way to listen a live stream, hangout something?

Richard


On Mon, Apr 28, 2014 at 8:21 PM, Simon Ashley wrote:

> Wouldn't be adverse to canvassing the idea of a weekend get together
> somewhere along the east coast ...
>
>
> On Saturday, 26 April 2014 19:47:21 UTC+10, Greg Vaughan wrote:
>>
>> Make the next one in Sydney (Australia) Massimo :)
>>
>> Just joking... all the best for it and looking forward to seeing the
>> videos...
>>
>> On Saturday, 26 April 2014 13:08:01 UTC+10, Massimo Di Pierro wrote:
>>>
>>> Please register only if you plan to attend in person. We will record the
>>> talks and post them.
>>>
>>> On Friday, 25 April 2014 16:29:28 UTC-5, David Rager wrote:

 Is there an online option (if you don't tick the "will attend in
 person")?

 On Thursday, April 24, 2014 9:20:56 AM UTC-6, Massimo Di Pierro wrote:
>
> There is one more to the first web2py conference
>
> http://www.experts4solutions.com/web2py_conference
>
> We got a bigger room and we can take 10-15 more people. register now!
>
> Massimo
>
  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Pluralization and styles

2014-04-30 Thread vld...@gmail.com

you can try to use markmin in T for styling. You need to write:

T.M('*%s* %%{result} %%{found}', symbols=num_offers)


29.04.14 21:28, Louis Amon написав(ла):

I'm trying to print something like that in my view :

*31* results found


(notice the bold number)

I used the pluralization engine like this:
T('%s  %%{result} %%{found}', symbols=num_offers)

And it gives the right string but obviously not styled.

Other attempts:
T(XML('%s)' + '  %%{result} %%{found}', 
symbols=num_offers)

T(STRONG('%s')+'  %%{result} %%{found}', symbols=num_offers)
STRONG(num_offers) + T(' %%{result} %%{found}', symbols=num_offers)

None of these are working for me.

What's the right way to do 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+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] auth_user and pool_size?

2014-04-30 Thread Annet
Hi Simone,

are you sure that what you're reporting is exactly what's happening ?
>

That's exactly what I observe and it bothered me because I expected the 
behavior you describe in your reply.
I haven't had this problem for a long time. Both web2py_development and 
web2py_deployment run on my
Mac OS Lion Server, they're both version 2.9.5, the only difference is the 
connection string and the contents
of the databases folder, since they connect to different databases, I 
migrated the models twice. web2py_development
does not have this issue web2py_deployment does.


Regards,

Annet

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Foreign key

2014-04-30 Thread Beat Kohler
 

I am on the way to develop a small purchase requisition application. 
The main idea is: the user select from a list of materials a material 
number and enter the quantity. 
Finally he will confirm his requisition and send it to a external system. 
To create the purchase requisitions I use a simple smartgrid. 
My problem is now that in the requisition table instead of the material 
number only the id of the related table is stored.
Here my definitions:
*db.py*
*- Materials*
db.define_table("MATERIALS",
  Field("MATNR", "string", length=18, notnull=True, 
default=None), and more
*- Purchase requistions*
db.define_table("BANFTEMP",
 Field("Pippo", db.auth_user, default=auth.user_id, writable=False, 
update=auth.user_id),
* Field("MATNR_MATERIALS", db.MATERIALS, default=db.MATERIALS.MATNR, 
update=db.MATERIALS.MATNR)*, . and more
..
db.BANFTEMP.MATNR_MATERIALS.requires=IS_IN_DB(db, db.MATERIALS.id, 
'%(MATNR)s')

*default.py*
 grid = SQLFORM.grid(db.BANFTEMP)

How I can convince WEB2PY to store the MATNR and not the id in 
BANFTEMP.MATNR_MATERIALS ??
Any help is welcome an a free beer offered (if you stay in Switzerland :-) )
Beat

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] REST Unit Testing

2014-04-30 Thread JosuaS
Hello

I found this nice description to do Unit Testing in web2py:
http://www.web2py.com/AlterEgo/default/show/260

In the example a controller function is called like this:
resp = list_active_games()

In my code however there are some REST functions for example:

@request.restful()
def test():
def GET():
return "get"
def POST():
return "post"
return locals()

Do you have any idea how I can unit test (respectively call) such a REST 
function? So far I had no success.

Thank you for you help.

Josua

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Load Balancing with web2py and apache

2014-04-30 Thread Gurumurthy Ramakrishnan
I would like to use Daemon mode of web2py to limit the number of web2py 
instances I run.
I would also like specific web2py instances to serve specific applications.

Something like:


  ServerName example.com
  DocumentRoot /www/example1 

  WSGIDaemonProcess web2py1 user=www-user group=www-group processes=3 
threads=5 \
   display-name=%{GROUP}
  WSGIProcessGroup web2py
  WSGIApplicationGroup %{GLOBAL} 


  WSGIScriptAliasMatch ^(/([^~].*|awstats.*)?)$ 
/var/www/web2py/wsgihandler.py$1

 




  ServerName example.com
  DocumentRoot /www/example2

  WSGIDaemonProcess web2py2 user=www-user group=www-group processes=3 
threads=5 \
   display-name=%{GROUP}
  WSGIProcessGroup project2
  WSGIApplicationGroup %{GLOBAL} 


  WSGIScriptAliasMatch ^(/([^~].*|awstats.*)?)$ 
/var/www/web2py/wsgihandler.py$1


Is this possible?

Thanks,
Guru

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PyCon AU

2014-04-30 Thread Massimo Di Pierro
Hello Simon,

I'd like to attend but it is probably expensive to get there. Are you one 
of the organizers?

Massimo

On Tuesday, 29 April 2014 17:00:07 UTC-5, Simon Ashley wrote:
>
> Anyone interested in attending http://2014.pycon-au.org/ in Brisbane, in 
> August?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Foreign key

2014-04-30 Thread Derek
According to the documentation, you can't. Have you tried using a 
'represent' on the 'materials' table to show the matnr instead of the id?

On Wednesday, April 30, 2014 7:47:30 AM UTC-7, Beat Kohler wrote:
>
> I am on the way to develop a small purchase requisition application. 
> The main idea is: the user select from a list of materials a material 
> number and enter the quantity. 
> Finally he will confirm his requisition and send it to a external system. 
> To create the purchase requisitions I use a simple smartgrid. 
> My problem is now that in the requisition table instead of the material 
> number only the id of the related table is stored.
> Here my definitions:
> *db.py*
> *- Materials*
> db.define_table("MATERIALS",
>   Field("MATNR", "string", length=18, notnull=True, 
> default=None), and more
> *- Purchase requistions*
> db.define_table("BANFTEMP",
>  Field("Pippo", db.auth_user, default=auth.user_id, writable=False, 
> update=auth.user_id),
> * Field("MATNR_MATERIALS", db.MATERIALS, default=db.MATERIALS.MATNR, 
> update=db.MATERIALS.MATNR)*, . and more
> ..
> db.BANFTEMP.MATNR_MATERIALS.requires=IS_IN_DB(db, db.MATERIALS.id, 
> '%(MATNR)s')
>
> *default.py*
>  grid = SQLFORM.grid(db.BANFTEMP)
>
> How I can convince WEB2PY to store the MATNR and not the id in 
> BANFTEMP.MATNR_MATERIALS ??
> Any help is welcome an a free beer offered (if you stay in Switzerland :-) 
> )
> Beat
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] OAuth - Can Users Authenticate without an Internet connection?

2014-04-30 Thread Brando
I want to use OAuth + Google and want to know if things will work if a node 
is offline.  My app model is as follows.


I will have about 15 laptops in the field.
Each laptop will have a local copy of the app installed.
The laptop may/may not have Internet access.
I plan on using Couchbase for the DB
I need to be able to restrict access to a particular user (if they get 
fired or something)

Is it possible to allow people to login even if they don't have Internet 
access?  How would this work?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] OAuth - Can Users Authenticate without an Internet connection?

2014-04-30 Thread Carlos Costa
If each node must authenticate with OAuth with it will requires internet
connection.
Give a look here: https://developers.google.com/accounts/docs/OAuth2


2014-04-30 16:30 GMT-03:00 Brando :

> I want to use OAuth + Google and want to know if things will work if a
> node is offline.  My app model is as follows.
>
>
> I will have about 15 laptops in the field.
> Each laptop will have a local copy of the app installed.
> The laptop may/may not have Internet access.
> I plan on using Couchbase for the DB
> I need to be able to restrict access to a particular user (if they get
> fired or something)
>
> Is it possible to allow people to login even if they don't have Internet
> access?  How would this work?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Att.

Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: request.is_local is false?

2014-04-30 Thread Cássio Botaro
I try to use request.is_local to divide production enviroment and 
development. But with this behaviour, it fail when i go to shell.

Is  ' request.env.remote_addr ' the solution?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLFORM.grid pagination problem

2014-04-30 Thread Elcimar

I have a website that uses SQLFORM.grid. Some (random) times the grid 
starts in page # >1000, >100, etc (random pages) instead of page #1.

I first thought it was because I was using two grids in the same page, but 
now that I am rendering them through LOAD, I don't know what is happening. 
It hapens on other page with only one grid as well =(

Maybe does it have something to do with sessions or something like that?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Foreign key

2014-04-30 Thread 黄祥
please try (not tested) :
Field('MATNR_MATERIALS', 'reference MATERIALS', requires = IS_IN_DB(db, 
db.MATERIALS.id, '%(MATNR)s') )

best regards,
stifan

>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PyCon AU

2014-04-30 Thread Simon Ashley
No, not an organiser, but thinking/ willing to organise some off agenda 
web2py functions for those who are interested
(papers are about to close, so maybe a bit late for something official). 
The main issue where you are is the travelling time (30 hours each way ex 
Chicago), rather than the expense.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: request.is_local is false?

2014-04-30 Thread Anthony
Are you just trying to determine if you're in the shell or not? If so, you 
can do:

if request.env.cmd_options.shell:
print "You're in the shell"

Anthony

On Wednesday, April 30, 2014 5:22:16 PM UTC-4, Cássio Botaro wrote:

> I try to use request.is_local to divide production enviroment and 
> development. But with this behaviour, it fail when i go to shell.
>
> Is  ' request.env.remote_addr ' the solution?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: query DAL

2014-04-30 Thread Joe Barnhart
You could create a view of the table "Situation" which groups by id_person 
and returns max(id_status).  Then you can do a normal join using the view 
to establish the relationship between the other two tables.

You can have a view in web2py by creating the table as normal, but marking 
it as migrate=False.  Then create the view in the database manually to 
match its definition in web2py and you're set.

-- Joe B.


On Monday, April 28, 2014 12:30:50 PM UTC-7, Fernando Vieira wrote:
>
> Guys, I have a problem and can not solve, I'll describe it below 
>
> I have three tables
>
> ##Person##   ##Status##   
>   ##Situation##
> --name----id--  --id----status--   
>   --id_person--  --id_status--   
> fernando  1   1   INICIADO 
>   11 
> ricardo 2   2  ADAMENTO   
> 12 
> evandro3   3  OK   
>  13
> manolo4   4 CANCELADO 
>   21
>   
>24
>
> I need to show the person's name and the last situation, using DAL
> >> fernando - OK 
> >> ricardo --- CANCELADO
> >> evandro --  null
> >> manolo --- null
>
> ---
> with got the query, but id_situation field comes with the first record, 
> and not the last
>
> db(db.person).select(db.person.name, db.situation.id_status, 
> left=db.situation.on((db.person.id 
> ==db.situation.id_person), 
> distinct=db.person.name)
>
> I figured out how to bring the last record >> db(db.situation.id_person == 
> db.person.id 
> ).select().as_list()[-1]['id_status']
>
> Perhaps by combining the queries I would have the result, but I can not
>
> --
>
> If anyone can help me, I'll be grateful
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to redirect an error ticket response to the current url

2014-04-30 Thread aleonserra
Im gonna try to explain it better.

I have an application with a controller that has a function that produces 
an error. ex: myapp/default/index
on routes.py im redirecting the errors to otherapp/default/display_errors
to watch the ticket i have to go to 
"http://localhost:8000/admin/default/ticket/myapp/127.0.0.1.2014-05-01.07-54-28.fad8beec-c539-4243-b7bb-116ce76cc39c";
i would like  otherapp/default/display_errors to return the same response 
as that url

Ive tried many things like, none of them are working very well.
def display_errors():
import urllib
resp = 
urllib.openurl("http://localhost:8000/admin/default/ticket/myapp/127.0.0.1.2014-05-01.07-54-28.fad8beec-c539-4243-b7bb-116ce76cc39c"";)
return resp.read()

it returns the admin login page, does not work.

app = request.application
myversion = request.env.web2py_version
ticket = request.vars.ticket.split("/")[1]
from gluon.restricted import RestrictedError
e = RestrictedError()
e.load(request, app, ticket)

return response.render("default/ticket.html", dict(app=app,
ticket=ticket,
output=e.output,
traceback=(e.traceback,), # and TRACEBACK(e.traceback)),
snapshot=e.snapshot,
code=e.code,
layer=e.layer,
myversion=myversion))




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.