[web2py] Re: Caching downloads

2010-06-30 Thread Chris S
7;')[:10] == > 'attachment': >                     response.headers['Content-Disposition'] = > 'attachment' >                 response.stream(static_file, request=request) > > On 30 Giu, 15:42, Chris S wrote: > > > I'll take a look and see

[web2py] Re: Caching downloads

2010-06-30 Thread Chris S
= parse_url(request, environ) >             if static_file: >                 if request.env.get('query_string', '')[:10] == > 'attachment': >                     response.headers['Content-Disposition'] = > 'attachment' >                 resp

[web2py] Re: sql.py error?

2010-07-01 Thread Chris S
ke somehow the same SQL Row instance is being 'reused' for > > > creating a new row > > > which I would not expect to happen. > > > > - Dave Lypka. > > > > On Jun 30, 1:03 am, Yarko Tymciurak > > > wrote: > > > > &g

[web2py] Re: markmin, t2, t3, cube9 etc. (important update)

2010-07-07 Thread Chris S
I've just loaded this from the mercurial source listed on google code. Running on GAE (local dev server) and using the Web2py trunk I'm getting: ReservedWordError: Cannot define property using reserved word 'parent'. If you would like to use this name in the datastore consider using a different n

[web2py] Re: /admin/design/MyApp very slow over 12 seconds

2013-03-31 Thread Chris Haubner
e data as this may not be that easy to uncover ;) Chris On Saturday, March 30, 2013 3:29:48 AM UTC-4, BlueShadow wrote: > > Hi, > my admin/design is very slow (over 12 seconds) and my app isn't that big. > 9Models, > 2 Controllers (1 with 33 functions, 1 with 11), > 44 vie

[web2py] Re: need teaching advice (JS+jQuery)

