Re: [web2py] Re: web2py + exceptions(tickets) service?

2013-02-14 Thread Alec Taylor
Cool website; however web2py has those features built-in :) As for setting up email alerts for tickets—e.g.: that have been reported a certain number of times—I think that's a strong feature-request to add into the issue queue (or build yourself and pull-request back). On Fri, Feb 15, 2013 at 6:3

Re: [web2py] Date null display

2013-02-14 Thread Bruno Rocha
A(value.strftime("%d/%m/%Y")) Em 15/02/2013 05:01, "Simon Ashley" escreveu: > Traditionally in other field types you could display a null value with an > expression similar to the following: > > db.table.datefield.represent = lambda value, row: A(value) if value else > 'unknown' > > Occasional we

[web2py] Re: web2py + exceptions(tickets) service?

2013-02-14 Thread Luciano Laporta Podazza
On Thursday, February 14, 2013 4:39:14 PM UTC-3, Niphlod wrote: > > as far as I'm concerned no, but adding support shouldn't be that difficult > if you have time to spend on it. > > PS: If you just need to be "alerted" as soon as an exception has been > fired by your app, web2py has already al

[web2py] Date null display

2013-02-14 Thread Simon Ashley
Traditionally in other field types you could display a null value with an expression similar to the following: db.table.datefield.represent = lambda value, row: A(value) if value else 'unknown' Occasional we have a requirement to display null values as alternatively i.e. None, Unknown, Not rec

[web2py] 2 grids loaded in a single form: back button reference

2013-02-14 Thread Simon Ashley
Trying to embed multiple grids (or at least 2 of them) on a single page using load statements as per the following controller, functions and views. It seems to work fine until you click view or edit, from the called grid, on the calling grid (step2). The related edit and view seem to be rendered

[web2py] Problem reading xls with xlrd

