[web2py] Re: How to Save Query in Session

2012-03-29 Thread Limedrop
What do you think about adding a serialization function to gluon.dal.Query? Eg, Query._as_dict() We could also get the framework to automatically invoke it when saving a Query/Expression to session. On Thursday, March 29, 2012 12:58:41 PM UTC+13, Massimo Di Pierro wrote: > > Let me know if you h

[web2py] Check to delete:False

2012-03-29 Thread Annet
After upgrading from 1.99.2 to 1.99.7 the "check to delete" label has changed to "check to delete: False" Check to delete:False Is there a reason for this? Kind regards, Annet

[web2py] time field in DAL? when I retrieve it, it gives me as nontype instead of time type.

2012-03-29 Thread Kenny
I tried to compare by doing {{=row.start_hour > request.now.time()}} start_hour is defined as 'time' error : TypeError: can't compare datetime.time to NoneType How can I convert time field to be time type? so I can compare them. Also, one last question is how can I show times in different

[web2py] New function in trunk: Sign e-mail with X.509 certificate enhancement

2012-03-29 Thread szimszon
If you would sign an e-mail but you do not want to include the the certificate in the e-mail just specify: mail.settings.x509_nocerts = True

[web2py] [NFiT] upload fields has a retrieve_fileproperties function

2012-03-29 Thread szimszon
2012-03-28 22:22:19 If you seek for the uploaded file's original name or the actual location of the file in the disk now you can retrieve it by: file_prop=db.files_store.content.retrieve_fileproperties( row.content ) original_filename=file_prop['filename'] path_to_the_stored_file=file_prop['path

[web2py] [NFiT] Sign e-mail with X.509 certificate enhancement

2012-03-29 Thread szimszon
Version 1.99.7 (2012-03-28 22:22:19) dev 2012. március 29., csütörtök 10:52:30 UTC+2 időpontban szimszon a következőt írta: > > If you would sign an e-mail but you do not want to include the the > certificate in the e-mail just specify: > > mail.settings.x509_nocerts = True > > >

Re: [web2py] Re: sqlite to postgres

2012-03-29 Thread Wikus van de Merwe
Upgrade. Python 2.7 is backward compatible with 2.6. Pip install is also a good option.

[web2py] database foreign key question

2012-03-29 Thread bussiere adrien
Thanks to you my project make nice progress : http://img26.imageshack.us/img26/1271/loginscreena.png But i need to know some things : here is my database : db.define_table('Skill', Field('Nom', unique=True), format = '%(Nom)s') db.define_table('SkillLevel', Field('Level', 'integer'), Field(

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Sergi Pons Freixes
2012/3/29 Jonathan Lundell : > > Latest 2.7. I thought 2.5 was the recommended option for web2py. From the book: "...on Python versions 2.4, 2.5, 2.6, and 2.7, although "officially" it only supports 2.5 so that we can guarantee backward compatibility for applications."

[web2py] web2py icon/logo?

2012-03-29 Thread selecta
I want to put an icon of web2py on a poster that I am going to present. Is this icon the right choice? http://s3.amazonaws.com/uploads.uservoice.com/logo/design_setting/60411/original/web2py_icon_4162_0.png?1322778787 I dont want to use the strechted logo (http://web2py.com/examples/static/image

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Vinicius Assef
As far as I understand, Web2py is developed using 2.5 features. So, the framework itself officially supports v2.5 and this is good. But it doesn't mean you cannot use 2.7 to develop your application based on the framework. I, personally, always use the latest Python stable release. There's no reas

[web2py] Dynamically create form ?

2012-03-29 Thread bussiere adrien
is there a way to dynamically create a for like : liste = ["titi","toto"] form=FORM("UserName:", INPUT(_name='Username'), "Email : ", INPUT(_name='email',_value=user.email), ) for l in liste : form.add("%s : "%l,INPUT(_name="%s"%l)) # and at the end add the submit button : form.add(IN

[web2py] Re: Dynamically create form ?