2013-04-06 Thread Chris May
On Wednesday, April 3, 2013 3:10:23 PM UTC-4, Derek wrote: > > Flickr, Panaramio, RSS to JSON (http://ejohn.org/projects/rss2json/) > Yahoo YQL (http://developer.yahoo.com/yql/guide/response.html), Twitter, > Salesforce.com... > > One thing that bugs me is that jQuery returns jQuery objects not

[web2py] Re: need teaching advice (JS+jQuery)

2013-04-06 Thread Chris May
Your date has passed, so I don't know how useful this will be, but when I introduce people to jQuery, I usually start with fun, gimmicky things, like changing all the images in a web page to photos of cats: jQuery('img').each(function() {var my = jQuery(this); my.attr('src','http://www.placekit

[web2py] Re: Server-Sent Events

2013-04-06 Thread Chris May
Wow. It's cool that web2py ships with a websockets implementation. I was also thinking like Arnon about how to implement server-sent events with web2py. As such I do want to add, maybe for posterity sake, that websockets serve a different use case than server-sent events, and are more complicat

[web2py] write place for a sql query

2013-05-19 Thread Chris Teodorski
base calls, both queries and updates? Thanks for the help. Chris -- --- 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...@google

[web2py] Re: write place for a sql query

2013-05-19 Thread Chris Teodorski
ion > > On Sunday, May 19, 2013 8:37:32 PM UTC+2, Chris Teodorski wrote: >> >> I have a form, that users submit -- when they submit the form, I want to >> validate it against valid data in the database, but I'm not sure where that >> query belongs. I was trying

[web2py] Referencing auth_user custom field in another table

2013-05-19 Thread Chris Teodorski
#x27;, label=T('Chal1')), Field('f_chal2', type='boolean', label=T('Chal2')), Field('f_chal3', type='boolean', label=T('Chal3')), Field('f_chal4', type='boolean',

[web2py] Re: write place for a sql query

2013-05-19 Thread Chris Teodorski
=after_insert > > On Sunday, May 19, 2013 11:26:23 PM UTC+2, Chris Teodorski wrote: >> >> The event is tied to the submit, in this case, it's basically a "test" >> question. When the correct answer is submitted by the user (based upon a >> check of t

[web2py] Re: Referencing auth_user custom field in another table

2013-05-20 Thread Chris Teodorski
What I'm trying to do -- and obviously not explaining well is to have t_teams.name to be a foreign key for the field custom field in auth_users. Does that explain it any better? On Monday, 20 May 2013 02:59:00 UTC-4, Niphlod wrote: > > uhm. > what do you want (as examples) in auth_user.team_nam

[web2py] Re: Referencing auth_user custom field in another table

2013-05-20 Thread Chris Teodorski
ms', > Field('name', db.auth_user, > requires=IS_IN_DB(db, 'auth_user.id', '%s(team_name)s'), > represent=lambda id, r: db.auth_user(id).team_name)) > > Anthony > > On Monday, May 20, 2013 7:49:49 AM UTC-4, Chris Teodorski wrote:

[web2py] Re: Referencing auth_user custom field in another table

2013-05-20 Thread Chris Teodorski
fields to the auth_user table and not bother with having a secondary table. Chris On Monday, 20 May 2013 09:47:14 UTC-4, Chris Teodorski wrote: > > I'm going to give this a try -- but I'm honestly not sure exactly what > this field definition does. I'm going to play w

[web2py] Re: Referencing auth_user custom field in another table

2013-05-20 Thread Chris Teodorski
Monday, 20 May 2013 11:43:13 UTC-4, Anthony wrote: > > I assumed this was a one-to-many relationship, but given that it is > actually one-to-one, you certainly could just put the t_teams fields > directly in the auth_user table. > > Anthony > > On Monday, May 20, 2013

[web2py] Re: Referencing auth_user custom field in another table

2013-05-23 Thread Chris Teodorski
Anthony, How do I set them to writable when I need them to be? I'm attempting to update them in a controller and I'm not sure how to do it.... Chris On Monday, 20 May 2013 12:19:32 UTC-4, Anthony wrote: > > Setting a field's "writable" attribute to False p

[web2py] Re: Referencing auth_user custom field in another table

2013-05-23 Thread Chris Teodorski
le=True print row row.challenge = True row.update_record() db.commit() On Sunday, 19 May 2013 22:38:48 UTC-4, Chris Teodorski wrote: > > I will try my best here to explain what I'm after -- I'm clueless on how > to do it. I added a custom field to db.aut

[web2py] Re: Referencing auth_user custom field in another table

2013-05-24 Thread Chris Teodorski
Anthony, Once again, thanks for the help. Chris On Sunday, 19 May 2013 22:38:48 UTC-4, Chris Teodorski wrote: > > I will try my best here to explain what I'm after -- I'm clueless on how > to do it. I added a custom field to db.auth_user called team_name. Each > regis

[web2py] Preventing repeated submissions, or rate limiting submissions

2013-05-28 Thread Chris Teodorski
for your ideas, Chris -- --- 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: Preventing repeated submissions, or rate limiting submissions

2013-05-28 Thread Chris Teodorski
On Tuesday, 28 May 2013 15:35:48 UTC-4, Niphlod wrote: > If your problem lies into the realm of "this form shouldn't be submitted > more than 5 times in 5 seconds" you can play a little bit with your > controller > That is exactly what my problem is, or what I'm trying to prevent. -- --

[web2py] Re: Preventing repeated submissions, or rate limiting submissions

2013-05-28 Thread Chris Teodorski
5 seconds > (i.e. do you allow short bursts/peeks) or just something that prevents > bruteforce and allows 1 submit in a second (pretty irrelevant waiting-time > for a "human user")? > > On Tuesday, May 28, 2013 9:39:12 PM UTC+2, Chris Teodorski wrote: >> >> O

[web2py] changing default redirect after failed login attempt.

2011-11-10 Thread Chris Steel
efault redirect URL on a failed login to be the new location of my user function or get this working some other way? Thanks -- Chris

Re: [web2py] newbie question

2011-11-19 Thread Chris Hawkes
sorry guys i hit enter to soon, disregard this question On Sat, Nov 19, 2011 at 6:33 PM, chawk wrote: > db.define_table('discussion', >Field('comment', 'text')) > > def comment(): >form = SQLFORM(db.discussion, _class='test1') >if form.process().accepted: >redirec

[web2py] Re: ttf and fonts

2011-12-02 Thread Chris May
It looks like you're going about it fairly well, but I also had issues with particular truetype fonts. Those issues went away after I changed which truetype font I used. This is the code that works for me: @font-face { font-family: myFont; src: url('../static/Qarmic_sans_Abridged.ttf')

Re: [web2py] Re: Google Groups problem

2011-12-06 Thread Chris May
Thanks for the reminder for feedback! There were several times that Google Groups was telling me that x number of posts were updated, but showed all as read. I noticed that just before I read this post, they just pushed out an update to the Groups software. Hopefully that'll fix it.

[web2py] Re: Massimo

2011-12-08 Thread Chris May
I second that! We are truly blessed to have so many great, patient and available contributors to the code and the community! Anthony, do you have the book memorized yet? :D

[web2py] Re: Backbonejs in web2py

2011-12-14 Thread Chris May
As with so many things in web development, it depends on your application. web2py is a complete framework to set up an environment for your application to run. Backbone.js can extend web2py's functionality to provide complex client-side interactions. I think it can be a great idea, if the desig

[web2py] Re: Backbonejs in web2py

2011-12-14 Thread Chris May
Nice example! I love how snappy the site navigation is. That is one benefit I expected from using backbone, with the potential for so much less data being transferred for view changes over normal page refreshes.

[web2py] Re: haml and sass

2011-12-19 Thread Chris May
Curious. I've surprisingly not heard of haml. What would you say are the benefits over web2py's built-in HTML helpers? SASS could be quite helpful for us front-end guys, and I notice there are a couple of python modules out there. My opinion is that I don't know if it would need to be included

[web2py] Controller file size question

2012-01-12 Thread Chris Hawkes
What is the largest advisable file size limit for a controller file using Google appengine? Sent from my Samsung smartphone on AT&T

Re: [web2py] Need a instruction for Rating Plugin

2012-01-12 Thread Chris Hawkes
I did take a look at that myself. I find it much harder to figure out how to apply a plugin to my design then to just do it all over myself specific to my design. If you are beginner it will be a nightmare. You should prabably make your own with simple form variables using jquery and CSS to

Re: [web2py] Re: Is it me or what?

2012-01-13 Thread Chris Hawkes
Thanks for all the comments and suggestions. There will be a major content fix over the weekend. I will fix many dead links and I am adding an additional 200 bands or so. I am also adding more dynamic content over the next couple of weeks. Sent from my Samsung smartphone on AT&T Likit wr

Re: [web2py] Re: New Site for web2py poweredby

2012-01-14 Thread Chris Hawkes
It looks a ton better, good job! On Sat, Jan 14, 2012 at 12:21 PM, Andrew Evans wrote: > Hello I think I finished the styling :-) > > its not perfect I am sure :-P I think the green at the top of the thread > could be replaced (if only I could find where in the style sheet it is) > > anyway here