2013-02-14 Thread Luciano B
I have this code in controller trying to read an .xls file : def upload(): import xlrd form = SQLFORM.factory(Field('pago', 'upload', uploadfolder='/home/user/web2py/applications/pruebas/uploads')).process() if form.accepts(request.vars,keepvalues=T

[web2py] Crud Permissions

2013-02-14 Thread Greg
I want to have two auth_groups: "administrator" who will have complete CRUD access to all tables, and "editor" who will have complete CRUD access to a limited set of tables. I can give "administrator" access without even setting up permissions by doing the following: > @auth.requires_membership

[web2py] Re: DAL return number of rows affected?

2013-02-14 Thread Massimo Di Pierro
affected_rows = db(...).update() On Thursday, 14 February 2013 19:47:35 UTC-6, Cliff Kachinske wrote: > > Is it possible to get the number of rows affected by an update in the DAL? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsub

[web2py] Re: centralize file view *.html

2013-02-14 Thread Massimo Di Pierro
One should not extend twice. The behavior is not specified. You can extend once and **include** many. On Thursday, 14 February 2013 17:17:35 UTC-6, 黄祥 wrote: > > hi massimo > > what do you mean about import? > is it same like : > > from gluon.contrib.markmin.markmin2html import markmin2html > fr

[web2py] delete session strange behaviour

2013-02-14 Thread 黄祥
hi, i'm trying to delete session using del session, and found strange behaviour for example *#**views/default/order.html* {{for id, qty in order.items():}} {{p=db.product(id)}} {{=p.product_name}} Rp. {{=p.unit_price}} {{=qty}} {{=SPAN(A('+', callback=URL('order

Re: [web2py] Validator: {Validator1 OR validator2} - Can I get that requires on a Field?

2013-02-14 Thread Bruno Rocha
It gives me the idea of a CUSTOM validator class CUSTOM(object): def __init__(self, function): self.function = function def __call__(self, value): # the function should return the error_message or None return(value, self.function(value)) So the use should be: d

Re: [web2py] Validator: {Validator1 OR validator2} - Can I get that requires on a Field?

2013-02-14 Thread Bruno Rocha
Finally, I just testes on the shell *modules/anyvalidator.py* class ANY(object): def __init__(self, validators): self.validators = validators def __call__(self, value): # validates the value against each validator results = [validator(value)[1] for validator in s

Re: [web2py] Validator: {Validator1 OR validator2} - Can I get that requires on a Field?

2013-02-14 Thread Bruno Rocha
I guess the first one is wrong.. to amtch your criteria I think you need this class ANY(object): def __init__(self, validators): self.validators = validators def __call__(self, value): # validates the value against each validator results = [validator(value)[1] for

Re: [web2py] Validator: {Validator1 OR validator2} - Can I get that requires on a Field?

2013-02-14 Thread Bruno Rocha
class ANY(object): def __init__(self, validators): self.validators = validators def __call__(self, value): # validates the value against each validator results = [validator(value) for validator in self.validators] # Check if there is an invalid result

[web2py] Validator: {Validator1 OR validator2} - Can I get that requires on a Field?

2013-02-14 Thread Alec Taylor
I am writing in a signup form for users of my site. To signup, they can either use their email address `IS_EMAIL()`; or an outside uid (covered by an `IS_MATCH()`). (it's a 1 field form) One solution to validating the form is to just check the vars in the controller, and have two Fields in the T

[web2py] DAL return number of rows affected?

2013-02-14 Thread Cliff Kachinske
Is it possible to get the number of rows affected by an update in the DAL? -- --- 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.

[web2py] DAL return number of rows affected?

2013-02-14 Thread Cliff Kachinske
Is it possible to get the number of rows affected by an update in the DAL? -- --- 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.

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread 黄祥
hi anthony, when upgrade to the new version, web2py will updated the scaffolding that generated by default (like db.py, menu.py, default.py, layout.html, css, etc), isn't it? so to keep my code always can be run in the newer version, i'm trying to avoid to modify the default file. please correc

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread Anthony
May I ask why you are working so hard to avoid modifying the scaffolding application? It is intended to be modified -- it's really just an example app that you should customize to fit your specific needs. Anthony On Thursday, February 14, 2013 2:45:17 PM UTC-5, 黄祥 wrote: > > hi, > > is it possi

Re: [web2py] Re: Unable to send email - password reset.

2013-02-14 Thread Tim Richardson
Some time ago I ran into exactly the same problem and came to the solution exactly the same way (on Windows). The book now includes this setting but perhaps it is too subtle (search TLS). There are a lot of advantages to running debug/development sessions using an interactive web2py server st

[web2py] Re: centralize file view *.html

2013-02-14 Thread 黄祥
hi massimo what do you mean about import? is it same like : from gluon.contrib.markmin.markmin2html import markmin2html from gluon.contrib.markmin.markmin2latex import markmin2latex from gluon.contrib.markmin.markmin2pdf import markmin2pdf best regards -- --- You received this message becau

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread 黄祥
yeah, i've already read that part, and think about another possiblity. again, thank you for your detail explaination, Niphlod -- --- 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,

[web2py] Re: performance impact when put menu in controller

2013-02-14 Thread 黄祥
a, that's make me clear now. thank you very much, Niphlod -- --- 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 opt

[web2py] Connecting to MySQL via SSL

2013-02-14 Thread Osman Masood
Hi, I'm trying to connect get web2py to connect to MySQL via SSL (or SSH). Based on the code, seems like I need to do something like: db = DAL('..', driver_args=dict(ssl=dict(ca='/path/to/mysql-ssl-ca-cert.pem'))) (I only need the CA cert file, the key and certificate files are not needed for

[web2py] Re: centralize file view *.html

2013-02-14 Thread Massimo Di Pierro
One should not extend twice. The behavior is not specified. You can extend once and import many. On Thursday, 14 February 2013 15:05:27 UTC-6, 黄祥 wrote: > > hi niphlod, > > you re right it works for : > > extend layout.html > extend block_footer.html > > but the problem is the block_footer.html

Re: [web2py] Re: Can web2py be used for highly complex relational databases?

2013-02-14 Thread Richard Vézina
Really interesting thread... Thanks Massimo about the clear explanation about web2py pros and con... Also I like the lookup table cache tricks... Richard On Sat, Dec 29, 2012 at 5:30 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > The problem is that SQLA is from this prospective l

[web2py] very important! we need to help Python

2013-02-14 Thread Massimo Di Pierro
TLTR: a private company not affiliated with python.org is trying to claim copyright of the name Python in Europe for all software. http://pyfound.blogspot.ca/2013/02/python-trademark-at-risk-in-europe-we.html If you are in Europe or have colleagues in Europe, they can help as directed in the ab

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread Niphlod
On Thursday, February 14, 2013 10:10:08 PM UTC+1, 黄祥 wrote: > > hi Niphlod, > > thank you so much for your hints. > No problem, it's both a pleasure and an occasion to "refresh" topics > i've already read the book, and just curious, is the web2py support to > modified (alter) the auth table

[web2py] Re: performance impact when put menu in controller

2013-02-14 Thread Niphlod
Sorry, you're asking "how not change the default web2py menu" ? leave it where it is, or cut&paste in a model ^_^ On Thursday, February 14, 2013 10:17:49 PM UTC+1, 黄祥 wrote: > > hi Niphlod, > > thank you so much for your suggestion. > so what is the best in terms to not change default web2py file

[web2py] Re: performance impact when put menu in controller

2013-02-14 Thread 黄祥
hi Niphlod, thank you so much for your suggestion. so what is the best in terms to not change default web2py file scaffolding generated (the menu.py is in default): create the custom_menu.py in models or just define it on controllers (default.py)? -- --- You received this message because you

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread 黄祥
hi Niphlod, thank you so much for your hints. i've already read the book, and just curious, is the web2py support to modified (alter) the auth tables after it's define. i've already do some experiment for it, but it didn't works, n i don't know the reason. yes, you right in term of auth table,

[web2py] Re: performance impact when put menu in controller

2013-02-14 Thread Niphlod
none whatsoever (in a normal environment). It's just that models are executed at every request, while controller gets called only when you hit the page. Usually to avoid to copy over and over the same menu items in multiple places, you put the code in models. >From a theoric standpoint, having m

[web2py] Re: centralize file view *.html

2013-02-14 Thread 黄祥
hi niphlod, you re right it works for : extend layout.html extend block_footer.html but the problem is the block_footer.html replace all of the content of layout.html. my goal is to create the block footer html file separate from layout.html and then the other view files can use it to replace

[web2py] performance impact when put menu in controller

2013-02-14 Thread 黄祥
hi, is there any performance impact when put menu in controller? i know i can modify the menu.py or create the new file menu_custom.py in models but i don't want to change default web2py file scaffolding generated as much as possible. for example *controllers/default.py* * * # -*- coding: utf-

[web2py] Re: centralize file view *.html

2013-02-14 Thread Niphlod
uhm, I'm missing something. no exception is returned by both syntaxes. extend layout.html include block_footer.html works. extend layout.html extend block_footer.html doesn't raise an exception but "overwrites" the extend layout.html part So, what is the issue ? -- --- You received this mess

[web2py] Re: How to include a select field in a many to many relationship

2013-02-14 Thread Derek
You could make it a list:reference and then process that on accept by assigning the appropriate groups. On Wednesday, February 13, 2013 11:58:02 PM UTC-7, José Manuel López Muñoz wrote: > > Hi, > I want to make a user creation form, and I need to select the group that > this user belongs. > A

[web2py] Re: custom auth table on separate file not in db.py

2013-02-14 Thread Niphlod
to define a table you must have the auth object and the DAL connection executed before than your auth customizations. models are executed alphabetically. You need to respect this order 1. db = DAL() 2. from gluon.tools import Auth auth = Auth(db) 3. your customizations 4. auth

[web2py] custom auth table on separate file not in db.py

2013-02-14 Thread 黄祥
hi, is it possible to custom auth table on separate file not in db.py? for example : *models/db_wizard.py* # append fields : auth.signature db._common_fields.append(auth.signature) # custom auth user table auth.settings.extra_fields['auth_user']=[ Field('gender', 'list:string'), Field('

[web2py] Re: web2py + exceptions(tickets) service?

2013-02-14 Thread Niphlod
as far as I'm concerned no, but adding support shouldn't be that difficult if you have time to spend on it. PS: If you just need to be "alerted" as soon as an exception has been fired by your app, web2py has already all the bits you need. On Thursday, February 14, 2013 5:00:24 PM UTC+1, Lucian

[web2py] Re: make_min_web2py.py no longer working (anyserver)

2013-02-14 Thread Niphlod
the binary package can not be stripped because it's compiled. On Thursday, February 14, 2013 5:26:41 PM UTC+1, Mirek Zvolský wrote: > > I'm sorry. It is problem of Windows distribution only. > In Windows distribution in scripts\make_min_web2py.py variable REQUIRED > contains few files, which are

[web2py] Re: centralize file view *.html

2013-02-14 Thread 黄祥
done, Issue 1335 thank you so much in advance -- --- 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 web2p

[web2py] Re: Purpose of creating group for each user?

2013-02-14 Thread Yarin
@Massimo - Perhaps consider including: auth.settings.create_user_groups = True in the default db.py, along with a comment explaining that it's mostly useful for crud. I think this would clarify auth config for many users. On Friday, February 1, 2013 5:21:05 PM UTC-5, Massimo Di Pierro wrote: >

Re: [web2py] Re: centralize file view *.html

2013-02-14 Thread Massimo Di Pierro
It is possible that we do not support extending a block from an included file. I never tried that. Please open a ticket about that. On Thursday, 14 February 2013 03:02:55 UTC-6, 黄祥 wrote: > > already, i even tested it : > > *example code that not work* > *views/block_footer.html* > > {{block foot

[web2py] Re: make_min_web2py.py no longer working (anyserver)

2013-02-14 Thread Mirek Zvolský
I'm sorry. It is problem of Windows distribution only. In Windows distribution in scripts\make_min_web2py.py variable REQUIRED contains few files, which are not part of the Windows distribution (anyserver.py, fcgihandler.py,..?). In source code distribution the script has no problem. -- ---

[web2py] web2py + exceptions(tickets) service?

2013-02-14 Thread Luciano Laporta Podazza
Hello!, I would like to know if there's something like http://www.exceptional.io but with support for web2py?. Thanks! -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, sen

[web2py] Re: Cannot get a to update, once form inputs have been successfully processed and Ajax used.

2013-02-14 Thread Niphlod
easier to read, still impossible to reproduce. You're doing everything without using the nice facilities web2py provides, but since you're going that way, let's try to break up and analyze the issue. You're attaching a submit handler and discarding completely the response $.post($(this).attr('

Re: [web2py] 'Morsel' object has no attribute 'split' ?

2013-02-14 Thread Leonel Câmara
Done, I 've placed my facebook.py in attachment. Not sure if any changes to web2py are necessary as I'm using a slightly modified (by me and applying a few patches on the rep) version of http://code.google.com/p/cfhowes/source/browse/#hg/web2py_multiauth instead of the standard auth. My gu

[web2py] Re: Cannot get a to update, once form inputs have been successfully processed and Ajax used.

2013-02-14 Thread AnnG
Sorry, I've now attached the code as a file. I corrected that error, thanks. Still doesn't work. On Thursday, February 14, 2013 1:01:46 PM UTC, Niphlod wrote: > > meh, next time include the code as an attachment or use the google group > interface that can format code inline...far more reada

[web2py] Login does not redirect

2013-02-14 Thread António Ramos
Hello i have an app that with web2py 2.0.9 after pressing login button i am redirected to the index page. I tested my app with web2py 2.3.2 and the redirection is not done. I have after pressing login button to change the url and i´m redirected to index. Is this a bug? I´m using jquery mobile pl

[web2py] Re: Cannot get a to update, once form inputs have been successfully processed and Ajax used.

2013-02-14 Thread Niphlod
meh, next time include the code as an attachment or use the google group interface that can format code inline...far more readable! Anyway, I'm at work and can't test it (nor anyone, without models, controllers, and so on), but I spotted an error $('scan_info_previous').load(" {{=URL('get_patien

[web2py] Cannot get a to update, once form inputs have been successfully processed and Ajax used.

2013-02-14 Thread AnnG
Hi, Please could someone tell me why this won't work (see between 'THIS PART NOT WORKING - START' and 'THIS PART NOT WORKING - END' in code entered below. In a nutshell, once a form is processed, I want to stay on same page (successfully achieved) and also update a (ID = 'scan_info_previous

[web2py] Re: make_min_web2py.py no longer working (anyserver)

2013-02-14 Thread Niphlod
sure that anyserver is the problem? https://github.com/web2py/web2py/blob/master/anyserver.py On Thursday, February 14, 2013 11:48:23 AM UTC+1, Mirek Zvolský wrote: > > script call anyserver.py, which is no longer present in 2.x :( -- --- You received this message because you are subscribed t

[web2py] make_min_web2py.py no longer working (anyserver)

2013-02-14 Thread Mirek Zvolský
script call anyserver.py, which is no longer present in 2.x :( -- --- 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 mor

[web2py] Setting up memcache on GAE - a basic question

2013-02-14 Thread Andy W
I would like to store both session data and cached data in memcache when I upload my app to GAE. Can anybody point me in the right direction for setting this up? Based on the web2py scaffolding app I have tried (in models/db.py): if not request.env.web2py_runtime_gae: db = DAL('sqlite://sto

[web2py] Re: Example JSON Code

2013-02-14 Thread Alan Etkin
> > How do you put that before the $.jsonp({ call? > {{=SCRIPT(...)}} You can also do string interpolation with one SCRIPT call SCRIPT(""" ... url: "%(url)s", """ % dict(url=URL(...))) -- --- You received this message because you are subscribed to the Goo

[web2py] Re: outdated web2py plugin for jquery mobile

2013-02-14 Thread wanderer
I had the same problem today. Looks like http://web2py.com/plugins/plugin_jqmobile/about still refers to the wrong plugin. Am Sonntag, 21. Oktober 2012 17:43:37 UTC+2 schrieb Massimo Di Pierro: > > Will do asap. The one that ships with admin is updated, the one on > web2py.com/plugins is not.

Re: [web2py] Re: centralize file view *.html

2013-02-14 Thread steve van christie
already, i even tested it : *example code that not work* *views/block_footer.html* {{block footer}} custom_footer {{end}} *views/default/blog.html* *1.* * *{{extend 'layout.html'}} {{include 'block_footer.html'}} i think the server is confused about which block footer that they will use, so the

Re: [web2py] Re: From a component controller, can I force reload of entire page?

2013-02-14 Thread Niphlod
PS: the deletion happens via ajax through an onclick event attached to the delete button. The redirection was added only to keep the deletion working without javascript enabled. On Thursday, February 14, 2013 5:53:50 AM UTC+1, Anthony wrote: > > Here's the relevant code: > > elif deleta

[web2py] Re: centralize file view *.html

2013-02-14 Thread Niphlod
did you by any chance looked at http://web2py.com/books/default/chapter/29/05#Page-layout ? On Thursday, February 14, 2013 8:51:50 AM UTC+1, 黄祥 wrote: > > hi, > > i want to try centralize file view *.html, but it's ended with failure > when using extend and include. > for example i want to crea