2012-03-29 Thread bussiere adrien
Find i've adapted an exemple : form=FORM("UserName:", INPUT(_name='Username'), "Email : ", INPUT(_name='email',_value=user.email), INPUT(_type='submit')) form.insert(-1,INPUT(_name='titi',_value='titi')) the doc : Sometimes you may wish to add an extra element to your form af

[web2py] Re: Dynamically create form ?

2012-03-29 Thread Anthony
More generally, all web2py HTML helpers (including FORM and SQLFORM) act like Python lists with respect to their components, so you can use all the Python list methods, including .insert and .append. Helpers also act like Python dictionaries with respect to their attributes (i.e., named argumen

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Anthony
> > I thought 2.5 was the recommended option for web2py. From the book: > "...on Python versions 2.4, 2.5, 2.6, and 2.7 > That's not quite correct, as 2.4 is no longer supported. > although "officially" > it only supports 2.5 so that we can guarantee backward compatibility > for applications."

[web2py] Re: web2py icon/logo?

2012-03-29 Thread Anthony
No, that's the old logo, which was replaced over a year ago -- don't use that one. The logos are at the bottom of the downloads page: http://www.web2py.com/examples/default/download. You might also consider using the web2py.com favicon, which you can find in the /static folder of the "examples"

[web2py] Re: Web-page freezes on db.define_table

2012-03-29 Thread Xiaofeng Tang
try use migrate=false to fit into legacy db. otherwise, it will try to create it. (pls refer to official doc on section: dal -> legacy db) (one more hit that may not be related to this issue: define_table will create an id column automatically.) 在 2011年12月21日星期三UTC+8下午6时23分56秒,Axel写道: > > Hi, >

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Xiaofeng Tang
2012/3/29 20:39:38 Xiaofeng Tang : Sergi Pons Freixes Wrote: > 2012/3/29 Jonathan Lundell : >> Latest 2.7. > I thought 2.5 was the recommended option for web2py. From the book: > "...on Python versions 2.4, 2.5, 2.6, and 2.7, although "officially" > it only supports 2.5 so that we can guarantee ba

[web2py] Versions earlier than 1.77.1?

2012-03-29 Thread Willoughby
Hello, I'm trying to find the source code for v1.61.1 but I can't seem to find anything earlier than v1.77.1 publicly available. Is there a public archive that goes back prior to v1.77.1? Thanks, Willoughby

[web2py] Re: [NFiT] upload fields has a retrieve_fileproperties function

2012-03-29 Thread Alan Etkin
Shouldn't it be called ..retrieve_file_properties? On Thursday, March 29, 2012 5:58:35 AM UTC-3, szimszon wrote: > > 2012-03-28 22:22:19 > > If you seek for the uploaded file's original name or the actual location > of the file in the disk now you can retrieve it by: > > file_prop=db.files_store.

[web2py] Re: Check to delete:False

2012-03-29 Thread Alan Etkin
Looks like an error when typing or something like that. For me it should be only "Check to delete" On Thursday, March 29, 2012 4:49:08 AM UTC-3, Annet wrote: > > After upgrading from 1.99.2 to 1.99.7 the "check to delete" label has > changed to "check to delete: False" > > Check to > delete:Fa

[web2py] Re: Facing Trouble in Cascading drop-down with ajax

2012-03-29 Thread Alan Etkin
Is your code from a web2py slice? please add the example link or post the code that is not working. On Thursday, March 29, 2012 3:31:36 AM UTC-3, Sanjeet Kumar wrote: > > I am using the three cascading drop-down menu with the help of slices i am > able to show the value in the second drop-down f

[web2py] Python Negative Popularity

2012-03-29 Thread Ovidio Marinho
The fall of the python's fault Django and Python 3.0? http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread lyn2py
Why would you want that? On Thursday, March 29, 2012 9:07:22 PM UTC+8, Willoughby wrote: > > Hello, > > I'm trying to find the source code for v1.61.1 but I can't seem to find > anything earlier than v1.77.1 publicly available. > > Is there a public archive that goes back prior to v1.77.1? > > Th

[web2py] Re: Check to delete:False

2012-03-29 Thread Anthony
SQLFORM takes "delete_label" and "separator" arguments. Previously (at least up to 1.99.2), delete_label defaulted to "Check to delete:", and the separater was not appended. At some point since 1.99.2, it was changed -- now delete_label defaults to "Check to delete", and separator (which defaul

[web2py] Re: database foreign key question

2012-03-29 Thread Alan Etkin
For counting SkillLevels that match a Skill with name "toto" you can use this: if db((db.SkillLevel.Skill == db.SkillLevel.id) & (db.Skill.Nom == "toto")).count() == 0: Select the first item by Nom (for Nome a string): # you can make .last() or simply .select(), which will return a Rows object

[web2py] Re: database foreign key question

2012-03-29 Thread Alan Etkin
Sorry the first query was wrong: if db((db.SkillLevel.Skill == db.Skill.id ) & (db.Skill.Nom == "toto")).count() == 0: On Thursday, March 29, 2012 11:01:14 AM UTC-3, Alan Etkin wrote: > > For counting SkillLevels that match a Skill with name "toto" you can use > this:

[web2py] Re: Python Negative Popularity

2012-03-29 Thread monotasker
I'm not convinced that the stats you cite about Python are statistically meaningful over a one-year period (2.45% decline?). But it seems to me that on the web the key issue is browser integration. JavaScript is the default language of the web because browsers all interpret it internally. PHP,

Re: [web2py] Re: Python Negative Popularity

2012-03-29 Thread Ovidio Marinho
I believe in what you speak. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Br

[web2py] Re: [NFiT] upload fields has a retrieve_fileproperties function

2012-03-29 Thread szimszon
Sent a patch to google code: http://code.google.com/p/web2py/issues/detail?id=742 2012. március 29., csütörtök 15:32:01 UTC+2 időpontban Alan Etkin a következőt írta: > > Shouldn't it be called ..retrieve_file_properties? > > On Thursday, March 29, 2012 5:58:35 AM UTC-3, szimszon wrote: >> >> 20

[web2py] Re: web2py icon/logo?

2012-03-29 Thread selecta
thanks i thought so, I like the fav icon because of its compact format, unfortunately my poster will be in A0 so it will probably not be my choice, it would be nice if there would be a SVG version of the fac icon for these kind of purposes. I could do it, all I would need to know for that is the

[web2py] Scheduler not working on 1.99.4 do I need to upgrade?

2012-03-29 Thread Cliff
Do I need to upgrade? I have commented out all the code in the task definition and I still get the error. Stack trace ##3 Traceback (most recent call last): File "/media/Myfiles/3-o/gluon/scheduler.py", line 158, in executor

[web2py] Tracking/Tracing actions

2012-03-29 Thread blackthorne
Hello, I am working on a "secure" documentation system that should support file uploads but also to give the ability to trace user actions like download/upload of files. This should be integrated in the portal itself so that the administrator doesn't need to parse web log files and trace users

[web2py] Re: Check to delete:False

2012-03-29 Thread Annet
Hi Alan and Anthony, I upgraded to 1.99.7 from 1.99.2 to solve my represent problem, to solve the check to delete problem I had to change separator=False to separator='' @Anthony, thanks for your explanation. Seems like I chose the wrong solution on 02/08/2011 to solve the colon problem in SQLF

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Willoughby
I have an internally used system that was built on that version and has run several years on it. Unfortunately the code blows up with current web2py - something about 'updateable' views no longer being allowed. Also unfortunately the original team didn't use source control - so I don't have a cl

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Phyo Arkar
BTW , anyone knows if pypy works with web2py? I cant get it working. On Thu, Mar 29, 2012 at 7:12 PM, Xiaofeng Tang wrote: > 2012/3/29 20:39:38 Xiaofeng Tang : > > Sergi Pons Freixes Wrote: > > 2012/3/29 Jonathan Lundell : > >> Latest 2.7. > > I thought 2.5 was the recommended option for web2py.

Re: [web2py] Re: web2py icon/logo?

2012-03-29 Thread Bruno Rocha
In download page there is s link to download the artwork in .png high resolution. http://zerp.ly/rochacbruno Em 29/03/2012 11:57, "selecta" escreveu: > thanks i thought so, I like the fav icon because of its compact format, > unfortunately my poster will be in A0 so it will probably not be my ch

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Anthony
> > Unfortunately the code blows up with current web2py - something about > 'updateable' views no longer being allowed. > What does "updateable views" mean? Are you talking about generic views? If so, they can be enabled via the following in a model file: response.generic_patterns = ['*'] Tho

[web2py] Re: web2py icon/logo?

2012-03-29 Thread Anthony
On Thursday, March 29, 2012 10:56:47 AM UTC-4, selecta wrote: > > thanks i thought so, I like the fav icon because of its compact format, > unfortunately my poster will be in A0 so it will probably not be my choice, > it would be nice if there would be a SVG version of the fac icon for these > k

Re: [web2py] 2.6, 2.7, 3.2, PyPy ... wich one to use?

2012-03-29 Thread Vasile Ermicioi
works for me on windows, but first was needed to put a copy of sqlite dll in the pypy folder

Re: [web2py] SQLFORM.grid not doing what I want :)

2012-03-29 Thread Massimo Di Pierro
When you say "I want to manipulate db.lvdisksetup but in stead it manipulates db.lvdisk" what do you mean by "manipulates"? On Wednesday, 28 March 2012 22:58:31 UTC-5, Gwayne aka Mike Veltman wrote: > > Gentle people, > > I have the following grid: > > query = ( (db.lvdisksetup.lvgroupname_

[web2py] Re: How to Save Query in Session

2012-03-29 Thread Massimo Di Pierro
I think it would be nice to have a way to serialize DAL queries. The problem is should the serialization be database dependent or not. If database dependent it is easy because we can just store the SQL. Yet it would not work for noSQL. My dream has always be to have a non-database-dependent ser

[web2py] Re: time field in DAL? when I retrieve it, it gives me as nontype instead of time type.

2012-03-29 Thread Massimo Di Pierro
default_time = datetime.time(12,00) (row.start_hour or default_time) > request.now.time() On Thursday, 29 March 2012 02:50:12 UTC-5, Kenny wrote: > > I tried to compare by doing > > {{=row.start_hour > request.now.time()}} > > start_hour is defined as 'time' > > error : > > TypeError: can't compa

[web2py] Re: Dynamically create form ?

2012-03-29 Thread Massimo Di Pierro
yes. A helper (a FORM) acts as a list. You can append(), insert() and del its elements. So this: form.add("%s : "%l,INPUT(_name="%s"%l)) Should probably be form.append(SPAN(LABEL(I),":",INPUT(_name=l))) On Thursday, 29 March 2012 07:14:01 UTC-5, bussiere adrien wrote: > > is there a way to dy

[web2py] Re: Python Negative Popularity

2012-03-29 Thread Massimo Di Pierro
I believe the non-backward compatibility of Python 3.0 and the monopolization of major conferences by Django (which was great 5 years ago but it loses to most of the other frameworks by now) are part of the cause. The other cause I think the raise of multi core processors. Python does not handl

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Massimo Di Pierro
The earliest I have is 1.80.1. Yet, it should work with the latest. Send me the error you get and I will be happy to take a look. Massimo On Thursday, 29 March 2012 10:46:20 UTC-5, Anthony wrote: > > Unfortunately the code blows up with current web2py - something about >> 'updateable' views no

[web2py] Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Simon Bushell
hi all, So I am coding a little app that acts as a sort of url shortener (like bit.ly). Visiting *myapp.com/tcgata* will search my database for an URL linked to ' tcgata' My reading of the documentation suggests that this can be achieved using pattern-based URL rewriting in routes.py. As such

Re: [web2py] Re: Python Negative Popularity

2012-03-29 Thread Ovidio Marinho
My only fear would be a discontinuity in python research with advances in processors andthere'd be a hands tied. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br

[web2py] Re: Python Negative Popularity

2012-03-29 Thread blackthorne
I'm not an expert in statistics but 2.45% decline is a lot because that relates to the whole language ecosystem. If you look at the numbers specific to Python, it means a drop from ~7% to ~3% which is about 50% decrease concerning what Python was a year ago. Now, this a metric, it's value,it's

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Anthony
> > The earliest I have is 1.80.1. The downloads at http://web2py.com/examples/static/1.80.1/web2py_src.zip go back to 1.80.1. Google Code goes back to 1.77.1: http://code.google.com/p/web2py/source/browse/?name=R-1.77.1. Anthony

[web2py] wb2py with existing database

2012-03-29 Thread rdodev
All, Is it possible to have the DAL create/discover models from an existing DB (without providing the schema)? If so, how would I go about making sure the models are created? Thanks in advance.

[web2py] Re: wb2py with existing database

2012-03-29 Thread Anthony
Check out this script: http://code.google.com/p/web2py/source/browse/scripts/extract_pgsql_models.py. You may need to adapt it slightly for your particular database. Anthony On Thursday, March 29, 2012 1:14:56 PM UTC-4, rdodev wrote: > > All, > > Is it possible to have the DAL create/discover

Re: [web2py] Re: wb2py with existing database

2012-03-29 Thread Ruben Orduz
Let me check it out. Looks promising. On Thu, Mar 29, 2012 at 1:18 PM, Anthony wrote: > Check out this > script: http://code.google.com/p/web2py/source/browse/scripts/extract_pgsql_models.py. > You may need to adapt it slightly for your particular database. > > Anthony > > > On Thursday, March 29

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Willoughby
Thanks for the help! Traceback below. "Accounts" is a view on my SQLServer DB. Looking at it, wonder if it's a difference in PYODBC versions between prod and my desktop. Traceback (most recent call last): File "C:\web2py\gluon\restricted.py", line 205, in restricted exec ccode in enviro

[web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread rdodev
Having recently completed my own personal URL shortener app on web2py, the trick was using pattern based routes at the root level. Actually, even for a fairly complex work-related app we had to use the root-level routes.py as well. Specially with an URL shortener, you want to have the URL as sma

[web2py] Re: wb2py with existing database

2012-03-29 Thread pbreit
Also one for MySQL: http://code.google.com/p/web2py/source/browse/scripts/extract_mysql_models.py

Re: [web2py] Re: Python Negative Popularity

2012-03-29 Thread Vasile Ermicioi
I think pypy have a few of that - promising LTS - python 2.x is their main branch - includes an implementation of greenlet - numpy is being developed and already part of pypy - Armin Rigo is working on STM latest pypy works with web2py, and integration of pypy+uwsgi is in progress

[web2py] Re: wb2py with existing database

2012-03-29 Thread Anthony
On Thursday, March 29, 2012 1:26:54 PM UTC-4, pbreit wrote: > > Also one for MySQL: > > http://code.google.com/p/web2py/source/browse/scripts/extract_mysql_models.py > I think the other one is a little more thorough, so may be better even for MySQL.

Re: [web2py] Re: wb2py with existing database

2012-03-29 Thread Ruben Orduz
Nice. Actually I think tweaking the one Anthony provided will be easier since this DB is a mongoDB instance, and all fields have the same type (and no relationships to speak of). On Thu, Mar 29, 2012 at 1:26 PM, pbreit wrote: > Also one for MySQL: > http://code.google.com/p/web2py/source/browse/s

[web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Anthony
> > routes_in = ( > (r'^/?$', r'/app_name/default/index'), > (r'^/(?P[^/]*)/?$', r'/app_name/default/index/\g'), > > ) > > > in your root-level routes.py The drawback is that you will lose access to > all other apps (including admin) but that can

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Massimo Di Pierro
I am pretty sure this is not an effect of the upgrade of web2py. This is an error from the database saying it it no able to perform and "UPDATE" record on the "Accounts" view because is "affects multiple base tables". I cannot say if the problem is the version of the database driver. On Thursda

Re: [web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Ruben Orduz
Good point, Anthony. I forgot they are evaluated in order. So you can declare them explicitly before the generic pattern and achieve the same result. For bonus points, OP, you should make it RESTful like I did with mine and then heavily leverage the default layout :) Mine's currently up at the supe

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Willoughby
Okay, thank you for taking a look. It's the same application pointing to the same view in the same DB though, so you can understand my confusion. I'll try Anthony's suggestion of v1.77 - if that fails as well I guess I'll try downgrading some drivers. I'm REALLY not ready to rewrite this thing

[web2py] Login username fake ending character

2012-03-29 Thread Bruce Wade
Hi, I need to be able to add a character to the end of a username that can be changed by us. This character is not actually stored in the database for the username however it must be entered for the username to validate. For example: username: 012 -> is stored in the database Login with: 000

[web2py] how do I use response.render or response.view to return a .csv file, as if using /default/index.csv

2012-03-29 Thread Paul
Simple example:- I have an index() controller thats sets some variables. I have a view default/index.html that displays the variables. I have another view default/index.csv that renders the variables (e.g. as a,b,c) and this downloads ok as a file (with filename index.csv) if I visit the url

Re: [web2py] how do I use response.render or response.view to return a .csv file, as if using /default/index.csv

2012-03-29 Thread Vasile Ermicioi
add that response.headers['Content-Type']='text/csv'

Re: [web2py] Login username fake ending character

2012-03-29 Thread Marin Pranjić
Yes you can capture the form submit. Instead of: def user(): .. return dict(form=auth()) you can do: def user(): .. #TODO validate submitted username .. if request.args(0) == 'login' and request.post_vars.username: .. .. request.post_vars.username = request.vars.username = request.post_vars.user

[web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Simon Bushell
This is a neat solution Anthony (actually, it was my original idea for solving this). however I seem to be getting the same error: *invalid function (default/tcgata)*. Forgive me, is this code in the root-level routes.py? or a routes.py in * applications/shortener*? Should anything else be in

Re: [web2py] Login username fake ending character

2012-03-29 Thread Bruce Wade
Thanks that works exactly how I need it to. On Thu, Mar 29, 2012 at 11:22 AM, Marin Pranjić wrote: > Yes you can capture the form submit. > Instead of: > > def user(): > .. return dict(form=auth()) > > you can do: > > def user(): > .. #TODO validate submitted username > .. if request.args(0) == '

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread greenpoise
Will check! Thanks On Wednesday, 28 March 2012 18:59:34 UTC-7, tomt wrote: > > You may be thinking of 'powertable'. This plugin presents a grid that > includes a typeahead search > function. It can be found at https://bitbucket.org/rochacbruno/powertable. > > - Tom > > On Monday, March 26

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread greenpoise
Powertable is the one I was working on. I just wish I could somehow implement an 'add record' function to the + button. On Thursday, 29 March 2012 11:55:33 UTC-7, greenpoise wrote: > > Will check! Thanks > > > > > > > On Wednesday, 28 March 2012 18:59:34 UTC-7, tomt wrote: >> >> You may be

Re: [web2py] Re: time field in DAL? when I retrieve it, it gives me as nontype instead of time type.

2012-03-29 Thread Kenny Chung
Wonderful! Thank you! On Thu, Mar 29, 2012 at 9:05 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > default_time = datetime.time(12,00) > (row.start_hour or default_time) > request.now.time() > > > On Thursday, 29 March 2012 02:50:12 UTC-5, Kenny wrote: >> >> I tried to compare by doi

[web2py] Re: Login username fake ending character

2012-03-29 Thread Anthony
Maybe something like: def check_username(form): if not form.vars.username.endswith('R') form.errors.username = 'Invalid username' auth.settings.login_onvalidation = [check_username] Anthony On Thursday, March 29, 2012 2:09:44 PM UTC-4, Detectedstealth wrote: > > Hi, > > I need to be

Re: [web2py] Login username fake ending character

2012-03-29 Thread Anthony
> > def user(): > .. #TODO validate submitted username > .. if request.args(0) == 'login' and request.post_vars.username: > .. .. request.post_vars.username = request.vars.username = > request.post_vars.username[:-1] # remove last character > .. return dict(form=auth()) > That doesn't check whet

[web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Anthony
> > This is a neat solution Anthony (actually, it was my original idea for > solving this). however I seem to be getting the same error: *invalid > function (default/tcgata)*. > > Forgive me, is this code in the root-level routes.py? or a routes.py in * > applications/shortener*? > > Should an

Re: [web2py] Login username fake ending character

2012-03-29 Thread Bruce Wade
I just used the following because I don't want their login to succeed if they enter no character IE: 012 the real username without the character should also fail. if request.args(0) == 'login' and request.post_vars.username: login_char = request.post_vars.username[-1] if login_

[web2py] Re: Python Negative Popularity

2012-03-29 Thread Derek
I can't agree with you more here, Python 3.0 was a major flop, forcing internationalization down everyone's throats, and screwing up string operations for everyone else. On Thursday, March 29, 2012 9:26:48 AM UTC-7, Massimo Di Pierro wrote: > > I believe the non-backward compatibility of Python

Re: [web2py] Login username fake ending character

2012-03-29 Thread Anthony
> > I just used the following because I don't want their login to succeed if > they enter no character IE: 012 the real username without the character > should also fail. > > if request.args(0) == 'login' and request.post_vars.username: > login_char = request.post_vars.username[-1]

Re: [web2py] Login username fake ending character

2012-03-29 Thread Bruce Wade
Yes I think you are correct, your solution is cleaner and explains the problem. However the last character would still need to be removed so your solution would need to be changed to: def check_username(form): if not form.vars.username.endswith('R') form.errors.username = 'Invalid user

Re: [web2py] Login username fake ending character

2012-03-29 Thread Anthony
Oops, right. In that case, I would reverse the if/else. On Thursday, March 29, 2012 4:11:13 PM UTC-4, Detectedstealth wrote: > > Yes I think you are correct, your solution is cleaner and explains the > problem. However the last character would still need to be removed so your > solution would ne

Re: [web2py] Login username fake ending character

2012-03-29 Thread Marin Pranjić
Is check_username triggered before or after the database validation? I am not able to check it now. Marin On Thu, Mar 29, 2012 at 10:46 PM, Anthony wrote: > Oops, right. In that case, I would reverse the if/else. > > > On Thursday, March 29, 2012 4:11:13 PM UTC-4, Detectedstealth wrote: >> >>

[web2py] Email verification for user registration

2012-03-29 Thread cyan
Hi Group, I am trying to implement a fairly standard procedure for user registration: after a user submits his/her email address, an email is sent, and by clicking on the link contained in that email, the user is registered. How do we implement this without writing anything to the DB until the

[web2py] Re: Python Negative Popularity

2012-03-29 Thread Derek
I don't think it's quite a "fall" just that the pot is bigger and they added "JS" to the "JavaScript" so it's rankings boosted a bit. On Thursday, March 29, 2012 6:42:08 AM UTC-7, Ovidio Marinho wrote: > > The fall of the python's fault Django and Python 3.0? > http://www.tiobe.com/index.php/con

Re: [web2py] Login username fake ending character

2012-03-29 Thread Marin Pranjić
If i am correct this will not work because it should be: 1. check last character 2. remove last character 3. do db validation I think onvalidation does db validation and then 1&2. Db validation will not pass because usernames are stored without last character (as stated in first post). Not sure

[web2py] Re: Versions earlier than 1.77.1?

2012-03-29 Thread Derek
That's one thing about web2py is that it's stated "backwards compatible" throughout the documentation. The error you're having is being thrown by the sql server. If your view is comprised of multiple base tables, your update statement needs to only affect one of those tables at a time. So if th

[web2py] Re: Login username fake ending character

2012-03-29 Thread Massimo Di Pierro
class MyStrangeRequirement(object): def __init__(self,s='R',error_message='forgot the R?'): self.s=s self.error_message = error_message def __call__(self,value): if not (value and value.endswith(self.s)): return (value, self.error_message) re

[web2py] Re: Using routes.py as a dispatcher for URL shortener app

2012-03-29 Thread Simon Bushell
Hmm, this is bizarre. I was aware of the reloading routes and it is still not working. I even made a blank 'shortener' scaffold app and added the routes.py from above at root level. http://127.0.0.1/jujuju gives the same errors as above. I'll muck about a bit more and see whats going wrong. I

[web2py] Agree on some terms before registration

2012-03-29 Thread Hassan Alnatour
Dear ALL, How can i make the user agree to some term using a check box before registration ??

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread Derek
I get what you are saying. I wrote a function (not on web2py, but it's javascript...) // this will capture the 'enter' key when pressed inside the text box, so searching works better. function IEKeyCap(e) { if (e.keyCode == 13) {dsCustomers.filter(myFilterFunc)}; } function FilterData()

[web2py] How to use web2py auth using JavaScript+ajax?

2012-03-29 Thread thstart
I need to do a major rework in order to move client-side functionality to the browser and using Javascript to get more responsive client side experience with no refresh etc. That means web2py will give a rich server side functionality and all client work to be performed via JavaScript and Ajax. I

[web2py] Re: Python Negative Popularity

2012-03-29 Thread thstart
Guido is working for Google. GAE is having Python as a primary language - e.g. all libraries are implemented on Python first, Java and Go next. So we get a priority for Python. So from GAE point of view you better use Python to have an advantage. If not using GAE what alternatives we have? P

[web2py] Re: Primary Key tables in MSSQL. Cannot get them to work

2012-03-29 Thread Derek
Yes, I don't think you can use SQLFORM crud unless you have an 'id' column, or another primary key column that is an INT. On Wednesday, March 28, 2012 5:28:44 PM UTC-7, Andrew wrote: > > Thankyou Derek, > I will give it a try , but this was only a simple, cut down, test case to > get it to work

[web2py] Re: Tracking/Tracing actions

2012-03-29 Thread Derek
Are you getting any error messages? What do you mean by "this is not yet working". On Thursday, March 29, 2012 8:10:38 AM UTC-7, blackthorne wrote: > > Hello, > > I am working on a "secure" documentation system that should support file > uploads but also to give the ability to trace user actions

[web2py] Re: help with IS_IN_DB?

2012-03-29 Thread Derek
What does your view look like? On Wednesday, March 28, 2012 5:41:43 PM UTC-7, drayco wrote: > > I can try to show in form of input and output a dbset, but i want to > modify prices, because it depends of store > > In model > > if store.store_id<7: > armazones = db((db.eyewear.observaciones==

[web2py] Storing class instances in sessions... or somewhere

2012-03-29 Thread Web2py Newbie
I have an existing application that I am trying to get running as AJAX with web2py (locally, but eventually to run on GAE). The application makes use of class instances to store much of the data which would be used for user sessions. I understand that session can't be used to store class insta

[web2py] Re: pop-up verification

2012-03-29 Thread Derek
Take a look at this: http://web2py.com/books/default/chapter/29/7#FORM Specifically this example: db.define_table('numbers', Field('a', 'integer'), Field('b', 'integer'), Field('c', 'integer', readable=False, writable=False)) def my_form_processing(form): c = form.vars.a * form.v

[web2py] Re: Date field mask or another value

2012-03-29 Thread Derek
is certainly a valid year. 99 could be a valid calendar month, depending on your calendar. You should probably specify what the valid range of values are. Try the IS_MATCH with a regex. On Tuesday, March 27, 2012 8:05:11 AM UTC-7, Adriano Almeida wrote: > > Hi, > > I want a field (may be s

[web2py] Re: Email verification for user registration

2012-03-29 Thread pbreit
Web2py has some functionality built-in that may work for you. In a model file: auth.settings.registration_requires_verification = True I don't know the exact behavior.

[web2py] Re: Agree on some terms before registration

2012-03-29 Thread Massimo Di Pierro
add a boolean field to the registration page and require it to be true auth.settings.custom_fields['auth_user'].append(Field('agree','boolean',requires=IS_NOT_EMPTY(error_message='you must agree this'))) On Thursday, 29 March 2012 17:15:31 UTC-5, Hassan Alnatour wrote: > > Dear ALL, > > How can

Re: [web2py] Tracking/Tracing actions

2012-03-29 Thread Francisco Gama
I need to create a form that submits files and at the same time, stores the user who did it, the name of the file, its hash, the time. Other things like his IP address, his web client would be interesting as well. I see two ways: 1) some sort of method tracing (a decorator maybe) that informs me

  1   2   >