Re: [web2py] Re: controller question

2012-01-14 Thread Chris Hawkes
I broke the controllers into much smaller sizes. My site does not seem to be too much of a memory hog at this time. I will probably try to find ways of making it more efficient in the near future, but have tons of other stuff to do in the meantime. On Fri, Jan 13, 2012 at 4:45 PM, howesc wrote:

[web2py] Re: Python / web2py or.... the learning path?

2012-01-17 Thread Chris May
There are indeed a *lot* of PHP tutorials and articles out there. Most of them are of little value in general, or even misleading readers into bad practices (as referenced by Christian Heilmann in a recent post on Smashing Magazine

[web2py] Re: Need help with drag-n-drop using jQuery

2012-01-20 Thread Chris May
Hello, Frank, Welcome to web2py! I am also relatively new to web application development. I threw your code into a new application, and I get very fast responses, usually in a fraction of a second. I don't know exactly why I have a dramatic difference in speed, but I do notice one thing that mi

[web2py] Re: (OT) Choosing a javascript mvc framework

2012-01-23 Thread Chris May
This might be too late for your application, but I just saw this review of 12 MVC frameworks. http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ Quoted from the page: > Specifically, the following four features are very important to me: > UI Bindings - I’m not just tal

[web2py] [OT] e-mail delivery strategies

2012-01-31 Thread Chris May
This is off-topic, but since a fair number of web2py users send e-mail from their applications, I thought this post from 37Signals might prove helpful to some. There were nearly 16 million e-mails sent from 37Signals' eight web applications in the last seven days. About 99.3% of them were accep

[web2py] Re: I would like to learn Web2py but where do I start?

2012-02-23 Thread Chris May
One caveat: While I agree that w3schools is a helpful resource (as I use it as a regular reference), their examples do not promote best practices, most notably absent is unobtrusive JavaScript. I had to *unlearn much *of what I read on there. For more information and better resources, include

Re: [web2py] Re: Photo Gallery

2012-02-24 Thread Chris Hawkes
Sent from my Samsung smartphone on AT&T Anthony wrote: >Lightbox is a client-side Javascript library and doesn't really have >anything to do with web2py -- as long as you set it up properly, it should >work with web2py (or any backend framework). If you show some code, though, >perhaps we c

Re: [web2py] Re: Photo Gallery

2012-02-24 Thread Chris Hawkes
Noobmusic.com uses lightbox with Google app engine. You probably need to show us the entire page you are trying to get to work. Your problem is probably something to do with class names or JavaScript includes. Sent from my Samsung smartphone on AT&T Anthony wrote: >Lightbox is a client-sid

[web2py] Re: web2py site and disabling browser right clicks

2012-03-09 Thread Chris May
I agree with Wikus. Just by having a web site out in the public means just that. Don't publish anything that you wouldn't want printed in newspapers or announced to your grandmother. :) You may be different, but every one who has asked me to prevent users to view source code did not care about

