[web2py] Attribute Error

2011-04-10 Thread David J.
In my controller I am defining a class class Employee: pass john = Employee() # Create an empty employee record # Fill the fields of the record john.name = 'John Doe' john.dept = 'computer lab' john.salary = 1000 and in my view I am trying {{=employee.name}} It throws an attrib

[web2py] Re: Dynamic virtual fields

2011-04-10 Thread Serbitar
OK got it. Lambda functions dont save their scope. Here is the right code: list = ["a","b","c","d"] fields = [] for entry in list: fields += [Field(entry, type="string")] db.define_table('test', *fields) class MyVirtualFields(object): pass def get_func(value): def func(self):

[web2py] 2 apps common db model

2011-04-10 Thread ChrisM
The discussion below is a year old, I wondered if any additional functionality has been added to allow two apps to share a common db model, i.e.' _ah' and 'init' - is it still the best solution to create a third app or can the model reside someone else common to both, this will also be deployed on

[web2py] Re: Dynamic virtual fields

2011-04-10 Thread Jay
Good one Serbitar. Much better than my solution. When I saw your "I dont get it" post, I was reminded of why JavaScript functions return functions instead of values. So they can capture the scope too. Now you have to call this every time you have to access this table, is that right? On Apr 10, 5

Re: [web2py] Re: Only 1 {{extend ...}} allowed in a view ?

