Re: [web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread Akash Agrawall
{} (534, '5.7.14 <
https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtQh\n5.7.14wnWg7iNJ76cQ-TNYHbtQ4Ow5zf3X78ZYd_hWCz-uLz6p26qOHkaLNwiHYAacQbCgpsTo8N\n5.7.14
jovPqLm6zPKwliPF7LV0Ods2eHGtAOyMq6tvuceciSmNFYaNaMF6ZmW3zhB5u4us_dAx0I\n5.7.14
NHzBmG5CGtHpEWBgLHx3NOC35I2gLQUppirDJCz1Eb71V0VrFyDi0pP78TokTAkQmaeswq\n5.7.14
Sv3YLkA> Please log in via your web browser and then try again.\n5.7.14
Learn more at
https://support.google.com/mail/bin/answer.py?answer=787\n5.7.14 54
k3sm18085214yhc.13 - gsmtp')


On Mon, Jan 6, 2014 at 1:26 AM, Alan Etkin  wrote:

> Sorry for late reply man. I checked the same no luck in that... !!
>> :(
>>
>
> Please post the output of mail.result and mail.error after the call to
> .send()
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/CU_1qWYixjI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
akash.wanteds

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


Re: [web2py] routes.py Problem

2014-01-06 Thread Rockiger
Hi Jonathan,

many thanks for the answer:

Here ist mit request object: http://pastie.org/8605943

The URL ist 
http://rockiger.com/de/domainfactory/kontoeroeffnung
.

It seems there is a variable *request.uri_language: de *in that case.

It would be very interesting to know what precisely do this two directives:

 default_language = 'de',
 languages = ['en', 'de'],

Which code in web2py interprets that?

Best,
Marco

-- 
*Rockiger UG (haftungsbeschränkt)*
Marco-Alexander Laspe | Geschäftsführer
Neugasse 3 | 65183 Wiesbaden
Tel: +49 611 9713 9716 | ma...@rockiger.com
---
Registergericht: Amtsgericht Wiesbaden
Registernummer: HRB 25489
---
Jetzt zu haben: Rockiger ThinkPad - Freie Rechner
http://rockiger.com/en/default/index

On Sunday, January 5, 2014 6:02:19 PM UTC+1, Jonathan Lundell wrote:
>
> On 5 Jan 2014, at 8:44 AM, Rockiger > 
> wrote:
>
> Hello together,
>
> I have a problem with routes.py. My goal is it to have a English and a 
> German (de) version of my site:
>
> I have the following code in there:
>
> routers = dict(
> # base router
> BASE = dict(
> default_application = 'rockiger',
> ),
> rockiger = dict(
> default_language = 'de',
> languages = ['en', 'de'],
> map_static = True,
> ),
> )
>
> According to the web2py cookbook there should be  now a request.lang 
> variable, but I can't it. Has anybody a idea what the problem could be?
>
>
> There may be a bug, or there may be a documentation problem.
>
> The example file claims that it's being set in request.language, not 
> request.lang, but as I look at it, I don't see where, and there's no unit 
> test for it.
>
> Would you please dump your entire request object and see if the language 
> shows up anywhere (aside from I guess the original URL)?
>

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


Re: [web2py] Re: Where should I put my application logic code?

2014-01-06 Thread Alex
thanks! that's a good tip. Unfortunately the error still exists:

ImportError: No module named myapp.modules.myapp_room


the file modules/myapp_room.py exists on the server. what else could be 
missing?

Alex

Am Montag, 6. Januar 2014 01:32:09 UTC+1 schrieb 黄祥:
>
> i think it related with module name, try to change your module file name 
> into unique name. i usually use the app name with the controller file name. 
> e.g.
> modules/myapp_mycontroller.py
> of course you can use whatever module file name as you want, but please 
> make it unique.
>
> 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/groups/opt_out.


[web2py] Re: web2py running en AppFog

2014-01-06 Thread José Antonio López Lorenzo
1.- Create an appfog acount in https://www.appfog.com/
2.- Login in
3,- create a python app.
4.- the name of application is, for example, 'NAME_APP' 
(url: http://NAME_APP.eu01.aws.af.cm/)
5.- in local install 'af' (gem install af) 
6.- af login
7.- modify wsgi.py:
Introducir código aquí...#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro 
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)


This is a WSGI handler for Apache
Requires apache+mod_wsgi.

In httpd.conf put something like:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /path/to/wsgihandler.py

"""

# change these parameters as required
DEV = False
if DEV:
LOGGING = True
PASS = 'your_local_pass'
PORT=  8000
else:
LOGGING = False
PASS = 'your_remote_pass'
PORT=  80
SOFTCRON = False

import sys
import os

path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
sys.path = [path] + [p for p in sys.path if not p == path]

sys.stdout = sys.stderr

import gluon.main

if LOGGING:
application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
logfilename='httpserver.log',
profilerfilename=None)
else:
application = gluon.main.wsgibase

if SOFTCRON:
from gluon.settings import global_settings
global_settings.web2py_crontype = 'soft'

from gluon.main import save_password
save_password(PASS,PORT)



7.- in your web2py local folder command af update 'name_app'
8.- wait
9.- visit http://NAME_APP.eu01.aws.af.cm/

excuse me for my english

El sábado, 4 de enero de 2014 08:41:13 UTC+1, webpypy escribió:
>
>
> Hi,
>
> Please, translate this
>
> EXPLANATION: http://jallander.wordpress.com/2014/01/03/web2py-en-appfog/
>>>
>>>
> to English.
>
> Regards,
>
> Ashraf 
>

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


Re: [web2py] Re: Where should I put my application logic code?

2014-01-06 Thread 黄祥
it's hard to help you track the error. please try to create the module from 
simple like in the book. e.g.
*/test/modules/justforlearn.py*
from gluon import *
def ip(): return current.request.client

*/test/controllers/default.py*
from gluon.custom_import import track_changes; track_changes(True)
import justforlearn
def index():
return "Your ip is " + justforlearn.ip()

what did you get?
if not please show your code.

p.s.
from gluon.custom_import import track_changes; track_changes(True) is not 
recommended on production because of overhead, 
if you not use from gluon.custom_import import track_changes; 
track_changes(True), please try to restart the web2py to take effect the 
change you made.

ref:
https://groups.google.com/forum/#!topic/web2py/tdyEQ7CJhmE

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


Re: [web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread Tim Richardson
Gmail probably requires a secure connection so your tls setting may be wrong

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


Re: [web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread 黄祥
please try this on your models.

mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587' or 'logging'
mail.settings.sender = 'em...@gmail.com'
mail.settings.login = 'em...@gmail.com:password'

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


Re: [web2py] Re: Inserting to db from module. Why do I need to keep restarting Web2py?

2014-01-06 Thread Richard Vézina
There is chance that it still broken...

If you have put the track changes line in your model, it should work if you
don't have access to the mods you have made to your module, it because it
still broken...

There is many post on the list about this issue.

Since I am still using 2.4.7 and can't say for sure if it still the case
with the last stable.

Richard


On Sat, Jan 4, 2014 at 5:40 PM, Brando  wrote:

> Richard, is this feature unreliable at this point or am i using it
> incorrectly?
>
>
>
>
> On Friday, January 3, 2014 12:54:12 PM UTC-8, Brando wrote:
>>
>> Version
>>>
>>> 2.8.2-stable+timestamp.2013.11.28.13.54.07
>>> (Running on Rocket 1.2.6, Python 2.7.3)
>>>
>>
>>
>>
>>
>>
>> Also, I doubt it's relevant, but I'm using Sublime Text as my IDE.
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: [web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread Akash Agrawall
Still same error. it's too urgent for me
you didn't mention anything about mail.settings.tls...
I tried all three combinations
1. commenting it out
2. keeping it false
3. keeping it true

still same output (a flash message showing "unable to send mail")


On Mon, Jan 6, 2014 at 7:55 PM, 黄祥  wrote:

> please try this on your models.
>
> mail = auth.settings.mailer
> mail.settings.server = 'smtp.gmail.com:587' or 'logging'
> mail.settings.sender = 'em...@gmail.com'
> mail.settings.login = 'em...@gmail.com:password'
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/CU_1qWYixjI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
akash.wanteds

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


Re: [web2py] routes.py Problem

2014-01-06 Thread Jonathan Lundell
On 6 Jan 2014, at 1:17 AM, Rockiger  wrote:
> Hi Jonathan,
> 
> many thanks for the answer:
> 
> Here ist mit request object: http://pastie.org/8605943
> 
> The URL ist http://rockiger.com/de/domainfactory/kontoeroeffnung.
> 
> It seems there is a variable request.uri_language: de in that case.
> 
> It would be very interesting to know what precisely do this two directives:
>>  default_language = 'de',
>>  languages = ['en', 'de'],
> Which code in web2py interprets that?
> 

Thanks for following up. It appears that both the cookbook and the example file 
are incorrect. Here's the corrected text from the examples file; I'll send a 
patch now. I've also added a note on how to integrate the incoming language 
with the T() operator.

#  languages: list of all supported languages
#   Names in languages are always treated as language names when they 
appear in an incoming URL after
#   the (optional) application name.
#  default_language
#   The language code (for example: en, it-it) optionally appears in the 
URL following
#   the application (which may be omitted). For incoming URLs, the code is 
copied to
#   request.uri_language; for outgoing URLs it is taken from 
request.uri_language.
#   If languages=None, language support is disabled.
#   The default_language, if any, is omitted from the URL.
#   To use the incoming language in your application, add this line to one 
of your models files:
#   if request.uri_language: T.force(request.uri_language)

As to your question: the code is in gluon.rewrite, specifically in the classes 
MapUrlIn and MapUrlOut.

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


[web2py] How to format rows in a grid in SQLFORM.grid?

2014-01-06 Thread Omar Meat Boy Gutiérrez

I am using SQLFORM.grid. I'd like to classify data with colors, for example:


| If data in first row is type A|  I'd apply the green 
color to row.   |
-
| If data in second row is type B   | I'd apply the red color 
to row.|
-
And so on.

I am using the advice explained in other questions:

customized = myformat(grid.rows)
grid.element('.web2py_table', replace=customized)

Where my customize function is:

def myformat(rows):
#import gluon
#nuevo = gluon.dal.Rows()
new = DIV()
for i in rows:
if i.account.startswith('A'):
# in this section I need to paint the row in green
i.account = ('' + i.account + ''
) #my try
elif i.account.startswith('B'):
# in this section I need to paint the row in red
i.account = ('' + i.account + '')#my 
try
new.insert(0, i) 
return new

However I am getting only string data:

A}> B}>

I don't know what kind of value I must return from myformat function. Rows 
or DIV. Which way should I go?




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


[web2py] widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, _style='ul')

2014-01-06 Thread Annet
In my table definition I have the following field:


Field('title', length=3, requires=IS_IN_SET(['Mr', 'Mrs', 'Ms'], 
error_message='Selecta title'), widget=lambda k,v: 
SQLFORM.widgets.radio.widget(k, v, _style='ul')),


In a form the radio buttons are still rendered in a table, why?


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


[web2py] Re: Change auth.wiki _create form

2014-01-06 Thread Dave S
On Sunday, January 5, 2014 7:57:54 AM UTC-8, Ezer Silva wrote:
>
> Well, the solution was much simpler, just put these lines in db.py:
>
> auth.wiki(resolve=False)
> db.wiki_page.body.widget = advanced_editor
>

:-)

/dps
 

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


[web2py] Re: cpdb from sqlite to postgresql

2014-01-06 Thread Dave S
See below:


On Sunday, January 5, 2014 12:32:26 PM UTC-8, mweissen wrote:
>
>
> I want to change from sqlite to postgresql.
>
> At first I have installed postgresql and prepared everything as described 
> in the book. Next I have built a sample application
>  with a line like
>
> db1 = DAL("postgres://web2py:web2py123@localhost:5432/securedb")
>
> Works fine!
>
> Now I have tried cpdb ( I have broken the lines for better readablity):
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py  
> -f applications/postgesql_test/databases 
> -y sqlite://storage.sqlite 
> -Y postgres://web2py:web2py123@localhost:5432/securedb 
> -d gluon/ 
> -t False
>
> The result is an error message:
>
> EXCEPTION: could not make a copy of the database
> Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "gluon/dal.py", line 7766, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "gluon/dal.py", line 2756, in __init__
> if do_connect: self.find_driver(adapter_args,uri)
>   File "gluon/dal.py", line 795, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('psycopg2', 'pg8000')
>
> Next try - a copy from sqlite to sqlite
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py
>-f applications/postgresql_test/databases 
>-y sqlite://storage.sqlite 
>-Y sqlite://storage2.sqlite 
>-F applications/postgresql_test/databases 
>-d gluon/ -t False
>
> creating tables...
> exporting data...
> importing data...
> done!
>
> Ok, no problem - cpdb works.
> And now the interactive version:
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py  
>-f applications/postgresql_test/databases 
>-y sqlite://storage.sqlite 
>-Y postgres://web2py:web2py123@localhost:5432/securedb 
>-d gluon/ -t False -i
>
> >>> t=DAL("postgres://web2yp:web2py123@localhost:5432/securedb", 
> folder=None)
> sorry, can not do that!
> Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "gluon/dal.py", line 7766, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "gluon/dal.py", line 2756, in __init__
> if do_connect: self.find_driver(adapter_args,uri)
>   File "gluon/dal.py", line 795, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('psycopg2', 'pg8000')
>
>
> I have tried DAL calls like DAL("postgres:psycopg2:") and 
> DAL("postgres:pg8000:") - similar results.
>
>
Did you copy the driver  into the working directory?  Recent versions of 
web2py ship with the handlers in a subdirectory (web2py/handlers), so they 
don't clobber any changes you made the last time you set them up.

/dps

 

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


[web2py] Re: How to format rows in a grid in SQLFORM.grid?

2014-01-06 Thread Omar Meat Boy Gutiérrez
My new approach is use TABLE() helper with TR() and TD(). However I lost my 
header! I need this because sometimes is useful for the user order table by 
items.  Suggestions?



def myformat(rows):
#import gluon
#nuevo = gluon.dal.Rows()
new = TABLE()
for i in rows:
if i.account.startswith('A'):
row = TR(TD(i.account), TD(i.concept), _class='green')
new.append(row)
elif i.account.startswith('B'):
row = TR(TD(i.account), TD(i.concept), _class='orange')
new.append(row)
else:
row = TR(TD(i.account), TD(i.concept), _class='blue')
new.append(row)
return new




On Monday, January 6, 2014 10:22:00 AM UTC-6, Omar Meat Boy Gutiérrez wrote:
>
>
> I am using SQLFORM.grid. I'd like to classify data with colors, for 
> example:
>
> 
> | If data in first row is type A|  I'd apply the 
> green color to row.   |
>
> -
> | If data in second row is type B   | I'd apply the red color 
> to row.|
>
> -
> And so on.
>
> I am using the advice explained in other questions:
>
> customized = myformat(grid.rows)
> grid.element('.web2py_table', replace=customized)
>
> Where my customize function is:
>
> def myformat(rows):
> #import gluon
> #nuevo = gluon.dal.Rows()
> new = DIV()
> for i in rows:
> if i.account.startswith('A'):
> # in this section I need to paint the row in green
> i.account = ('' + i.account + 
> '') #my try
> elif i.account.startswith('B'):
> # in this section I need to paint the row in red
> i.account = ('' + i.account + ''
> ) #my try
> new.insert(0, i) 
> return new
>
> However I am getting only string data:
>
> A}>  style="color:red;">B}>
>
> I don't know what kind of value I must return from myformat function. Rows 
> or DIV. Which way should I go?
>
>
>
>
>

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


Re: [web2py] widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, _style='ul')

2014-01-06 Thread Richard Vézina
Could it be possible that the keyword is not _style, but style?

Richard


On Mon, Jan 6, 2014 at 12:49 PM, Annet  wrote:

> In my table definition I have the following field:
>
>
> Field('title', length=3, requires=IS_IN_SET(['Mr', 'Mrs', 'Ms'],
> error_message='Selecta title'), widget=lambda k,v:
> SQLFORM.widgets.radio.widget(k, v, _style='ul')),
>
>
> In a form the radio buttons are still rendered in a table, why?
>
>
> Kind 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/groups/opt_out.
>

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


[web2py] styling widget divs

2014-01-06 Thread Annet
I have the following field definition in a table:

Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),

I would like to style the radio widget, but adding _class='radio' to the 
widget function does not add a class attribute to the divs.
Is there a way to add this class?

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


Re: [web2py] styling widget divs

2014-01-06 Thread Richard Vézina
You can try this :

**{'_class': 'radio'}

As a kargs...

Richard


On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:

> I have the following field definition in a table:
>
> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']),
> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>
> I would like to style the radio widget, but adding _class='radio' to the
> widget function does not add a class attribute to the divs.
> Is there a way to add this class?
>
> Kind 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/groups/opt_out.
>

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


[web2py] Re: Virtual Field and sqlform.grid

2014-01-06 Thread sunny
I think, you need to delete the old session files of your application.
I had the same problem.

Am Mittwoch, 20. November 2013 19:26:23 UTC+1 schrieb Eduardo Cruz:
>
> Whe I use a table that has some a virtual field sqlform.grid does not works
>
>  'Row' object has no attribute 'unknown'
>
> and that happens only when the virtual field is uncommented
>
> def get_category_list(post):
> category_id_list =  db(db.Post_in_category.post_id == post.id).select(
> db.Post_in_category.category_id)
> category_list = []
> for category_id in category_id_list:
> category_list.append(db.Category[category_id["category_id"]])
> return category_list
>
> db.Post.category_list = Field.Virtual(
> lambda row: get_category_list(row.Post)
> )
>
>
>
> what am I doing wrong?
>
>

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


Re: [web2py] styling widget divs

2014-01-06 Thread Richard Vézina
Or you will have to create a custom widget... You can grab the radio.widget
in /gluon/sqlhtml.py ans search for RadioWidget class...

You can turn it into a method with the help of the book.

But the kargs above should work as far as I can see look at the code of the
RadioWidget...

Richard


On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina
wrote:

> You can try this :
>
> **{'_class': 'radio'}
>
> As a kargs...
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:
>
>> I have the following field definition in a table:
>>
>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']),
>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>>
>> I would like to style the radio widget, but adding _class='radio' to the
>> widget function does not add a class attribute to the divs.
>> Is there a way to add this class?
>>
>> Kind 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/groups/opt_out.
>>
>
>

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


[web2py] Re: Virtual Field and sqlform.grid

2014-01-06 Thread sunny
Field.Virtual has a name attribute which has to be set:

db.Post.category_list = Field.Virtual( 'category_list', lambda row:
 get_category_list(row.Post) )


Am Mittwoch, 20. November 2013 19:26:23 UTC+1 schrieb Eduardo Cruz:
>
> Whe I use a table that has some a virtual field sqlform.grid does not works
>
>  'Row' object has no attribute 'unknown'
>
> and that happens only when the virtual field is uncommented
>
> def get_category_list(post):
> category_id_list =  db(db.Post_in_category.post_id == post.id).select(
> db.Post_in_category.category_id)
> category_list = []
> for category_id in category_id_list:
> category_list.append(db.Category[category_id["category_id"]])
> return category_list
>
> db.Post.category_list = Field.Virtual(
> lambda row: get_category_list(row.Post)
> )
>
>
>
> what am I doing wrong?
>
>

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


Re: [web2py] Why web2py and AnguljarJS?

2014-01-06 Thread Richard Vézina
Angular client side programming, web2py server side programming.

Angular less bandwidth, web2py more bandwidth

But you can easily transform web2py to only serve the data through JSON...

Richard


On Sun, Jan 5, 2014 at 8:22 PM, António Ramos  wrote:

> I´m using angular recently and for UI Experience its something out of this
> world. Well, almost ...  :)
>
> With angular its very easy to recalc every dom element without goind to
> the server and refresh the page.
> Without angular you have to code a lot more with plain javascript or using
> ajax to tell the server to do the dirty work.
>
> I prefer the angular way.
>
>
>
>
>
>
> 2014/1/5 Ruud Schroen 
>
>> I see more and more about using angularjs with web2py.
>>
>> But why? What would be an example of a benefit from using those two.
>> Cause when i look at AngularJS, it already looks alot like web2py.
>>
>> Not saying that it's a bad idea, just wondering ;)
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: [web2py] widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, _style='ul')

2014-01-06 Thread Anthony
Indeed, the keyword is "style", not "_style".

Anthony

On Monday, January 6, 2014 1:46:28 PM UTC-5, Richard wrote:
>
> Could it be possible that the keyword is not _style, but style?
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 12:49 PM, Annet 
> > wrote:
>
>> In my table definition I have the following field:
>>
>>
>> Field('title', length=3, requires=IS_IN_SET(['Mr', 'Mrs', 'Ms'], 
>> error_message='Selecta title'), widget=lambda k,v: 
>> SQLFORM.widgets.radio.widget(k, v, _style='ul')),
>>
>>
>> In a form the radio buttons are still rendered in a table, why?
>>
>>
>> Kind 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

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


[web2py] Need more than one value to unpack

2014-01-06 Thread Akash Agrawall
I am getting this error:
"Need more than one value to unpack"

*db.py:*
class IS_CATEGORYIT(object):
def __init__(self, error_message="Zip code not allowed"):
self.error_message = error
def __call__(self, value):
error = None
print len(value)
if len(value)==0:
error = self.error_message
return (value, error)
db.define_table('book',
db.Field('Name','string'),
db.Field('Category','string',requires=IS_CATEGORYIT),
db.Field('Quantity','integer'),
db.Field('ISBN','string',unique=True),
db.Field('Age_group','list:string', 
requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),

db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
db.Field('Description','text'),
db.Field('Image','upload',uploadfield='picture_file'),
db.Field('picture_file','blob'),
db.Field('Available','integer'),
db.Field('Author','string'),
db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(

db.book.Description.widget= lambda field,value: 
SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message="cannot
 
be empty")
db.book.Category.widget= lambda field,value: 
SQLFORM.widgets.checkboxes.widget(field,value)

*controller: default.py*
def add_book():
form1=SQLFORM(db.book)
form1.add_button('Cancel', URL('add_book'))
if form1.accepts(request.vars,session):
response.flash="Book Inserted"
elif form1.errors:
response.flash="Errors in form"
return dict(form1=form1)

*view:add_book.html*
{{=form1.custom.begin}}

Name *: 
{{=form1.custom.widget.Name}}
 Quantity *: 
{{=form1.custom.widget.Quantity}}
Available *: 
{{=form1.custom.widget.Available}}
ISBN *: 
{{=form1.custom.widget.ISBN}}
Entry Date *: 
{{=form1.custom.widget.entry_date}}

 
Category*:   

{{=form1.custom.widget.Category[0]}}
{{=form1.custom.widget.Category[1]}}
{{=form1.custom.widget.Category[3]}}
{{=form1.custom.widget.Category[4]}}
{{=form1.custom.widget.Category[5]}}
{{=form1.custom.widget.Category[2]}}

 

Age Group *: 
{{=form1.custom.widget.Age_group}}
Author: 
{{=form1.custom.widget.Author}}
Amazon Link: 
{{=form1.custom.widget.Link}}
Description: 
{{=form1.custom.widget.Description}}
Image: 
{{=form1.custom.widget.Image}}
{{=form1.custom.submit}}   {{=form1[0][11][1][1]}}

{{=form1.custom.end}}

Please hava look at this. need reply to this. ASAP. thanx in 
advance

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


[web2py] Re: Need more than one value to unpack

2014-01-06 Thread Dave S
On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:
>
> I am getting this error:
> "Need more than one value to unpack"
>
>
Can you tell us which line the error message is referencing?  Is there a 
traceback in the ticket?

/dps


 

> *db.py:*
> class IS_CATEGORYIT(object):
> def __init__(self, error_message="Zip code not allowed"):
> self.error_message = error
> def __call__(self, value):
> error = None
> print len(value)
> if len(value)==0:
> error = self.error_message
> return (value, error)
> db.define_table('book',
> db.Field('Name','string'),
> db.Field('Category','string',requires=IS_CATEGORYIT),
> db.Field('Quantity','integer'),
> db.Field('ISBN','string',unique=True),
> db.Field('Age_group','list:string', 
> requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
> 
> db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
> db.Field('Description','text'),
> db.Field('Image','upload',uploadfield='picture_file'),
> db.Field('picture_file','blob'),
> db.Field('Available','integer'),
> db.Field('Author','string'),
> db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(
>
> db.book.Description.widget= lambda field,value: 
> SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
> db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
> adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message="cannot
>  
> be empty")
> db.book.Category.widget= lambda field,value: 
> SQLFORM.widgets.checkboxes.widget(field,value)
>
> *controller: default.py*
> def add_book():
> form1=SQLFORM(db.book)
> form1.add_button('Cancel', URL('add_book'))
> if form1.accepts(request.vars,session):
> response.flash="Book Inserted"
> elif form1.errors:
> response.flash="Errors in form"
> return dict(form1=form1)
>
> *view:add_book.html*
> {{=form1.custom.begin}}
> 
> Name  style="color:red;">*: {{=form1.custom.widget.Name
> }}
>  Quantity *: 
> {{=form1.custom.widget.Quantity}}
> Available  style="color:red;">*: 
> {{=form1.custom.widget.Available}}
> ISBN *: 
> {{=form1.custom.widget.ISBN}}
> Entry Date  style="color:red;">*: 
> {{=form1.custom.widget.entry_date}}
> 
>  
> Category style="color:red;">*:   
> 
>  class="checkbox inline">{{=form1.custom.widget.Category[0]}}
>  class="checkbox 
> inline">{{=form1.custom.widget.Category[1]}}
>  class="checkbox inline">{{=form1.custom.widget.Category[3]}}
> {{=form1.custom.widget.Category[4]}}
>  class="checkbox inline">{{=form1.custom.widget.Category[5]}}
>  class="checkbox inline">{{=form1.custom.widget.Category[2]}}
> 
>  
> 
> Age Group  style="color:red;">*: 
> {{=form1.custom.widget.Age_group}}
> Author: 
> {{=form1.custom.widget.Author}}
> Amazon Link: 
> {{=form1.custom.widget.Link}}
> Description: 
> {{=form1.custom.widget.Description}}
> Image: 
> {{=form1.custom.widget.Image}}
>  style="width:45%">{{=form1.custom.submit}}   {{=form1[0][11][1][1]}}
> 
> {{=form1.custom.end}}
>
> Please hava look at this. need reply to this. ASAP. thanx in 
> advance
>
>

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


Re: [web2py] styling widget divs

2014-01-06 Thread Paolo Caruccio
The radiowidget function returns 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L384

parent(*opts, **attr)

so the kargs solution of Richard works but not when style is 'divs' because 
the parent is 'CAT' 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366

The same happens for the checkboxeswidget.

Some time ago I opened an issue on this matter (
https://code.google.com/p/web2py/issues/detail?id=1821) but only the first 
problem was corrected. 
Maybe we should open another issue ticket. What do you think?


Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>
> Or you will have to create a custom widget... You can grab the 
> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>
> You can turn it into a method with the help of the book.
>
> But the kargs above should work as far as I can see look at the code of 
> the RadioWidget...
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina 
> 
> > wrote:
>
>> You can try this :
>>
>> **{'_class': 'radio'}
>>
>> As a kargs...
>>
>> Richard
>>
>>
>> On Mon, Jan 6, 2014 at 1:53 PM, Annet 
>> > wrote:
>>
>>> I have the following field definition in a table:
>>>
>>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
>>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>>>
>>> I would like to style the radio widget, but adding _class='radio' to the 
>>> widget function does not add a class attribute to the divs.
>>> Is there a way to add this class?
>>>
>>> Kind 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+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>

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


Re: [web2py] styling widget divs

2014-01-06 Thread Richard Vézina
Could the CAT just be replaced by another DIV?

Richard


On Mon, Jan 6, 2014 at 3:56 PM, Paolo Caruccio
wrote:

> The radiowidget function returns
> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L384
>
> parent(*opts, **attr)
>
> so the kargs solution of Richard works but not when style is 'divs'
> because the parent is 'CAT'
> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and
> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366
>
> The same happens for the checkboxeswidget.
>
> Some time ago I opened an issue on this matter (
> https://code.google.com/p/web2py/issues/detail?id=1821) but only the
> first problem was corrected.
> Maybe we should open another issue ticket. What do you think?
>
>
> Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>>
>> Or you will have to create a custom widget... You can grab the
>> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>>
>> You can turn it into a method with the help of the book.
>>
>> But the kargs above should work as far as I can see look at the code of
>> the RadioWidget...
>>
>> Richard
>>
>>
>> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina wrote:
>>
>>> You can try this :
>>>
>>> **{'_class': 'radio'}
>>>
>>> As a kargs...
>>>
>>> Richard
>>>
>>>
>>> On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:
>>>
 I have the following field definition in a table:

 Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']),
 widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),

 I would like to style the radio widget, but adding _class='radio' to
 the widget function does not add a class attribute to the divs.
 Is there a way to add this class?

 Kind 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+un...@googlegroups.com.

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

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

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


[web2py] Re: Why web2py and AnguljarJS?

2014-01-06 Thread Simon Ashley

>
> One point of view and YMMV. It depends on your application. You can build 
> very effective one page apps (typically the domain of client side tools) 
> with standard w2p components (.js, jquery). After all it's a framework 
> using a mix of tools. One can argue that w2p has broader scope, is more 
> homogeneous and handles back ends more effectively than Angular by itself. 
> Its also a eclectic environment for integration with other tools. Front 
> end jquery becomes verbose when you start to push it. At that point you can 
> start introducing angular's methods. Any developer needs multiple tools and 
> the ability to select different ones depending on the needs. 
>

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


[web2py] !! NEW ADMIN !!

2014-01-06 Thread samuel bonill
Admin Plus(A-Plus) is a web2py plugin that provides an easy-to-use 
interface for managing your data

link: https://github.com/pyner/admin_plus

install

1. Download and install the plugin
2. go to "127.0.0.1:8000//plugin_admin_plus/install"
 3. Get the permissions " plugin_admin_plus_superuser " in 
"127.0.0.1:8000//appadmin/insert/db/auth_membership"
4. !! ready! Now you can log in...  " 
127.0.0.1:8000//plugin_admin_plus/index"

NOTE:  is  replaced by the name of your application

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


Re: [web2py] styling widget divs

2014-01-06 Thread Paolo Caruccio
That was the solution I proposed.

Il giorno lunedì 6 gennaio 2014 22:10:04 UTC+1, Richard ha scritto:
>
> Could the CAT just be replaced by another DIV?
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 3:56 PM, Paolo Caruccio 
> 
> > wrote:
>
>> The radiowidget function returns 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L384
>>
>> parent(*opts, **attr)
>>
>> so the kargs solution of Richard works but not when style is 'divs' 
>> because the parent is 'CAT' 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366
>>
>> The same happens for the checkboxeswidget.
>>
>> Some time ago I opened an issue on this matter (
>> https://code.google.com/p/web2py/issues/detail?id=1821) but only the 
>> first problem was corrected. 
>> Maybe we should open another issue ticket. What do you think?
>>
>>
>> Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>>>
>>> Or you will have to create a custom widget... You can grab the 
>>> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>>>
>>> You can turn it into a method with the help of the book.
>>>
>>> But the kargs above should work as far as I can see look at the code of 
>>> the RadioWidget...
>>>
>>> Richard
>>>
>>>
>>> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina wrote:
>>>
 You can try this :

 **{'_class': 'radio'}

 As a kargs...

 Richard


 On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:

> I have the following field definition in a table:
>
> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>
> I would like to style the radio widget, but adding _class='radio' to 
> the widget function does not add a class attribute to the divs.
> Is there a way to add this class?
>
> Kind 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+un...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>


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

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


Re: [web2py] styling widget divs

2014-01-06 Thread Richard Vézina
Ok, seems like a easy one, why not just commit the change on github?

:)

Richard


On Mon, Jan 6, 2014 at 4:22 PM, Paolo Caruccio
wrote:

> That was the solution I proposed.
>
> Il giorno lunedì 6 gennaio 2014 22:10:04 UTC+1, Richard ha scritto:
>>
>> Could the CAT just be replaced by another DIV?
>>
>> Richard
>>
>>
>> On Mon, Jan 6, 2014 at 3:56 PM, Paolo Caruccio wrote:
>>
>>> The radiowidget function returns https://github.com/
>>> web2py/web2py/blob/master/gluon/sqlhtml.py#L384
>>>
>>> parent(*opts, **attr)
>>>
>>> so the kargs solution of Richard works but not when style is 'divs'
>>> because the parent is 'CAT' https://github.com/
>>> web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and http
>>> s://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366
>>>
>>> The same happens for the checkboxeswidget.
>>>
>>> Some time ago I opened an issue on this matter (
>>> https://code.google.com/p/web2py/issues/detail?id=1821) but only the
>>> first problem was corrected.
>>> Maybe we should open another issue ticket. What do you think?
>>>
>>>
>>> Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:

 Or you will have to create a custom widget... You can grab the
 radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...

 You can turn it into a method with the help of the book.

 But the kargs above should work as far as I can see look at the code of
 the RadioWidget...

 Richard


 On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina 
 wrote:

> You can try this :
>
> **{'_class': 'radio'}
>
> As a kargs...
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:
>
>> I have the following field definition in a table:
>>
>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']),
>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>>
>> I would like to style the radio widget, but adding _class='radio' to
>> the widget function does not add a class attribute to the divs.
>> Is there a way to add this class?
>>
>> Kind 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+un...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
  --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: [web2py] !! NEW ADMIN !!

2014-01-06 Thread Richard Vézina
Nice!

Richard


On Mon, Jan 6, 2014 at 4:19 PM, samuel bonill  wrote:

> Admin Plus(A-Plus) is a web2py plugin that provides an easy-to-use
> interface for managing your data
>
> link: https://github.com/pyner/admin_plus
>
> install
>
> 1. Download and install the plugin
> 2. go to "127.0.0.1:8000//plugin_admin_plus/install"
>  3. Get the permissions " plugin_admin_plus_superuser " in "
> 127.0.0.1:8000//appadmin/insert/db/auth_membership"
> 4. !! ready! Now you can log in...  " 127.0.0.1:8000/
> /plugin_admin_plus/index"
>
> NOTE:  is  replaced by the name of your application
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


[web2py] Re: Need more than one value to unpack

2014-01-06 Thread Anthony
Yes, please provide more detail.

Also, requires=IS_CATEGORYIT should be requires=IS_CATEGORYIT().

Anthony

On Monday, January 6, 2014 3:41:35 PM UTC-5, Dave S wrote:
>
> On Monday, January 6, 2014 12:32:01 PM UTC-8, Akash Agrawall wrote:
>>
>> I am getting this error:
>> "Need more than one value to unpack"
>>
>>
> Can you tell us which line the error message is referencing?  Is there a 
> traceback in the ticket?
>
> /dps
>
>
>  
>
>> *db.py:*
>> class IS_CATEGORYIT(object):
>> def __init__(self, error_message="Zip code not allowed"):
>> self.error_message = error
>> def __call__(self, value):
>> error = None
>> print len(value)
>> if len(value)==0:
>> error = self.error_message
>> return (value, error)
>> db.define_table('book',
>> db.Field('Name','string'),
>> db.Field('Category','string',requires=IS_CATEGORYIT),
>> db.Field('Quantity','integer'),
>> db.Field('ISBN','string',unique=True),
>> db.Field('Age_group','list:string', 
>> requires=IS_IN_SET(['1-4','5-8','9-12','13-17'])),
>> 
>> db.Field('entry_date','date',default=datetime.date.today(),requires=IS_DATE(format=('%d-%m-%Y'))),
>> db.Field('Description','text'),
>> db.Field('Image','upload',uploadfield='picture_file'),
>> db.Field('picture_file','blob'),
>> db.Field('Available','integer'),
>> db.Field('Author','string'),
>> db.Field('Link','string',requires=IS_EMPTY_OR(IS_URL(
>>
>> db.book.Description.widget= lambda field,value: 
>> SQLFORM.widgets.text.widget(field,value,_style='width:400px',_rows=5)
>> db.book.Category.requires=IS_IN_SET(['ficton','non-fiction','action and 
>> adventure','travel','biography','story'],multiple=True,zero=None),IS_NOT_EMPTY(error_message="cannot
>>  
>> be empty")
>> db.book.Category.widget= lambda field,value: 
>> SQLFORM.widgets.checkboxes.widget(field,value)
>>
>> *controller: default.py*
>> def add_book():
>> form1=SQLFORM(db.book)
>> form1.add_button('Cancel', URL('add_book'))
>> if form1.accepts(request.vars,session):
>> response.flash="Book Inserted"
>> elif form1.errors:
>> response.flash="Errors in form"
>> return dict(form1=form1)
>>
>> *view:add_book.html*
>> {{=form1.custom.begin}}
>> 
>> Name > style="color:red;">*: {{=form1.custom.widget.Name
>> }}
>>  Quantity *: 
>> {{=form1.custom.widget.Quantity}}
>> Available > style="color:red;">*: 
>> {{=form1.custom.widget.Available}}
>> ISBN *: 
>> {{=form1.custom.widget.ISBN}}
>> Entry Date > style="color:red;">*: 
>> {{=form1.custom.widget.entry_date}}
>> 
>>  
>> Category> style="color:red;">*:   
>> 
>> > class="checkbox inline">{{=form1.custom.widget.Category[0]}}
>> > class="checkbox 
>> inline">{{=form1.custom.widget.Category[1]}}
>> > class="checkbox inline">{{=form1.custom.widget.Category[3]}}
>> {{=form1.custom.widget.Category[4]}}
>> > class="checkbox inline">{{=form1.custom.widget.Category[5]}}
>> > class="checkbox inline">{{=form1.custom.widget.Category[2]}}
>> 
>>  
>> 
>> Age Group > style="color:red;">*: 
>> {{=form1.custom.widget.Age_group}}
>> Author: 
>> {{=form1.custom.widget.Author}}
>> Amazon Link: 
>> {{=form1.custom.widget.Link}}
>> Description: 
>> {{=form1.custom.widget.Description}}
>> Image: 
>> {{=form1.custom.widget.Image}}
>> > style="width:45%">{{=form1.custom.submit}}   {{=form1[0][11][1][1]}}
>> 
>> {{=form1.custom.end}}
>>
>> Please hava look at this. need reply to this. ASAP. thanx in 
>> advance
>>
>>

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


[web2py] outer join? i guess

2014-01-06 Thread lucas
hey everyone,

ok i have a table of companies:

db.define_table('companys',
Field('company_name', length=128, requires=NE, comment='Legal Name of 
the Company or Entity.'),
etc...)

and the auth_user table with the added field:

db.define_table(
auth.settings.table_user_name,
...
Field('company_id', db.companys, requires=IS_EMPTY_OR(IS_IN_DB(db, 
db.companys.id, '%(company_name)s %(telephone)s %(zip)s')), writable=False, 
readable=False),
etc...)

i would like a join that selects the company of the auth.user_id and any 
company that doesn't have a user associated to it at all, i.e., 
company_id==None.  i thought this was just a simple outer join, like

tUser = db.auth_user
tCmp = db.companys
db().select(tUser.id, tUser.email, tCmp.ALL, orderby=tCmp.company_name, 
left=tUser.on((tCmp.id==tUser.company_id) & (tUser.id==auth.user.id)))

but i get those companies that also have a company_id, it just Nones the 
tUser fields.

so i tried many many variations to try and get the right return, but i am 
out of ideas.

i also found that this returns a different result then the above:
db(tCmp.id>0).select(tUser.id, tUser.email, tCmp.ALL, 
orderby=tCmp.company_name, left=tUser.on((tCmp.id==tUser.company_id) & 
(tUser.id==auth.user.id)))
but why?

anyway, if anyone could help me get the right select statement, i would be 
grateful, thanx in advance.  lucas

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


[web2py] Re: need help for rewrite on routes.py

2014-01-06 Thread galoshes
Hello, I would like to revive this older thread (which also relates to this 
one: https://groups.google.com/forum/#!topic/web2py/ff1syTIl12o).

I'm new to web2py, and so far have been finding my way around ok (thanks to 
the excellent docs), but the particular problem of mapping controllers and 
functions to multi-language urls has me stumped.

Here is what I would like to achieve:
1. URLs appear in language of user:
app/news/latest (list of latest news in Eng)
app/nouvelles/recentes (maps to news/latest translated in Fr)

2. URLs rewritten when user toggles between languages (on news/latest page 
in Eng, click 'French' button, get redirected to nouvelles/recentes page)

3. URLs in views appear in the language currently defined in the session. 

For example, if in layout.html, I have URL('news','latest'), it shows as 
app/nouvelles/recentes when the session language is French.   

Would there be an elegant solution for achieving this?

Thanks.

On Sunday, 13 November 2011 04:02:14 UTC-5, rochacbruno wrote:
>
> Hi,
>
> I was playing a lot with routes, router and rewrite.py to reach url 
> rewriting for translation but I am missing something.
>
> I have a controller:
>
> # *default*.py
>
>
>> *def articles(): from handlers import articles*  
>
>   *   response.view = articles.views['list']*
>
> * return articles.list*
>
>
> This action can be accessed in: *http://../app/default/articles*
>
> I want the application to be translated including the urls.
>
> So in english
> http://../app/*default*/*articles*
>
> in portuguese:
> http://../app/*inicio*/*artigos*
>
>  In spanish
> http://../app/*principal*/*articulos*
>
> In Estonian
> http://../app/*peamine*/*artiklid*
>
> Using routes.py, how can I make all the above urls to call default.py: 
> articles function ?
>
> Thanks
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>  

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


[web2py] SQLFORM.grid oncreate how can I find out the ID of the record just created?

2014-01-06 Thread Jim S
Using SQLFORM.grid, created a function assigned to the oncreate callback.

SQLFORM.grid(., oncreate=myfunction)

def myfunction(form):

redirect(URL('workorders',args=('workorder','edit',form.vars.workorderId),user_signature=True))

return

But, I'm getting a value of None passed for form.vars.workorderId (the key 
for the table).  How can I reliably grab the ID of the record that was just 
inserted?

-Jim

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


[web2py] Re: SQLFORM.grid oncreate how can I find out the ID of the record just created?

2014-01-06 Thread Jim S
Or, to re-phrase my question;

How can I redirect to the edit page for a record as soon as it is added 
through the 'new' page using SQLFORM.grid?

-Jim

On Monday, January 6, 2014 4:28:02 PM UTC-6, Jim S wrote:
>
> Using SQLFORM.grid, created a function assigned to the oncreate callback.
>
> SQLFORM.grid(., oncreate=myfunction)
>
> def myfunction(form):
> 
> redirect(URL('workorders',args=('workorder','edit',form.vars.workorderId),user_signature=True))
>
> return
>
> But, I'm getting a value of None passed for form.vars.workorderId (the key 
> for the table).  How can I reliably grab the ID of the record that was just 
> inserted?
>
> -Jim
>

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


[web2py] Re: SQLFORM.grid oncreate how can I find out the ID of the record just created?

2014-01-06 Thread Anthony
Instead of form.vars.workorderId, use form.vars.id.

Anthony

On Monday, January 6, 2014 5:37:12 PM UTC-5, Jim S wrote:
>
> Or, to re-phrase my question;
>
> How can I redirect to the edit page for a record as soon as it is added 
> through the 'new' page using SQLFORM.grid?
>
> -Jim
>
> On Monday, January 6, 2014 4:28:02 PM UTC-6, Jim S wrote:
>>
>> Using SQLFORM.grid, created a function assigned to the oncreate callback.
>>
>> SQLFORM.grid(., oncreate=myfunction)
>>
>> def myfunction(form):
>> 
>> redirect(URL('workorders',args=('workorder','edit',form.vars.workorderId),user_signature=True))
>>
>> return
>>
>> But, I'm getting a value of None passed for form.vars.workorderId (the 
>> key for the table).  How can I reliably grab the ID of the record that was 
>> just inserted?
>>
>> -Jim
>>
>

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


Re: [web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread Alan Etkin
El lunes, 6 de enero de 2014 12:26:48 UTC-3, Akash Agrawall escribió:
>
> Still same error. it's too urgent for me 
>

It appears gmail is using some sort of smtp service lock for your 
application account:

http://designoservices.com/smtp-error-534-5-7-14-54-sending-mail-through-cake-or-php-using-gmail-account/
http://stackoverflow.com/questions/17462380/server-send-emails-using-gmail-smtp-gets-alerts
http://webapps.stackexchange.com/questions/44768/limitations-on-sending-email-through-gmail-smtp

According to the first post, it is resolved by just "... logging into your 
gmail and verifying its identity ..."

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


[web2py] Re: SQLFORM.grid oncreate how can I find out the ID of the record just created?

2014-01-06 Thread Jim S
Sorry Anthony, should have caught that myself.  Worked like a champ.

-Jim

On Monday, January 6, 2014 4:43:54 PM UTC-6, Anthony wrote:
>
> Instead of form.vars.workorderId, use form.vars.id.
>
> Anthony
>
> On Monday, January 6, 2014 5:37:12 PM UTC-5, Jim S wrote:
>>
>> Or, to re-phrase my question;
>>
>> How can I redirect to the edit page for a record as soon as it is added 
>> through the 'new' page using SQLFORM.grid?
>>
>> -Jim
>>
>> On Monday, January 6, 2014 4:28:02 PM UTC-6, Jim S wrote:
>>>
>>> Using SQLFORM.grid, created a function assigned to the oncreate callback.
>>>
>>> SQLFORM.grid(., oncreate=myfunction)
>>>
>>> def myfunction(form):
>>> 
>>> redirect(URL('workorders',args=('workorder','edit',form.vars.workorderId),user_signature=True))
>>>
>>> return
>>>
>>> But, I'm getting a value of None passed for form.vars.workorderId (the 
>>> key for the table).  How can I reliably grab the ID of the record that was 
>>> just inserted?
>>>
>>> -Jim
>>>
>>

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


[web2py] Re: SQLFORM.grid oncreate how can I find out the ID of the record just created?

2014-01-06 Thread Anthony
Wasn't obvious. I had to look at the code to confirm it.

On Monday, January 6, 2014 5:47:56 PM UTC-5, Jim S wrote:
>
> Sorry Anthony, should have caught that myself.  Worked like a champ.
>
> -Jim
>
> On Monday, January 6, 2014 4:43:54 PM UTC-6, Anthony wrote:
>>
>> Instead of form.vars.workorderId, use form.vars.id.
>>
>> Anthony
>>
>> On Monday, January 6, 2014 5:37:12 PM UTC-5, Jim S wrote:
>>>
>>> Or, to re-phrase my question;
>>>
>>> How can I redirect to the edit page for a record as soon as it is added 
>>> through the 'new' page using SQLFORM.grid?
>>>
>>> -Jim
>>>
>>> On Monday, January 6, 2014 4:28:02 PM UTC-6, Jim S wrote:

 Using SQLFORM.grid, created a function assigned to the oncreate 
 callback.

 SQLFORM.grid(., oncreate=myfunction)

 def myfunction(form):
 
 redirect(URL('workorders',args=('workorder','edit',form.vars.workorderId),user_signature=True))

 return

 But, I'm getting a value of None passed for form.vars.workorderId (the 
 key for the table).  How can I reliably grab the ID of the record that was 
 just inserted?

 -Jim

>>>

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


[web2py] Re: Unable to send email on server in web2py.....

2014-01-06 Thread Cliff Kachinske
On webfaction you can set up an email account and access it directly from 
within web2py, thus eliminating the transmission to gmail.

On Saturday, January 4, 2014 3:40:11 AM UTC-5, Akash Agrawall wrote:
>
> Hie folks.. I know this question is already been asked but I didn't get 
> any help from those answers. please hava look at this 
> I am unable to send email in server(to be specific webfaction.com) ...
> but it's running fine on local host
> all these three lines in db.py are set to true.
> auth.settings.registration_requires_verification = True
> auth.settings.registration_requires_approval = True 
> auth.settings.reset_password_requires_verification = True 
>
>  When I complete the registration form a flash appears on the top-right 
> corner of the page with a flash message "Unable to send mail"
> These are the settings of the mail server in db.py 
>
> mail = auth.settings.mailer
> mail.settings.server = 'smtp.gmail.com:587'
> mail.settings.sender = 'fakeid...@gmail.com '
> mail.settings.tls = False
> mail.settings.login ='fakeid425s...@gmail.com:secret'
>
>
>

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


[web2py] Re: cpdb from sqlite to postgresql

2014-01-06 Thread Alan Etkin

>
> The result is an error message:
>>
>> EXCEPTION: could not make a copy of the database
>> Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "gluon/dal.py", line 7766, in __init__
>> self._adapter = ADAPTERS[self._dbname](**kwargs)
>>   File "gluon/dal.py", line 2756, in __init__
>> if do_connect: self.find_driver(adapter_args,uri)
>>   File "gluon/dal.py", line 795, in find_driver
>> raise RuntimeError("no driver available %s" % str(self.drivers))
>> RuntimeError: no driver available ('psycopg2', 'pg8000')
>>
>
It seems that dal.py cannot import the drivers. Do you see any driver not 
found error log when you run the script? Also, can you import the driver 
with an interactive session?

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


[web2py] Re: outer join? i guess

2014-01-06 Thread lucas
ok, i got lucky.

this seems to work perfectly:

db((tUser.id==auth.user.id) | (tUser.id==None)).select(tCmp.ALL, 
orderby=tCmp.company_name, left=tUser.on((tCmp.id==tUser.firm_id)))

but honestly, i have no idea why it works.  can someone explain this to me?

it is almost like the left condition, without the db(), pulls all companies 
regardless whether there is a user affiliation or not, the the db() section 
filters that further.  is that logic correct or not?

lucas

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


Re: [web2py] routes.py Problem

2014-01-06 Thread Rockiger
Thanks again,  
this is much more than I exspectet. I will look into this, and post back.

Best,
Marco

On Monday, January 6, 2014 4:50:17 PM UTC+1, Jonathan Lundell wrote:
>
> On 6 Jan 2014, at 1:17 AM, Rockiger > 
> wrote: 
> > Hi Jonathan, 
> > 
> > many thanks for the answer: 
> > 
> > Here ist mit request object: http://pastie.org/8605943 
> > 
> > The URL ist http://rockiger.com/de/domainfactory/kontoeroeffnung. 
> > 
> > It seems there is a variable request.uri_language: de in that case. 
> > 
> > It would be very interesting to know what precisely do this two 
> directives: 
> >>  default_language = 'de', 
> >>  languages = ['en', 'de'], 
> > Which code in web2py interprets that? 
> > 
>
> Thanks for following up. It appears that both the cookbook and the example 
> file are incorrect. Here's the corrected text from the examples file; I'll 
> send a patch now. I've also added a note on how to integrate the incoming 
> language with the T() operator. 
>
> #  languages: list of all supported languages 
> #   Names in languages are always treated as language names when they 
> appear in an incoming URL after 
> #   the (optional) application name. 
> #  default_language 
> #   The language code (for example: en, it-it) optionally appears in 
> the URL following 
> #   the application (which may be omitted). For incoming URLs, the 
> code is copied to 
> #   request.uri_language; for outgoing URLs it is taken from 
> request.uri_language. 
> #   If languages=None, language support is disabled. 
> #   The default_language, if any, is omitted from the URL. 
> #   To use the incoming language in your application, add this line to 
> one of your models files: 
> #   if request.uri_language: T.force(request.uri_language) 
>
> As to your question: the code is in gluon.rewrite, specifically in the 
> classes MapUrlIn and MapUrlOut.

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


Re: [web2py] !! NEW ADMIN !!

2014-01-06 Thread Samuel Marks
Very nice!


Samuel Marks
http://linkedin.com/in/samuelmarks


On Tue, Jan 7, 2014 at 8:29 AM, Richard Vézina
wrote:

> Nice!
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 4:19 PM, samuel bonill wrote:
>
>> Admin Plus(A-Plus) is a web2py plugin that provides an easy-to-use
>> interface for managing your data
>>
>> link: https://github.com/pyner/admin_plus
>>
>> install
>>
>> 1. Download and install the plugin
>> 2. go to "127.0.0.1:8000//plugin_admin_plus/install"
>>  3. Get the permissions " plugin_admin_plus_superuser " in "
>> 127.0.0.1:8000//appadmin/insert/db/auth_membership"
>> 4. !! ready! Now you can log in...  " 127.0.0.1:8000/
>> /plugin_admin_plus/index"
>>
>> NOTE:  is  replaced by the name of your application
>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


[web2py] download file

2014-01-06 Thread sonu kumar
Hi,

I have an application, which takes query in a form and after submitting 
this form result comes in upload folder in text file which I want to 
download.
Please let me know how to download this.

Thanks

 

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


Re: [web2py] Re: web2py app like adminer

2014-01-06 Thread samuel bonill
 hi all

already available A-PLUS (admin plus)  in :

https://groups.google.com/forum/#!topic/web2py/irlm_8dGSnQ


2014/1/2 rif 

> https://github.com/rif/web2admin it's something like a django admin.
> Maybe it can help.
>
> -rif
>
> joi, 2 ianuarie 2014, 03:54:43 UTC+2, samuel bonill a scris:
>>
>> when it's ready  i'll let you know
>>
>>
>> 2014/1/1 Massimo Di Pierro 
>>
>>> I look forward to see more of this!
>>>
>>> Massimo
>>>
>>>
>>> On Wednesday, 1 January 2014 17:58:04 UTC-6, samuel bonill wrote:

 

 Hi all,

 I am developing a modern admin to web2py

 supports permissions
 supports csv files
 pagination
 resposponsive desing

 this week will be released under the GPL3 license

 a quick look :





 
 

  --
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/web2py/EYKqGYry6Eg/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/EYKqGYry6Eg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: [web2py] Re: need help for rewrite on routes.py

2014-01-06 Thread Jonathan Lundell
On 6 Jan 2014, at 1:55 PM, galoshes  wrote:
> Hello, I would like to revive this older thread (which also relates to this 
> one:https://groups.google.com/forum/#!topic/web2py/ff1syTIl12o).
> 
> I'm new to web2py, and so far have been finding my way around ok (thanks to 
> the excellent docs), but the particular problem of mapping controllers and 
> functions to multi-language urls has me stumped.
> 
> Here is what I would like to achieve:
> 1. URLs appear in language of user:
> app/news/latest (list of latest news in Eng)
> app/nouvelles/recentes (maps to news/latest translated in Fr)
> 
> 2. URLs rewritten when user toggles between languages (on news/latest page in 
> Eng, click 'French' button, get redirected to nouvelles/recentes page)
> 
> 3. URLs in views appear in the language currently defined in the session. 
> 
> For example, if in layout.html, I have URL('news','latest'), it shows as 
> app/nouvelles/recentes when the session language is French.   
> 
> Would there be an elegant solution for achieving this?

web2py routing is not really set up to do this kind of thing. The nearest I can 
suggest is to have no routes.py, and:

1. Write a URL() wrapper that translates request.controller & request.function 
for outgoing URLs.

2. In your model (eg early in db.py), translate request.controller & 
request.function to the base language of the app.


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


[web2py] Re: download file

2014-01-06 Thread Anthony
Read about response.download() here: 
http://web2py.com/books/default/chapter/29/04/the-core#response, and here 
as well: 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-uploads.
 
There is a download() function in the default.py controller of the 
scaffolding app that you can use -- just construct a URL like 
URL('default', 'download', args=row.myfile) (where row is a row from the 
database, and myfile is the name of the upload field).

Anthony

On Monday, January 6, 2014 8:33:53 PM UTC-5, sonu kumar wrote:
>
> Hi,
>
> I have an application, which takes query in a form and after submitting 
> this form result comes in upload folder in text file which I want to 
> download.
> Please let me know how to download this.
>
> Thanks
>
>  
>
>

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


Re: [web2py] !! NEW ADMIN !!

2014-01-06 Thread 黄祥
wonthefull

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


[web2py] Re: outer join? i guess

2014-01-06 Thread Tim Richardson
Not an answer, but are you using _select to see the sql generated? 



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


[web2py] Re: Possibly a problem with CAS redirection in v2.8.2

2014-01-06 Thread Tim Richardson


I noticed that I'm getting these tickets generated by the CAS provider app 
(welcome, in my case) during the CAS authentication.

Traceback (most recent call last):
  File "/Users/tim/web2py/gluon/restricted.py", line 217, in restricted
exec ccode in environment
  File "/Users/tim/web2py/applications/welcome/controllers/default.py", line 
78, in 
  File "/Users/tim/web2py/gluon/globals.py", line 372, in 
self._caller = lambda f: f()
  File "/Users/tim/web2py/applications/welcome/controllers/default.py", line 
40, in user
return dict(form=auth())
  File "/Users/tim/web2py/gluon/tools.py", line 1310, in __call__
return self.cas_validate(version=2, proxy=False)
  File "/Users/tim/web2py/gluon/tools.py", line 2115, in cas_validate
if 'username' in table_user.fields else 'email'
NameError: global name 'table_user' is not defined


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


[web2py] Re: Possibly a problem with CAS redirection in v2.8.2

2014-01-06 Thread Tim Richardson
I've sent a PR which seems to fix this.

On Tuesday, 7 January 2014 15:57:38 UTC+11, Tim Richardson wrote:
>
>
>
> I noticed that I'm getting these tickets generated by the CAS provider app 
> (welcome, in my case) during the CAS authentication.
>
> Traceback (most recent call last):
>   File "/Users/tim/web2py/gluon/restricted.py", line 217, in restricted
> exec ccode in environment
>   File "/Users/tim/web2py/applications/welcome/controllers/default.py", line 
> 78, in 
>   File "/Users/tim/web2py/gluon/globals.py", line 372, in 
> self._caller = lambda f: f()
>   File "/Users/tim/web2py/applications/welcome/controllers/default.py", line 
> 40, in user
> return dict(form=auth())
>   File "/Users/tim/web2py/gluon/tools.py", line 1310, in __call__
> return self.cas_validate(version=2, proxy=False)
>   File "/Users/tim/web2py/gluon/tools.py", line 2115, in cas_validate
> if 'username' in table_user.fields else 'email'
> NameError: global name 'table_user' is not defined
>
>
>

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


[web2py] Re: Possibly a problem with CAS redirection in v2.8.2

2014-01-06 Thread Mirko
Hi,
some time ago I had a similar issue that I solved this way 
: https://groups.google.com/d/msg/web2py/FhtokyNZT7k/QEFQOdMzIP4J
Hope it helps,
Mirko

On Friday, December 20, 2013 8:05:10 PM UTC, viniciusban wrote:
>
> Hi guys, 
> I'm playing around with CAS and faced this error: 
>  begin here  
> The webpage at 
> http://localhost:8000/cas/default/user/cas/login?service=http://localhost:8000/consumer/default/user/login#
>  
> has resulted in too many redirects. Clearing your cookies for this 
> site or allowing third-party cookies may fix the problem. If not, it 
> is possibly a server configuration issue and not a problem with your 
> computer. 
>
> Error code: ERR_TOO_MANY_REDIRECTS 
>  end here  
>
> It occurs in v2.8.2, but not in v2.7.4. 
>
> My scenario is simple: 
> 1- One CAS provider application, called "cas". Actually, a raw copy of 
> welcome application. Nothing more, nothing less. 
> 2- One CAS consumer, called "consumer". Another copy of welcome 
> application with just one single modification in db.py: 
> auth = Auth(db, cas_provider="http://localhost:8000/cas/default/user/cas";) 
>
> 3- In consumer application, I have a default.py/protected() function 
> with @auth.requires_login() decorator. 
>
> The workflow to reproduce the error is: 
> 1) Try to go to http://localhost:8000/consumer/protected. 
> 2) The login form will show up (from cas application). 
> 3) When I fill the form and click submit, the error happens. 
>
> Is there anything I must configure in v2.8.2 to allow CAS to work out? 
>

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


[web2py] Re: Possibly a problem with CAS redirection in v2.8.2

2014-01-06 Thread Tim Richardson
this time it was throwing a ticket due to an undefined variable. 

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