[web2py] Re: web2py site and disabling browser right clicks

2012-03-09 Thread Chris May
I'm sorry, Rahul. I may have misunderstood the reason behind your post, as I have heard similar requests in my time as a front-end developer. However, seeing that the site in your signature does potentially show sensitive information, the best thing I can recommend is to not send any more sensi

[web2py] another component question

2010-11-10 Thread Chris Baron
eate components via javascript? Is it simply just calling a function in the views/ web2py_ajax.html view ? Thanks in advance, Chris

[web2py] working script to install virtualenv and then install and start web2py

2010-11-24 Thread Chris Steel
o create a directory in the users home directory automatically Cheers, Chris -- Christopher Steel Voice of Access setup-virtualenv-install-web2py.sh Description: Bourne shell script

[web2py] python list serialization to json

2010-12-30 Thread Chris Baron
In my controller: def default(): f=open('/tmp/debug','w') f.write( str( request.vars.tabs ) )f.write( '\n' ) f.write( response.json(request.vars.tabs) ) return dict( tabs = response.json(request.vars.tabs) ) In /tmp/debug ["{'text': 'Tree List', 'args': {'trees': 'db.tree.id

[web2py] Re: python list serialization to json

2010-12-30 Thread Chris Baron
Its not my day for posting. request.vars.tabs is a list of strings in python when it gets to the controller. The response.json does exactly what its supposed to do. Sorry for the spam. On Dec 30, 12:59 pm, Chris Baron wrote: > In my controller: > > def default(): >     f=open(&#x

[web2py] Re: Multi Tabbed Menu - Any Suggestions.

2011-01-06 Thread Chris Baron
http://jqueryui.com/demos/tabs/ You could also try writing your own if you're not happy with the way it works. Use the jquery code as a reference. On Jan 5, 11:58 pm, "David J." wrote: > I was wondering if anyone on the list has seen an good multi-level > horizontal tab menu. > > I have > > >

[web2py] Re: Speed of rendering html data (10,000+ rows)

2011-06-21 Thread Chris May
Have you tried pasring the data using your 0.078 second method into a json format and using jQuery to parse it?

[web2py] Janrain login_next

2011-06-24 Thread Chris Baron
ng. What's going on here ? Thanks in advance, Chris

[web2py] Re: experimental in trunk... common_fields and precints

2011-06-25 Thread Chris S
This is great, I've been away from web2py for about a year now and this feature is exactly what I was trying to do quite some time ago by manually storing and filtering by a SiteId. A couple of questions. 1 - Is there a way to over ride the filter if you do not want it, for say Administration? 2 -

[web2py] Re: experimental in trunk... common_fields and precints

2011-06-25 Thread Chris S
Ah there was one other scenario I meant to as. Can you have an entry in the table which, when filtered, always passes? Here I'm thinking about a cross-site admin that could register a single time and be retrieved from any of the accessing URL's. On Jun 25, 7:08 pm, Chris S wrote:

[web2py] Re: experimental in trunk... common_fields and precints

2011-06-26 Thread Chris S
So does that mean tables defined before: db._common_fields=[Field('request_precinct',default=request.env.http_host,writable=False,readable=False)] Don't get populated with the common field? If so that's great, lets you define which tables get fields, or even have several levels of "common fields".

[web2py] Re: proper way to mobile and desktop 'skins'

2011-06-28 Thread Chris May
Are you sending different content to either desktop or mobile devices? If you aren't, you could use the "responsive web design" approach (http://www.alistapart.com/articles/responsive-web-design/ or http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/) or the "mobile

[web2py] Re: estore

2011-07-05 Thread Chris May
I sure hope so... The only thing I have been looking to is Massimo's brief tutorial on credit card payments http://groups.google.com/group/web2py/msg/00df672fe3d67aab On Jul 5, 4:48 am, apple wrote: > Is this no longer maintained? It does not seem to be available to > dowload. > > Are there any

[web2py] Re: jQuery .focus()

2011-07-18 Thread Chris May
To select an element by ID in jQuery, you can use the CSS-like syntax #id. jQuery("#key1).focus(); Your jQuery("input.key1").focus(); statement told jQuery to look for an input with the class property of "key1". On Jul 18, 3:54 am, annet wrote: > In web2py_ajax.html I have the following line o

[web2py] powertable ( multiple tables on the same page )

2011-07-18 Thread Chris Baron
How do you do it ? Here is my controller : ownDataSource = db( db.gtree.contributor == ' '.join( [ auth.user.first_name, auth.user.last_name ] ) ).select() class ownVirtualFields(object): @virtualsettings(label='Tree') def tree_url(self): gtree = self.gtree.id

[web2py] Re: powertable ( multiple tables on the same page )

2011-07-18 Thread Chris Baron
t; different class and id to the tables. > > On Mon, Jul 18, 2011 at 12:57 PM, Chris Baron wrote: > > > > > > > > > > > How do you do it ? > > > Here is my controller : > > > ownDataSource = db( db.gtree.contributor == &#x

[web2py] Re: Running web2py on Jython

2011-07-19 Thread Chris Clark
b2py\hg_20110714\web2py\applications\examples \controllers/defau lt.py", line 13, in index return response.render() File "C:\svn\web2py\hg_20110714\web2py\gluon\globals.py", line 173, in render run_view_in(self._view_environment) File "C:\svn\web2py\hg_20110714\web2py\gluon\compileapp.py", line 514, in run_ view_in restricted(ccode, environment, layer) File "C:\svn\web2py\hg_20110714\web2py\gluon\restricted.py", line 205, in rest ricted raise RestrictedError(layer, code, '', environment) RestrictedError WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking Is there an easy way to disable the auto importer/compiler? This may be the easiest way to make progress with Jython support. The importer code is complex enough that I'm not sure I can contribute more help :- ( Chris

[web2py] Re: powertable ( multiple tables on the same page )

2011-07-20 Thread Chris Baron
ry hevy for the group mail. > > >> > 2011/7/18 Bruno Rocha > > >> > > include ownTable._id = "something" and ownTable._class = "something" > >> to set > >> > > different class and id to the tables. &g

[web2py] Re: powertable ( multiple tables on the same page )

2011-07-20 Thread Chris Baron
On Jul 20, 9:40 am, Chris Baron wrote: > Thank you for the prompt responses. > > On Jul 19, 4:12 pm, Roberto Perdomo wrote: > > > > > > > > > Hello, it's me again. > > > Well, I discovered that the problem of loading the table with "load&qu

[web2py] Re: powertable ( multiple tables on the same page )

2011-07-20 Thread Chris Baron
e dict. > > 2011/7/20 Chris Baron > > > > > > > > > I'm still having a problem getting two powertables on one page.  If I > > comment out the code for the second powertable, everything is fine, > > but it seems the first powertable can't

[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Chris May
Hey Ross, thanks for starting this discussion. And what a timely discussion, considering today's Smashing Magazine article is a roundup of Responsive Design (RD) patterns. (www.smashingmagazine.com) (For those unfamiliar with RD, also check out A List Apart for a great intro: http://www.alistapart

[web2py] Re: Running web2py on Jython

2011-07-25 Thread Chris Clark
On Jul 23, 2:08 pm, Richard wrote: > Hi Chris, > > I for one am glad that you reanimated this thread :-) > > Your findings probably led to hg commit #2119 which has the commit > comment "possible __builtin__ fix for jython, thanks Chris Clark". > This raised som

[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-26 Thread Chris May
I agree. It's very important to not annoy the site visitor by forcing him into one view / solution / experience. Judging by the parallel discussion in the developer group (http:// groups.google.com/group/web2py-developers/browse_thread/thread/ 2056602a6c30af27#) and the corresponding issue request

[web2py] nix python from scratch installer

2011-08-01 Thread Chris Steel
Web2py is trivial to install but sometimes Python is not, especially on older MacBook Pro's that are not worth upgrading to the latest version of OS X. Anyway this morning I remembered using the Plone Unified installer some time ago and to make a long story short, it is still able to install a san

[web2py] Fwd: nix python from scratch installer

2011-08-01 Thread Chris Steel
Opps, Mercurial users will want to do this instead: hg clone https://code.google.com/p/uc-unified-python-installer/uc-unified-python-installer (remove my gmail user name...) C. -- Forwarded message -- From: Chris Steel Date: Mon, Aug 1, 2011 at 12:28 PM Subject: nix python

[web2py] proposed pip installer for an "out of the box" web2py experience

2011-08-03 Thread Chris Steel
tallation packages for systems like debian and Windows and so on and so forth. http://www.web2pyslices.com/slices/take_slice/141 Let us know what you think. Thanks, Chris -- Christopher Steel Voice of Access

[web2py] pip install web2py

2011-08-10 Thread Chris Steel
g you will have no problem with this since you are going for the option clearly marked as "advanced" right ; ) I would like to rename or combine these commands are some point in time for various reasons, some outline in the commands docstrings. Comments welcomed. Enjoy, Chris

Re: [web2py] Re: Server side form validation

2011-08-29 Thread Chris Rowson
Thanks for the rapid reply Massimo, It is much appreciated. Chris On Aug 30, 2011 12:23 AM, "Massimo Di Pierro" wrote: > Validation is always performed server side. > > if you use FORM(INPUT()) that each input gets its own > requires=[..] > > if you

[web2py] Storing logged on user in database

2011-08-30 Thread Chris Rowson
r=request, f='index')) elif form.errors: response.flash = 'form has errors' return dict(form=form) -- My intention is to collect the provider and speed data with SQLFORM and for the logged on user id and the timestamp to be automatically populated. As you can see, I have used a decorator on the adddata function to require a logged on user. Does this look right to you? Thanks in advance! Chris

Re: [web2py] Re: Storing logged on user in database

2011-08-30 Thread Chris Rowson
p.python.web2py/44801 Seems to indicate that the problem is caused because the session no longer exists and therefore auth_user.id is none. :-S Chris

Re: [web2py] Re: Storing logged on user in database

2011-08-30 Thread Chris Rowson
ough in reality 'None' should never be recorded in the database because the decorator on the data entry function requires the user to be logged in). Seems to work for me as far as I've tested. What do you think? Chris

