[web2py] Re: comparing datetime objects in db query fails

2011-09-01 Thread Luis Goncalves
Thanks for the solution. Sorry for the slow reply - I wanted to try it out, but haven't since I had already fixed the problem by explicitly converting from strings to datetimes, and moved on with my work. One question: Why isn't the use of PARSE_COLTYPES the default behavior? It seems DAL/sq

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
I think I have figured it out, with the help of a python expert at work. I am using sqlite3, which internally stores data as strings. When creating my real database (not the toy example), I read raw date and time data as an isoformat string, and relied on DAL/web2py to convert. But perhaps in s

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
Ciao Massimo, I wasn't clear in my post : It's not a web app, I'm using DAL as part of a data analysis program I am writing. I debug with ipython, but the script/programs I write can be called like : python test_412_determine_open_or_closed_lane.py , which outputs results to a file. t

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
Here is a simple example ... but it seems to behave properly: """ test datetime in db queries """ import sys sys.path.append("/mnt/data1/web2py") from gluon import * import datetime import random db = DAL('sqlite://debug_datetime.sqlite', folder='/home/goncalves/matlab/objr

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
I think you are right, Anthony! In the original query, first_search (or gar with), first_search[270] is the first entry on the new date!!! (and also first_search[269] is the same entry as broken_query[269], so the search results are the same up to that point). I will still make a simple examp

[web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
Apologies again - all typos. The first query was built by typing (no longer in my ipython history), and full of mistakes. The proper way to do this is to create a simple sample that everyone can replicate (too tired late last night to do so..). Will do so now, constrained by work interruption

Re: [web2py] Re: comparing datetime objects in db query fails

2011-08-19 Thread Luis Goncalves
Cut and paste, sorry! Wanted to rename broken_search for clarity and failed. Late night... —« sent from my Droid tablet »— On Aug 19, 2011 12:12 AM, "Jose C" wrote: >> In [183]: broken_search = db( (db.transEntry.dateTime < ex) & >> (db.transEntry.storeNumber==store_num) & >> (db.transEntry.term

[web2py] comparing datetime objects in db query fails

2011-08-18 Thread Luis Goncalves
Doing database queries on datetime.datetime fields seems broken. Here's an example: I have a database with a table 'transEntry' which includes a 'datetime' field: db.define_table('itemEntry', * Field('dateTime','datetime'),* Field('upc', 'string'), Field('description', 'str

[web2py] Re: in a db query, why the error: can't compare datetime.datetime to Field

2011-08-18 Thread Luis Goncalves
Ah yes! Thank you, Greg! I come from the Matlab world and am not very experienced with object oriented program, but I was suspecting it was something like that. I think I found a true bug in the way datetime objects work in db queries, though -- I will post under a new subject heading. Thanks!

[web2py] in a db query, why the error: can't compare datetime.datetime to Field

2011-08-18 Thread Luis Goncalves
Let my_DT = datetime.datetime( 2011, 08, 16) db.define_table( 'entry', Field('DT' = 'datetime' ) ) (and add data records to the database ...) In a db query, this works: db( db.entry.DT> my_DT).select() but this does not: db( my_DT< db.entry.DT).select() producing error : can't c

[web2py] Re: web2py ranked best out of Six web frameworks

2011-08-10 Thread Luis Goncalves
(oops, sorry, didn't see already posted).

[web2py] web2py ranked best out of Six web frameworks

2011-08-10 Thread Luis Goncalves
There was an article that compares CubicWeb, Django, Pyramid, Web.py, Web2py, and Zope 2and it gave web2py the highest rankings! link: http://www.infoworld.com/d/application-development/pillars-python-six-python-web-frameworks-compared-169442 (Sorry if this is considered spam on the list -- b

Re: [web2py] Re: SQLFORM with divs or ordered lists instead of tables (for easier control with CSS)

2011-07-23 Thread Luis Goncalves
able you to do what > you want with just CSS? > > Anthony > > On Saturday, July 23, 2011 2:33:54 AM UTC-4, Luis Goncalves wrote: > >> Yes ... too many :( >> >> Here's a 'simple' one: >> >> The database table definition, which I use as

[web2py] Re: how to iterate efficiently (memory-wise) through a huge DAL query

2011-07-22 Thread Luis Goncalves
Thanks, Vineet! Lot's of good info there! I don't have actual code yet, because I couldn't even get the db queries to work in a reasonable amount of time. The little code I showed in my initial post already runs slow ( my DB records are db.itemEntry, not db.table ...). The slowness (so far)

[web2py] Re: how to iterate efficiently (memory-wise) through a huge DAL query

2011-07-22 Thread Luis Goncalves
Thanks, Massimo! Even if I grab 1000 at a time (which is definitely better to do!!), I still have to wait for minutes before I get rows back! However, I have found that this is 'fast' : n = db.table.count() # not sure if that's the syntax, but somehow find out how many records in table for i

[web2py] Re: SQLFORM with divs or ordered lists instead of tables (for easier control with CSS)

2011-07-22 Thread Luis Goncalves
Yes ... too many :( Here's a 'simple' one: The database table definition, which I use as a form for input: db.define_table('scorecard', Field('offense1', db.player, requires=IS_IN_DB( db, 'player.id', '%(name)s', zero=T('choose one')) ), Field('defense1', db.player, requires=I

[web2py] how to iterate efficiently (memory-wise) through a huge DAL query

2011-07-22 Thread Luis Goncalves
I am trying to use web2py's DAL for a project that is not a webapp. I have a database with about 8M entries, and I want to process the data. Suppose I create a query that returns a lot of results: extreme case example: q = db.table.id>0 How do I iterate through all the results of a large quer

[web2py] Re: SQLFORM with divs or ordered lists instead of tables (for easier control with CSS)

2011-07-22 Thread Luis Goncalves
Thanks! Also, I think we need to make better/smarter/proper use of the #id table-field entries of each field!

[web2py] Re: SQLFORM with divs or ordered lists instead of tables (for easier control with CSS)

2011-07-22 Thread Luis Goncalves
Thanks, Anthony! I still haven't figured it out completely (mostly because I don't know very much about CSS and someone else is dealing with that part of the project). Thanks! Luis.

[web2py] SQLFORM with divs or ordered lists instead of tables (for easier control with CSS)

2011-07-18 Thread Luis Goncalves
Tables are hard to control in CSS, is there a way to have SQLFORM use divs or lists instead? I have seen many(!) posts about redefining SQLFORM and making it more flexible, but I'm not sure if any conclusion has been reached. Thanks, Luis.

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

2011-07-18 Thread Luis Goncalves
I've been away to conferences and somehow missed these replies! Thank you all for the replies! I send the same content, so in principle CSS definitions should be able to restyle satisfactorily. I actually found two books that seem quite helpful: by Jonathan Stark, published by O'Reilly, "Build

[web2py] Re: how to use contrib/login_methods/linkedin_account.py

2011-07-13 Thread Luis Goncalves
I didn't. But by doing the authentication manually (that is, in an interactive shell), I was able to connect to linked in. I realized that I wouldn't be able to get the information that I wanted though (email address - never provided by linkedin!), so I gave up. But the web2py linked-in aut

[web2py] Re: How to temporarily redirect all requests

2011-07-13 Thread Luis Goncalves
Hello Anthony, and others! I implemented your very first suggestion, code in a model, outside of a function, as you (and pbreit) suggested. It worked fine! It's been very hectic (meetings/travel) and I haven't had a chance to reply until now. Thanks for your help (everybody!) !!! Luis.

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
Awesome!!! Thanks!!! I will try it out!!! Luis.

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
more thoughts: could I do something like: - define a shared global variable session.version - = -1 initially, signifying no choice made - ? use a callback that gets executed *before *the controller that responds to the request - if session.version >-1: let the resp

[web2py] How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
Hello Everyone! Is there a simple/efficient/secure way to temporarily redirect all requests to a specific page? (all requests except for those that define a few actions that are permitted at that point in time) The context: - When user logs in, he needs to choose the version of the website

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-07 Thread Luis Goncalves
Done! Thank you!!! Luis. On Thu, Jul 7, 2011 at 6:24 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Please open a ticket in google code. If this is a web2py but will fix > asap. > > On Jul 6, 11:24 pm, Luis Goncalves wrote: > > In fact, just to make sur

[web2py] can a login_onaccept callback open another view?

2011-07-07 Thread Luis Goncalves
Hello!! As part of the login process, I need the user to make a choice (select one of the multiple versions of the site he has access to, for example), before being redirected to whatever _login_next is. Is it possible for a login_onaccept callback to present a view with a form? My naiv

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
auth.settings.table_user.email.writable=False auth.settings.registration_requires_verification = False return dict(form=auth()) L. On Wed, Jul 6, 2011 at 8:35 PM, Luis Goncalves wrote: > Yes, when I click on the invite and go to the website I get the > registration form filled out with email (and

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
strant has an email? > > On Jul 6, 10:04 pm, Luis Goncalves wrote: >> I still get the same error: >> >> File "/home/ubuntu/web2py/gluon/tools.py", line 1683, in register >> user = self.db(table_user[username] == form.vars[username]).select().first()

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
I still get the same error: File "/home/ubuntu/web2py/gluon/tools.py", line 1683, in register user = self.db(table_user[username] == form.vars[username]).select().first() KeyError: 'email' I don't know if it makes a difference or not, but I'm using emails for login (not a username) -- as

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Actually, I still want email verification to happen (because someone else may stumble upon the link and register with a password unknown to the real user). Nevertheless, I disabled registration verification, and now I get an error deep within gloun/tools.py Error occurs after entering passwor

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Both with Massimo's auth.settings.table_user.email.default = registrant.email auth.settings.table_user.email.writable=False form=auth.register() and with your db[auth.settings.table_user_name].email.writable=False db[auth.settings.t

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Good point! Unfortunately, I am not expert enough to understand how to do this in my case, because I am using the form=auth.register(). Wouldn't I have to do what you suggest inside Auth.register ? (for an explanation of why I am doing this, see: https://groups.google.com/forum/#!topic/web2p

Re: [web2py] easy way to validate a list of emails?

2011-07-06 Thread Luis Goncalves
Excellent! Works perfectly!! Also a great lesson in how to extend the set of web2py form validators! Thank you, Bruno!!! Obrigado!!! Luis.

[web2py] easy way to validate a list of emails?

2011-07-05 Thread Luis Goncalves
Hello!!! I have a form where an organizer can input a list of comma-separated email address, so that each person receives an invitation to register on the website (you can only register for the site if you have an invitation). Is there an easy way to get the "if form.accepts()" to use "req

Re: [web2py] How to call user/register with pre-defined fields (name, email)?

2011-07-05 Thread Luis Goncalves
For the record, here's how I was able to implement an "by invitation only" registration form. Assuming that the user received an email with a link of form http://.../default/user/register?token=sfaasdfasfa, and assuming I have defined a db table 'registrant' associating a token with a name a

Re: [web2py] Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
I found the answer searching through the group posts: form.element(_name='email')['_readonly']=True although this doesn't seem to be documented in the manual, and even looking through the gluon directory (and grepping for _readonly ) didn't reveal anything. Would this have been obvio

Re: [web2py] Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
One more question: How do I make the pre-populated elements of the form appear read-only (so that they cannot be altered)? I've tried in the view: {{=form.custom.begin}} First name: {{=predef.fname}} Last name: {{=predef.lname}} Email: {{=predef.email}} Password: {{=for

Re: [web2py] Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
ster() creates the form and > calls form.accepts. Instead, you can pre-populate by manipulating the form > DOM directly: > > form.element(_name='email').update(_value='lu...@vision.caltech.edu') > > > Anthony > > On Tuesday, July 5, 2011 1:08:31 PM UTC

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
1 at 10:20 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Can you explain the logic? Are you trying to override whatever emails > is typed in by the user on registration? > > On Jul 5, 12:08 pm, Luis Goncalves wrote: > > This doesn't seem to work with aut

Re: [web2py] Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
This doesn't seem to work with auth() forms: form = auth.register() form.vars.email = 'l...@vision.caltech.edu' return dict(form=form) doesn't show the predefined value for 'email' in a view that renders {{=form}} Does anybody know why? Thanks!! Luis.

Re: [web2py] How to call user/register with pre-defined fields (name, email)?

2011-07-04 Thread Luis Goncalves
That's a great idea, David! I think I need to know, then: - how to programmatically create registered users - how to programmatically send them the 'reset password' link. Ideally, the person that can invite users will have a simple webpage form where they can input names and email addresses, an

Re: [web2py] How to call user/register with pre-defined fields (name, email)?

2011-07-04 Thread Luis Goncalves
Thanks, pbreit, for the link! Long thread!!! I read it all, but am still unclear how to force registration with a pre-defined name and email (I'll have DB entries such that each unique invite token is associated with a pre-defined name and email). I was hoping to do something like this: def u

[web2py] How to call user/register with pre-defined fields (name, email)?

2011-07-04 Thread Luis Goncalves
Hello! The website I am developing will be "invitation only": - a user gets an email invitation to register with a link to the site (with an identifying token in the link) - the link takes the user to the website, where he can register - to register, he need only define the password, since the

Re: [web2py] how to implement database tables with one level of indirection?

2011-07-04 Thread Luis Goncalves
-multiple-tables > > But you can't have fields with the same name in your table... > > Finally it maybe possible with component now to load a arbitrary number of > fields inputs for a given table and with jQuery submit the differents forms > as one I would investigate in th

Re: [web2py] how to implement database tables with one level of indirection?

2011-07-04 Thread Luis Goncalves
Hello Richard! I looked at this, but wasn't sure how it could help -- what I need is a way for a (non-technical) admin to create profile forms with arbitrary fields (through a friendly web interface), and then users to be able to view and edit their (run-time reconfigurable) profiles. At any r

[web2py] why doesn't INPUT _type='checkbox' return values of True or False, instead of 'on' or None?

2011-07-04 Thread Luis Goncalves
Hello! It seems to me that the behavior of checkboxes is different and non-standard from the rest of input types, causing one to handle it as a special case (when trying to automate input field processing). In my application, an admin can create profile forms through a friendly interface. T

[web2py] how to implement database tables with one level of indirection?

2011-07-02 Thread Luis Goncalves
Hello! How do I make a database table where the fields are defined by another table? For example, suppose some users of my system are event organizers, and they can define what fields would belong in a person's profile. Then, attendees of that event have to fill out a profile with those specif

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

2011-06-27 Thread Luis Goncalves
Thanks for the quick reply, Anthony!!! We may try the following : break layout.html into header and footer (everything before and after ), then instead of using {{extend}} we will use conditional {{include}} statements at the top and bottom of each view. That will still give us bytecode co

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

2011-06-27 Thread Luis Goncalves
Hello! I need to customize my views so that they look good on a computer screen and on a smart phone. One way to do so, It think, is to have separate layout definitions and then do something like: {{if session.platform == 'mobile':}} {{extend 'mobile-layout.html}} {{else:}} {{extend 'desktop-l

[web2py] Re: how to use contrib/login_methods/linkedin_account.py

2011-06-26 Thread Luis Goncalves
One more clue: In the infinite loop, every loop through the linkedin "grant access" (/oas/oauth/authorize) page has a new oauth_token, such as https://www.linkedin.com/uas/oauth/authorize?oauth_token=f9eef16e-4f45-4f5e-aa5f-82ab18ad3a16 L.

[web2py] Re: how to use contrib/login_methods/linkedin_account.py

2011-06-26 Thread Luis Goncalves
An update (getting closer, but still problems): It seems there are a couple more errors in linkedin_account.py: There is an extraneous command which must have been left over from sample code: profile = self.api.GetProfile(profile).public_url = "http://www.linkedin.com/in/ozgurv";

[web2py] how to use contrib/login_methods/linkedin_account.py

2011-06-25 Thread Luis Goncalves
Hello! I've been trying to use login via linkedin using the contrib/login_methods/linkedin_account.py module. Off the bat, I got the error : AttributeError: 'module' object has no attribute 'LinkedIn' (this is the same problem Kuba mentioned on nov 12 2010) the reason is that linkedin_ac

[web2py] Re: How to implement a "fail whale" for a web2py website?

2011-06-12 Thread Luis Goncalves
Thanks, Massimo! I thought that (redundantly) routes_onerror = [ (r'sandbox_luis/*', r'/sandbox_luis/static/fail.html') (r'*/*', r'/sandbox_luis/static/fail.html') ] would catch all errors, but https://domain.net/sandbox_luis/default/contact_person? results in Bad Reques

[web2py] How to implement a "fail whale" for a web2py website?

2011-06-11 Thread Luis Goncalves
Is there an easy/straightforward way to implement a "fail whale" for a web2py website? I've noticed strange errors (some sort of timeout) when uploading files (running on Amazon ec2), and of course, the site is in beta and bad things may happen. I'd like to have a graceful landing page the us

[web2py] How to access facebook graph of logged in user

2011-06-11 Thread Luis Goncalves
I've been trying to use OAuth2.0 and the facebook module to allow a user to login to my site, and then use the facebook API to obtain info about them via GraphAPI. The web2py manual (8.1.6, subsection "OAuth2.0 and facebook") describes two methods, the first to "login to your own app", the seco

[web2py] Re: where is facebook class GraphAPI() ?

2011-06-11 Thread Luis Goncalves
Awesome! Thank you! Will check it out! Luis.

[web2py] where is facebook class GraphAPI() ?

2011-06-10 Thread Luis Goncalves
This seems like a silly question, but I can't figure it out! Trying to follow the example in the book to use openAuth2.0 and facebook's graphAPI, we need to from facebook import GraphAPI as suggested, I installed pyfacebook first via apt-cache search pyfacebook --> apt-get install pytho

[web2py] Re: Social network plug-in

2011-06-10 Thread Luis Goncalves
Ciao Massimo! Is it now available somewhere for download? It will be very useful!!! Thanks, Luis.

[web2py] how to include profile photo from Janrain in auth_user?

2011-06-09 Thread Luis Goncalves
I have Janrain working as a login method (thanks to the instructions in the web2py manual, and sample code in default app). I'd like to include the profile photo (that, say, facebook provides via janrain) as part of the user profile. I had my own function based on the sample code at the Janrai

[web2py] Re: How to not show the "delete file" checkbox

2011-06-08 Thread Luis Goncalves
Excellent! Thank you both! Before I had [file | (cbox) delete ] requires=IS_IMAGE() got rid of the delete and checkbox, but now I am still left with [file] (a link to download the file) Might have to do server-side DOM parsing to get rid of that ... Thanks!!! Luis.

Re: [web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Luis Goncalves
Hi Richard! I'm displaying the form to the user for them to update it. There are several fields in the form, and one of them is an image ('upload' field). I just don't want to display the "delete file" checkbox for the image, so that the user can't delete the image. They can upload a new

[web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Luis Goncalves
Thanks for the reply! I tried that, but it didn't do what I want. I wasn't very clear in explaining what I'm trying to do (sorry about that!). I have a file upload field in my SQLFORM, and it has a "choose file" button, and right next to it a [file| (chk-box) delete] element.. I want to ge

[web2py] How to not show the "delete file" checkbox

2011-06-05 Thread Luis Goncalves
Is there a way to avoid showing the "delete" file checkbox in a form? Thanks, Luis.

[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Luis Goncalves
Perfect! Thanks!! These tidbit examples are invaluable! As I learn web2py, I am taking notes of where I get stuck, in order to eventually provide suggestions for improving the doc/manual from the novice's eyes (once you already know everything, it isn't as obvious what's missing). The docum

[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Luis Goncalves
Forgot to mention, I need this on google appengine. My hack so far: - create a new DB table, 'default images' db.define_table('default_images', Field('name', requires=IS_NOT_EMPTY()), Field('uploaded','upload', requires=IS_NOT_EMPTY())) - create a admin-only f

[web2py] how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Luis Goncalves
Haven't been able to find any examples showing how to define a default image for an upload field of a db table (headshot for a person's profile). Is it possible? Does anyone know how? thanks! Luis.

[web2py] Re: How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread Luis Goncalves
Awesome! Thanks!!! L.

[web2py] Re: misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
Thanks! I was confused, but the URL doc makes it clear that there are applications, controllers, functions, arguments, and variables. Thx, L.

[web2py] Re: misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
I figured it out ... .. use the powerful URL() helper function! sorry for the 'spam' L.

[web2py] misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
Hello! I have a controller, my_control(), that can be called by itself, or with two arguments , ../default/my_control/AAA or .../BBB In the associated view, my_control.html, I have some href links that call a new controller: Compute Value If I was on the URL

[web2py] How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread Luis Goncalves
Hello All! There is a database action that I want to do in several views. Right now, I have it implemented as a link in each view as Toggle Status How do I get my db_action() controller to return back to the page with the link that called it? Is there a way to cause the browser to do th

[web2py] Re: Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Luis Goncalves
to it working. > > 2011/5/29 Luis Goncalves > > > > > > > > > Hello! > > > I'm building an application where logged-in users can send messages to > > each other (the message gets sent to the recipient's normal email, and > > they use a

[web2py] Re: Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Luis Goncalves
web2py.com/appliances/default/show/10> > -- > Bruno Rocha > [ About me:http://zerp.ly/rochacbruno] > > On Sun, May 29, 2011 at 2:09 AM, Luis Goncalves wrote: > > > > > > > > > Hello! > > > I'm building an application where logged-in users can

[web2py] Re: How do I modify the form on default/user/profile ?

2011-05-29 Thread Luis Goncalves
Hello Annet! Your example helps a lot! I'm not yet familiar enough with web2py/ python to realize that I could just extend the empty user() controller (and I don't think I came across an example in the web2py book or the online examples). Since I already had my own my_profile() controller, what

[web2py] How do I modify the form on default/user/profile ?

2011-05-28 Thread Luis Goncalves
Hello Everyone! How do I modify default/user/profile to use my own form (where the profile contains more information)? I think it should be easy, but I haven't found any info or an example yet. Thanks in advance!!! Luis.

[web2py] Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-28 Thread Luis Goncalves
Hello! I'm building an application where logged-in users can send messages to each other (the message gets sent to the recipient's normal email, and they use a link to come back to the site and reply). I want a page (ie, controller, view, (and model)) that allows the user to see the messages sent

[web2py] Re: How to display a multi-line string variable properly?

2011-05-27 Thread Luis Goncalves
Perfect!!! Thank you!!! Luis. On May 27, 10:28 pm, pbreit wrote: > I think you have to search/replace: > > {{=XML(str(message_body).replace('\n', ''), sanitize=True)}} > > I'm not sure if str() is always necessary or if sanitize needs to be True.

[web2py] How to display a multi-line string variable properly?

2011-05-27 Thread Luis Goncalves
I have a string variable, message_body, which is multiline (has newlines or \n characters). How do I get it to display properly in an HTML view? simply using {{=message_body}} displays the text all on the same line, ignoring the carriage returns. {{=TEXTAREA(message_body)}} displays properly

[web2py] Re: can't use admin, can't see tickets with localhost google appengine SDK

2011-05-26 Thread Luis Goncalves
background, and am just now switching to python. The learning curve is not too steep, and I can already see the power of python!!! I'm building a website, and GAE + web2py seemed like the best choice. web2py is awesome!!!) On May 25, 11:57 pm, Luis Goncalves wrote: > Good idea to copy the

[web2py] Re: can't use admin, can't see tickets with localhost google appengine SDK

2011-05-25 Thread Luis Goncalves
Good idea to copy the files to the debian system and try to see them there! Also good idea to look at the applications/admin/errors directly! I will try! Yes, I've got source code 1.95.1 (stable) for web2py GAE (when you run uploaded from google) uses python 2.5.2. Likewise, web2py recommends

[web2py] Re: can't use admin, can't see tickets with localhost google appengine SDK

2011-05-25 Thread Luis Goncalves
I'm running on linux (Ubuntu 10.04.2, or my old debian system). I start from a shell with >> python dev_appserver.py ../web2py/ On my old debian system, this pops up a little window where I type in my admin password and hit the "start server" button. On the new Ubuntu system it tells me I don't

[web2py] Re: can't use admin, can't see tickets with localhost google appengine SDK

2011-05-25 Thread Luis Goncalves
In reply to your and ron_m's messages: On Ubuntu 10.04.02 with python 2.6.5, When I have a simple error in my python controller (say, return dict(ans=ans) , where ans hasn't been defined), if I run >>python web2py.py : I first get the web-browser error: Internal error

[web2py] Re: can't use admin, can't see tickets with localhost google appengine SDK

2011-05-25 Thread Luis Goncalves
Thank you, Arbie! For a while I was using a Windows ("windose") machine with the Google App Engine Launcher, and so had no console to see. Then I switched to linux, and didn't even notice that the console echoed the error output! Curiously, with an old debian machine with python 2.5.2, admin and