2011-04-10 Thread andrej burja
as i have read, {{extends should be the first line in the view so it is not possible to do this? {{if condition:}} {{extends 'layout1.html'}} {{else:}} {{extends 'layout2.html'}} ... andrej

[web2py] Re: Problem with JQuery Function

2011-04-10 Thread luifran
I was wrong to copy the code, is this: $ (function () { $ ("form"). bind ("keypress", function (event) { if (event.keyCode == 13) { $ ('form'). submit () } }); }); But the problem is not there. On 10 abr, 03:05, pbreit

[web2py] Re: Change IPython to BPython in shell mode

2011-04-10 Thread ron_m
First item on Blender page you reference, big discussion on auto import bpy. All the arguments look familiar. :-)

[web2py] Re: Attribute Error - Passing Objects to View (Exception)

2011-04-10 Thread David J.
Sorry I would like to be a little more clear about what I am trying to accomplish; I am trying to pass an object to the view; I have this 'Employee' class listed below; when I try creating alit of employees; and sending that list to he view; I cant seem to output properties; for example {{= e

Re: [web2py] Re: Problem with JQuery Function

2011-04-10 Thread Re Fabro
My friend, use FireBug to debug the errors in the browser with jquery, js, html and css. * Obrigado, Renato Fabro* C2C Balloon - Humanizing Technology +55 (19) 3289-9610 http://www.c2cballoon.com 2011/4/9 pbreit > That code snippet is missing a }.

[web2py] Can i us the new restful api for mobile app backend?

2011-04-10 Thread Anaconda
I was just watching the vid on the new restful api available in web2py, it is just amazing!!! It got me thinking that i can build a native mobile app use this api to to populate my app with data.This way i can have both a website and mobile app which will both have access to the database. I was thi

[web2py] Re: Attribute Error

2011-04-10 Thread DenesL
On Apr 10, 5:53 am, "David J." wrote: > In my controller I am defining a class > > class  Employee: >      pass > > john  =  Employee()  # Create an empty employee record > > # Fill the fields of the record > john.name  =  'John Doe' > john.dept  =  'computer lab' > john.salary  =  1000 > > and

[web2py] subdomain routing

2011-04-10 Thread LightOfMooN
Hello. I just want to pass subdomain as args(0) So I have now: routes_in = ( ('.*:https?://(?P.*)\.domain\.ru:.*/?', '/myapp/company/ index/\g'), ('.*:https?://(?P.*)\.domain\.ru:.*/myapp/(? P.*)/(?P.*)/?(?P.*)', '/myapp/ \g/\g/\g/\g'), ('/$c/$f', '/managecom/$c/$f'), ) routes_out = (

[web2py] Re: please help: owned by "windows way of doing things"

2011-04-10 Thread ron_m
In UNIX for text mode output the default setting in the serial driver is to map the standard UNIX EOL which is \n to \r\n Unix input also maps \r to \n The Linux man page is man 4 tty_ioctl for more than you will likely will want to know In Windows the file must contain the \r\n which is the sta

Re: [web2py] Re: Attribute Error

2011-04-10 Thread David J.
I am passing a list of employees so in my view I have {{ for n in employees:} {{= n.name }} {{pass}} On 4/10/11 9:10 AM, DenesL wrote: On Apr 10, 5:53 am, "David J." wrote: In my controller I am defining a class class Employee: pass john = Employee() # Create an empty employee

Re: [web2py] Re: Attribute Error

2011-04-10 Thread Anthony
It works for me. Are you sure you're problem is with {{=n.name}}. The error message you got looks like a NameError, not an AttributeError. Are you referring to a variable 'name' somewhere in your view (or controller)? Can you show your full controller and view code? Anthony On Sunday, April 1

[web2py] Fwd: web2py_1.92.1-1_i386.changes ACCEPTED into unstable

2011-04-10 Thread José Luis Redrejo Rodríguez
It's just been accepted into Debian. I'll upload latest stable version available (1.94.6) in www.web2py.com tomorrow. So, from now on, Debian users can install it with apt-get from unstable (sid), and in ten days from testing (wheezy). Also, as Ubuntu syncs from Debian every few weeks, it will be

Re: [web2py] Re: Attribute Error

2011-04-10 Thread Joaquin Orbe
On Sun, Apr 10, 2011 at 11:07 AM, Anthony wrote: > It works for me. Are you sure you're problem is with {{=n.name}}. The error > message you got looks like a NameError, not an AttributeError. Are you > referring to a variable 'name' somewhere in your view (or controller)? Can > you show your full

[web2py] Re: subdomain routing

2011-04-10 Thread LightOfMooN
OK, I rewrote it with $, and it seems work fine. But there are one problem all links must not end with / for example: demo.uk-online.ru/company/info - works fine, but http://demo.uk-online.ru/company/info/ - rises invalid request Have somebody any ideas how to fix it? This is my routes.

[web2py] Re: custom widget doesn't validate correctly

2011-04-10 Thread DenesL
You forgot to set the requires for t.gender On Apr 9, 6:35 pm, niknok wrote: > I got this custom widget from the list: > > def radio_h(field,value): >     nbsp = XML(' ') >     items=[TAG[''] > (SPAN(name,INPUT(_type='radio',_value=key,_name=field.name,value=value)),nbsp,nbsp) >         for key

[web2py] Off topic, for interest: Emscripten - Python code into JavaScript

2011-04-10 Thread Tom Atkins
http://code.google.com/p/emscripten/

[web2py] Re: Problem with JQuery Function

2011-04-10 Thread pbreit
This worked for me: $(function() { $('form').bind('keypress', function(event) { if (event.keyCode == 13) { $('form').submit() } }); });

[web2py] Re: Problem with JQuery Function

2011-04-10 Thread pbreit
But I think Web2py's standard buttons work like this without needing that extra code.

[web2py] subdomain auth

2011-04-10 Thread LightOfMooN
Hello. I have site based on subdomains, but all of them are the one project. for example: city1.cities.ru city2.cities.ru city3.cities.ru if I login in one subdomain, I should login else in all of others. How to fix it? I just want one login for all cities.ru subdomains thx

[web2py] Re: Problem with JQuery Function

2011-04-10 Thread luifran
I also work for me, but I stop working flash messages, calendars, tooltips, etc. I want to run everything. On 10 abr, 19:15, pbreit wrote: > But I think Web2py's standard buttons work like this without needing that > extra code.

Re: [web2py] Re: Help rate this logo I designed.

2011-04-10 Thread Jason Brower
That's ok, it's not out of hand. :) Besides, is this for a web2py related website or service? Prolly. Why else would he do this unless he was a spam bot. :D I like the design. but I think a bit of work needs to be done outside the font and into the logo itself. (Both can go together or just the

[web2py] OpenID - Best Example

2011-04-10 Thread Nite
Can someone point me to the preferred method/example for using Openid for authentication? There are examples (Web2py Book and elsewhere) that I have tried, but without luck and they appear to implement slightly differently. Perhaps my ignorance on the subject, but if there is a preferred method o

[web2py] Re: Help rate this logo I designed.

2011-04-10 Thread Pystar
Thanks @Jason I am certainly not a spam bot, you can check my profile and the my posts and contributions to this group. Pascal (Pystar) Aito Lagos,Nigeria West Africa On Apr 10, 7:30 pm, Jason Brower wrote: > That's ok, it's not out of hand. :) > Besides, is this for a web2py related website or

[web2py] Re: IS_UPLOAD_FILENAME validator

2011-04-10 Thread Massimo Di Pierro
IS_IMAGE(extensions = ('jpeg', 'png')) actually checks the file type by opening it. IS_UPLOAD_FILENAME(extension = '(avi|flv)') only checks the extension using regex. On Apr 8, 7:18 pm, 黄祥 wrote: > hi, > > i have a problem using validator IS_UPLOAD_FILENAME() to check upload > file neither avi

[web2py] Re: Bug in Dal: import for csv

2011-04-10 Thread Massimo Di Pierro
I think I just fixed this in trunk. Please give it a try. On Apr 1, 9:38 am, Jlew wrote: > When importing the database from csv, it appears that it does not > update the reference id's in list:reference. > > It looks like to me that only references are mapped to their new > values and list:refere

[web2py] Re: Janrain rpx and jquery mobile multi page, single html file

2011-04-10 Thread Massimo Di Pierro
No idea but let us know if you find a solution. On Apr 9, 10:55 am, ChrisM wrote: > Hi i'm trying to include janrain into a jquery mobile enabled site, > using > web2py  running on app engine. > > I am using single html file with multple jquery mobile pages which > Are elements accessed viawww.do

[web2py] Re: A complex validator problem

2011-04-10 Thread Massimo Di Pierro
sorry you cannot have a join in a validator. I think this qualifies as an XY problem. ;-) Massimo On Apr 9, 10:56 am, guruyaya wrote: > Take this example > db.define_table('table1', Field('title)); > db.define_table('table2',Field('title'),Field('table1_id',db.table1)) > db.define_table('table3'

[web2py] Re: Error trying to use PolyModel

2011-04-10 Thread Massimo Di Pierro
Yes it does... adding to trunk. I am surprised this never come up before. Thanks. Massimo On Apr 9, 11:21 am, RipRyness wrote: > Could this be a bug in dal.py? > > Does 'polymodel' need to be in this list? > > ... >     def define_table( > ... >         for key in args: >             if key not

[web2py] Re: LAMP like frameworks are dying. Time for the javascript age

2011-04-10 Thread Massimo Di Pierro
I think node.js is fantastic. It is not a serverside framework and JS is still not that friendly compared to python but for some applications node.js is really fast. Erlang is better though. On Apr 9, 3:35 am, Luther Goh Lu Feng wrote: > I got this link off twitter, and would like to share this a

[web2py] Re: MARKMIN() not working...

2011-04-10 Thread Massimo Di Pierro
Intentional. On Apr 9, 3:52 pm, Jason Brower wrote: > Yeah those work.  After looking at what I had typed for markmin I > noticed that: > ** not bold** > and > **bold** > are different.  The space after the ** doesn't let it be bold.  If this > was intentional, I am all for it, but it could be a

[web2py] Re: T usage

2011-04-10 Thread Massimo Di Pierro
Yes but... If you do something like {{for record in db(...).select():}}{{=T(record.field}}{{pass}} you get a lot of data added dynamically to the translation files. It may slow down your app if the db data changes often. It may also result in lots of data not being translated. Two options are 1

[web2py] Re: Fwd: web2py_1.92.1-1_i386.changes ACCEPTED into unstable

2011-04-10 Thread Massimo Di Pierro
+1 On Apr 10, 9:35 am, José Luis Redrejo Rodríguez wrote: > It's just been accepted into Debian. I'll upload latest stable version > available (1.94.6) inwww.web2py.comtomorrow. > So, from now on, Debian users can install it with apt-get  from > unstable (sid), and in ten days from testing (whe

[web2py] Re: custom widget doesn't validate correctly

2011-04-10 Thread Massimo Di Pierro
Denes is right... one caveat... the requires must be passed not just to the Field but ALSO to the INPUT inside the widget. On Apr 10, 11:51 am, DenesL wrote: > You forgot to set the requires for t.gender > > On Apr 9, 6:35 pm, niknok wrote: > > > > > > > > > I got this custom widget from the lis

[web2py] web-based shell - not working. no ouput displayed.

2011-04-10 Thread niknok
I just noticed that my apps' web-based shell isn't working. I don't see any errors, there are simply no results of any commands I input in the lower screen. Not even a simple "print 'hello world'" works. So what else do I need to check? (P.S. The shell of other apps are working fine.) In addition

[web2py] extra text in forms

2011-04-10 Thread niknok
This might sound too basic, but I couldn't find out how to display extra text in across the width of the whole form table. Right now, I do it this way (which only displays in the input column) but I wonder what's the web2py way? form=SQLFORM.factory( Field('instruction','text', writable=Fals

[web2py] extra text in forms

2011-04-10 Thread niknok
This might sound too basic, but I couldn't find out how to display extra text in across the width of the whole form table. Right now, I do it this way (which only displays in the input column) but I wonder what's the web2py way? form=SQLFORM.factory( Field('instruction','text', writable=Fals

[web2py] Re: custom widget doesn't validate correctly

2011-04-10 Thread niknok
Sorry for being a little thick but how do I do that? There's already a IS_IN_DB requires in the table definition. On Apr 11, 12:51 am, DenesL wrote: > You forgot to set the requires for t.gender > > On Apr 9, 6:35 pm, niknok wrote: > > > > > > > > > I got this custom widget from the list: > > >

[web2py] Re: import datetime vs from datetime import datetime

2011-04-10 Thread niknok
Thank you Anthony. That is very clear now. On Apr 10, 7:27 am, Anthony wrote: > On Saturday, April 9, 2011 6:37:15 PM UTC-4, niknok wrote: > > > Hello. > > > What is the difference between the statements: import datetime vs from > > datetime import datetime > > > I got stuck with my IS_DATE_IN_RA

Re: [web2py] Off topic, for interest: Emscripten - Python code into JavaScript

2011-04-10 Thread Martín Mulone
Interesting also came with this in this page: http://ace.ajax.org/ Very interesting js python editor, perhaps how about to change editarea with this?. 2011/4/10 Tom Atkins > http://code.google.com/p/emscripten/ -- My blog: http://martin.tecnodoc.com.ar Expert4Solut

[web2py] Re: custom widget doesn't validate correctly

2011-04-10 Thread Massimo Di Pierro
You pass the validator to the field so that it passes it to the widget. Your widget does not handle it. You can do: def radio_h(field,value): nbsp = XML(' ') items=[TAG[''] (SPAN(name,INPUT(_type='radio',_value=key,_name=field.name,value=value,requires=IS_IN_DB(db, db.gender, '%(descriptio

[web2py] django toolbar for web2py - help

2011-04-10 Thread Massimo Di Pierro
web2py trunk has db._timings which contains a log of all SQL queries. This means if you add to a page {{=BEAUTIFY(request)}} {{=BEAUTIFY(response)}} {{=BEAUTIFY(session)}} {{=BEAUTIFY(db._timing)}} You get almost all info as a django toolbar. If you run with -- profiler profiler.log you get prof

[web2py] Re: django toolbar for web2py - help

2011-04-10 Thread pbreit
{{=BEAUTIFY(db._timings)}} #plural Looks good.

[web2py] Re: Problem with JQuery Function

2011-04-10 Thread pbreit
Possibly because you are binding to 'form'. You might want to make the bind more specific like this:

[web2py] Re: Can i us the new restful api for mobile app backend?

2011-04-10 Thread howesc
no reason why not. i'd love to port over an existing mobile app to use the RESTful API! AWS/GAE/others should all work. depends on what you want to do and what you feel comfortable with. cfh

[web2py] Re: web-based shell - not working. no ouput displayed.

2011-04-10 Thread Anthony
On Sunday, April 10, 2011 5:36:53 PM UTC-4, niknok wrote: > > I just noticed that my apps' web-based shell isn't working. I don't see any > errors, there are simply no results of any commands I input in the lower > screen. Not even a simple "print 'hello world'" works. So what else do I > need

[web2py] {{=DIV(for)}}

2011-04-10 Thread 黄祥
hi, is it possible to using div using the web2py format that contain looping and if else condition? i found an error during convert my view : from: {{=H1(title)}} {{for i, row in enumerate(rows):}} {{if i == items_per_page: break}} {{=A(T(row.title), _href = URL("blog_show", args = row.id), _ti

[web2py] Re: {{=DIV(for)}}

2011-04-10 Thread Anthony
DIV is a helper class, as explained here: http://web2py.com/book/default/chapter/05#HTML-Helpers. It takes arguments -- you cannot insert arbitrary Python code within its argument list. Stick with your first version. On Sunday, April 10, 2011 8:09:14 PM UTC-4, 黄祥 wrote: > hi, > > is it possib

Re: [web2py] Re: {{=DIV(for)}}

2011-04-10 Thread Stifan Kristi (Kou Shou)
a, i c, thank you so much for your detail explaination and ref link. best regards, steve van christie On 04/11/2011 07:21 AM, Anthony wrote: DIV is a helper class, as explained here: http://web2py.com/book/default/chapter/05#HTML-Helpers. It takes arguments -- you cannot insert arbitrary Pyth

[web2py] memcached, web2py and webfaction

2011-04-10 Thread Tyler Laing
Webfaction recommends setting up memcached this way: http://docs.webfaction.com/software/memcached.html#setting-up-memcached ie, with this command: memcached -d -m memory -s ~/memcached.sock The problem here is that this page( http://web2py.com/book/default/chapter/11#Memcache ) gives an incompat

[web2py] extending web2py's generic.rss view

2011-04-10 Thread johntynan
I am trying to include an enclosure using web2py's generic.rss view here is the function I am using in my controller: http://pastie.textmate.org/1781075 however, when I go to http://localhost:8000/myapp/default/view_collection_feed.rss/1 the enclosure (or the simple comment that I am using as a

[web2py] Re: extending web2py's generic.rss view

2011-04-10 Thread pbreit
Enclosures are for including media (audio, video, etc) in a blog post and should be optional. In general, the built-in gluon RSS stuff should work without modofication. Are you getting an error message? Or does your feed not work in a reader? >From a quick look at your code, it seems OK.

[web2py] Re: A complex validator problem

2011-04-10 Thread guruyaya
I should have been ready for this one. Guess I'll just have to work with "onvalidation". On Apr 11, 12:18 am, Massimo Di Pierro wrote: > sorry you cannot have a join in a validator. > I think this qualifies as an XY problem. ;-) > > Massimo > > On Apr 9, 10:56 am, guruyaya wrote: > > > > > > >

Re: [web2py] Re: django toolbar for web2py - help

2011-04-10 Thread Jason (spot) Brower
I am very excited about this. I am currently completing the vital part of a project until may 6 and my wife will be having our second child around may 8th, but I hope to squeeze a few hours for this. I can create the view for this css/html and so forth. Not much javascript would be needed. I wo

[web2py] Re: subdomain auth

2011-04-10 Thread LightOfMooN
No solutions for that? On 10 апр, 23:18, LightOfMooN wrote: > Hello. > I have site based on subdomains, but all of them are the one project. > > for example: > > city1.cities.ru > city2.cities.ru > city3.cities.ru > > if I login in one subdomain, I should login else in all of others. > > How to f

[web2py] Re: Help rate this logo I designed.

2011-04-10 Thread LightOfMooN
I think the shadow is too vague On 11 апр, 02:34, Pystar wrote: > Thanks @Jason > I am certainly not a spam bot, you can check my profile and the my > posts and contributions to this group. > Pascal (Pystar) Aito > Lagos,Nigeria > West Africa > > On Apr 10, 7:30 pm, Jason Brower wrote: > > > > >

[web2py] Import HTML file

2011-04-10 Thread Kenneth Lundström
Hello list, instead on paying the bank to get a bankaccount abstract in a machine readable format I thought I´d write a small application that imports a HTML page (the source of a page viewing all that has happened on the bankaccount), parses the file and write all happenings into a database.