Re: [web2py] Re: Storing logged on user in database

2011-08-31 Thread Chris Rowson
me as auth.user.id (i.e. the id of the current logger in user) or None. > I've replaced my early change with auth.user_id and that works too. Thank you :-) Chris

[web2py] SQLFORM validator question

2011-08-31 Thread Chris Rowson
following error: (unhashable type: 'list') What am I doing wrong? :-S Thanks Chris

Re: [web2py] Re: SQLFORM validator question

2011-08-31 Thread Chris Rowson
Ah cool. Thanks, Chris On Wed, Aug 31, 2011 at 10:30 PM, Anthony wrote: > CLEANUP does not actually take a list of ascii codes as an argument. > Instead, it takes a regular expression, which defaults > to '[^\x09\x0a\x0d\x20-\x7e]'. > Anthony > > On Wednesday, Augu

[web2py] message when login required

2011-09-07 Thread Chris Steel
A long time ago someone talked about adding a message parameter to @auth.requires_login() so that a message could be passed but it does not seem to be working: Example: @auth.requires_login(message=T('You need to be log in to perform this action')) def blog_create_entry: bla bla bla retur

Re: [web2py] Re: has anyone done web2py + google maps?

2011-09-10 Thread Chris Rowson
I'm a Python Web Dev noob, but I had a similar requirement. I created this function to convert a postcode into lon & lat data suitable for use in Google Maps. It's a work in progress, not very elegant, and it doesn't have any error management but it's a start. Hopefully someone on the list will be

[web2py] Computing a field from the value of another field

2011-09-10 Thread Chris Rowson
ogether. Is this a rational way to accomplish my requirements? Thanks in advance! Chris def adddata(): form=SQLFORM(db.data, fields=['provider', 'speed', 'postcode', 'ping']) if form.accepts(request.vars, session, dbio=False): #<-- d

[web2py] Re: Computing a field from the value of another field

2011-09-10 Thread Chris Rowson
alue then adding them to the forms.var > dict before submitting it all together. Is this a rational way to > accomplish my requirements? > > Thanks in advance! > > Chris > > def adddata(): >    form=SQLFORM(db.data, fields=['provider', 'speed', 'po

Re: [web2py] Re: Computing a field from the value of another field

2011-09-10 Thread Chris Rowson
Cool, Thanks Anthony! Does the onvalidation option have benefits over and above the way I've done it? Chris > Another option might be using an onvalidation function: > http://web2py.com/book/default/chapter/07#onvalidation > Anthony > > On Saturday, September 10, 2011 4:37:0

Re: [web2py] Re: Computing a field from the value of another field

2011-09-11 Thread Chris Rowson
Thank you everyone for the advice. Chris On Sep 11, 2011 4:47 AM, "pbreit" wrote: > Good point.

[web2py] Selecting a linked field

2011-09-12 Thread Chris Rowson
--- As you can see, the provider field in the data table stores the provider id. I'm confused! Although this does work I don't know why!, is it the correct way to reference the name field from the providers table? Thanks! Chris

Re: [web2py] Re: Selecting a linked field

2011-09-12 Thread Chris Rowson
Thank you both. I shall revisit, replace with a join and put the logic into the controller rather than the view :-) Chris

Re: [web2py] Re: Selecting a linked field

2011-09-13 Thread Chris Rowson
Started to rework this. Changed to an inner join (I believe!) as suggested. rows=db(db.data.provider==db.providers.id).select(db.data.lon, db.data.lat, db.providers.name) Chris On Mon, Sep 12, 2011 at 9:54 PM, Chris Rowson wrote: > Thank you both. I shall revisit, replace with a join

Re: [web2py] Re: Why web2py is in French by default? How can I change it?

2011-09-15 Thread Chris Rowson
I had the same problem the other day. Then it reverted itself again. Chris On Thu, Sep 15, 2011 at 12:50 PM, kenji4569 wrote: > I met exactly the same problem. My browser is set with Japanese and > has nothing to do with French settings. > > Regards, > Kenji > > On 9月

[web2py] Data stored in memory

2011-09-17 Thread Chris Rowson
in memory? I'm pretty new to python and web2py, can anyone help me understand? Thank you! Chris

Re: [web2py] Data stored in memory

2011-09-17 Thread Chris Rowson
I had read a little about that already, but found myself a little confused as to when an object does or does not continue to refer to another object as described in reference counts. At least you've confirmed I'm on the right track. I'll go back to the books. Thank-you Chris On Se

Re: [web2py] Re: Data stored in memory

2011-09-19 Thread Chris Rowson
Thank you all. I think I get the gist of what happens now. Really appreciating all of the effort you guys put into helping people on this list! Chris On Sat, Sep 17, 2011 at 4:17 PM, Anthony wrote: > Also, note that your 'results' dict will only persist for the duration of a >

[web2py] xml.etree

2011-09-19 Thread Chris Rowson
like: http://www.uk-postcodes.com/postcode/HU11AA.xml The function below returns a dict with the xml tag as a key and the text as a value. Is this a correct way to use xml.etree? Is there a better way of doing this? Thanks in advance! Chris def ukpostcodesapi(postcode): import u

Re: [web2py] xml.etree

2011-09-19 Thread Chris Rowson
Thank you Michele, Chris On Mon, Sep 19, 2011 at 2:00 PM, Michele Comitini wrote: > There is nothing wrong with your code. Maybe it is better to use > find() to get the tag. > If you have an XSD schema you can use generateDS > http://www.rexx.com/~dkuhlman/generateDS.html > t

Re: [web2py] xml.etree

2011-09-19 Thread Chris Rowson
I did look at that Bruno, but some of the articles I read suggested that it is not very memory efficient? Chris On Sep 19, 2011 3:44 PM, "Bruno Rocha" wrote: > I use xml minidom and it is easier. > > http://zerp.ly/rochacbruno > Em 19/09/2011 11:40, "Chris Rowson"

Re: [web2py] xml.etree

2011-09-19 Thread Chris Rowson
Thanks all! Chris On Mon, Sep 19, 2011 at 6:49 PM, Phyo Arkar wrote: > I like lxml more , and check pyquery! jQuery of python at server side. > > On 9/20/11, Bruno Rocha wrote: >> I dont know your needs but, you can pass any XML to web2py TAG[''] helper so >> t

Re: [web2py] xml.etree

2011-09-19 Thread Chris Rowson
I ended up with something like this: http://pastebin.com/Y9keC9tB Chris On Mon, Sep 19, 2011 at 8:42 PM, Chris Rowson wrote: > Thanks all! > > Chris > > On Mon, Sep 19, 2011 at 6:49 PM, Phyo Arkar wrote: >> I like lxml more , and check pyquery! jQuery of python at serve

[web2py] validators

2011-09-22 Thread Chris Rowson
;, requires=IS_NOT_IN_DB(db, 'data.speedtesturl'))) Am I right in thinking then that validators written in the model only work against data submitted using SQLFORM, and not against data submitted in other ways? Thanks, Chris

Re: [web2py] validators

2011-09-22 Thread Chris Rowson
Ah right, cool! Thanks Bruno, Chris On Thu, Sep 22, 2011 at 11:37 AM, Bruno Rocha wrote: > validators are originally written to work on FORMS, but web2py included an > option to validate DAL inserts. > db.validate_and_insert(**values) > & > db.validate_and_update(**values) &

[web2py] Regex messes up web2py editor

2011-09-22 Thread Chris Rowson
[0-9][A-Za-z]{2})$" It seems to cause the editor to corrupt any further text entered in. I don't expect an answer or anything, just thought I'd point it out. Thanks, Chris

Re: [web2py] Re: Regex messes up web2py editor

2011-09-27 Thread Chris Rowson
I gave it a try and found that when using the 'amy' editor I can't scroll all the way to the bottom of the text. Never mind, thanks for the advice. Chris On Thu, Sep 22, 2011 at 9:55 PM, wrote: > I'll give it a go and see if it works. Thanks. > > Chris > &

[web2py] DAL - Selects

2011-09-29 Thread Chris Rowson
postcodes: rows=db(db.data.postcode==postcode[1]).select() for row in rows: data=[row.id,row.name] results.append(data) Thank you! Chris

<    1   2   3   4   5   >