Re: [web2py] Check upload file size before actual file data uploading

2012-10-01 Thread Johann Spies
On 2 October 2012 04:20, Exeption wrote: > Hi, > > Already have asked > here, > but no reply. > > I will duplicate my question here: > > In my web2py controller I'm accessing file data like: > >

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread tomasz bandura
Hello, Maybe i am not quite on a topic but... back to the beginning of the subject, I found the performance tests for web.py, which in my opinion should achieve good results (because it is simple). Tests are also primitive (just 'hello world'), only prepared for different environment: apache and

[web2py] Postgresql (DAL) error, help needed

2012-10-01 Thread lyn2py
Hi, I am using Postgresql and encountered the following errors. These errors do not come up when I use SQLite. I have the following code: ###MODEL db.define_table('deals', Field('deal_name', 'string',length=255,requires=IS_NOT_EMPTY()), Field('num_A', 'integer',default=0), Field('

[web2py] Re: port forwarding and database access problem

2012-10-01 Thread Massimo Di Pierro
Please downgrade to 2.0.9 (table) or upgrade to trunk or to the nightly build (in 1h). This is a bug in trunk that was introduce two days ago and solved yesterday and it should have nothing to do with the port forward. massimo On Friday, 28 September 2012 09:15:00 UTC-5, Krzysztof Kaczmarski wr

Re: [web2py] Re: SQLFORM.grid + GAE

2012-10-01 Thread Massimo Di Pierro
I believe this is fixed in trunk. Can you help test it? On Sunday, 30 September 2012 13:08:10 UTC-5, David Sorrentino wrote: > > Sure I can! ;) > > Here it is: > > ERROR2012-09-30 18:04:57,520 restricted.py:54] In FILE: >> /home/dapids/webdev/backinterface/web2py/applications/backinterface/co

Re: [web2py] How do you I use geo-spatial types in Web2py DAL?

2012-10-01 Thread Massimo Di Pierro
I believe the spatial DAL only supports postgresql/postGIS and sqlite/spatialite. It does not support mysql. On Monday, 1 October 2012 13:15:07 UTC-5, Calvin wrote: > > Thanks for your suggestion Manuele. I have installed GDAL and also tried > point 1, but then I get stuck as web2py throws the f

[web2py] Re: {less} ify the welcome styles?

2012-10-01 Thread Massimo Di Pierro
The problem is that web2py scaffolding app is supposed to be simple. It is already too complex for my taste. I like less but it adds one more layer of abstraction for new users (new to python/html/css already). On Sunday, 30 September 2012 13:42:42 UTC-5, Dave wrote: > > Massimo et al, > > I won

[web2py] Re: customize a sqlform.factory

2012-10-01 Thread Massimo Di Pierro
Actually this may need a css instead of attr. Not sure. They may both work. jQuery('#no_table_ip').css('width', '800px') On Monday, 1 October 2012 21:39:40 UTC-5, Massimo Di Pierro wrote: > > You are missing quotes > > jQuery('#no_table_ip').attr('width', '800px') > > On Monday, 1 October 2012 0

[web2py] Re: customize a sqlform.factory

2012-10-01 Thread Massimo Di Pierro
You are missing quotes jQuery('#no_table_ip').attr('width', '800px') On Monday, 1 October 2012 09:30:41 UTC-5, CrC wrote: > > > Hello everybody, I am a newbie in web2py and I got stuck with CSS and > SQLFORM.factory. > I'm trying to change the width of one SQLFORM's field, but I can't!!! > > th

[web2py] Re: How to make my routes shorter?

2012-10-01 Thread Massimo Di Pierro
assuming over-ons is a variable and not a constant: routes_in = [ ('/!$ a','/formatics/page/show/$ a') ] routes_our = [ ('/formatics/page/show/$ a','/!$

[web2py] How to make my routes shorter?

2012-10-01 Thread Jimmy Vogel
Dear friends, I want to know how to make my routes shorter : Currently it is http://formatics.nl/page/show/over-ons But it needs to be http://formatics.nl/over-ons Currently I use this as an solution : -- my routes.py-- routers = dict( BASE = dict(default_application='formatics'), ) -- en

[web2py] customize a sqlform.factory

2012-10-01 Thread CrC
Hello everybody, I am a newbie in web2py and I got stuck with CSS and SQLFORM.factory. I'm trying to change the width of one SQLFORM's field, but I can't!!! this is my SQLFORM definition: form = SQLFORM.factory(Field('ip', 'string', widget=SQLFORM.widgets.text.widget), Field('date', require

[web2py] Check upload file size before actual file data uploading

2012-10-01 Thread Exeption
Hi, Already have asked here, but no reply. I will duplicate my question here: In my web2py controller I'm accessing file data like: vfile = request.post_vars.video.file But how can I check

[web2py] Re: {less} ify the welcome styles?

2012-10-01 Thread Adam Kochanowicz
You're editing the minified CSS!? I'm obviously a little biased here, but Kickstrap is the way to go. The entire Bootstrap library is kept completely unchanged in a separate folder while you write your customization on top of it. On my machine, I just made the Bootstrap folder in Kickstrap a gi

[web2py] Need help... testing new DAL

2012-10-01 Thread Massimo Di Pierro
There is a big change in DAL. a = DAL(uri) b = DAL(uri) now "a is b" because DAL is a singleton (almost). It is a thread local singleton as long a uri is specified. What does this mean in practice? It means that unless you have lazy virtual fields, Row and Rows objects can be serialized (pickl

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Curiouslearn
Thanks Derek, Cliff and Alec for all your help. Web2py has become a great community. On Mon, Oct 1, 2012 at 8:25 PM, Alec Taylor wrote: > Use MySQL Workbench, throw a screenshot of your schema as an ERD on > the #mysql channel on freenode. > > They'll give you what you're looking for, i.e.: a

[web2py] GAE users… help

2012-10-01 Thread Massimo DiPierro
What about this ticket? http://code.google.com/p/web2py/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Modified&groupby=&sort=-modified&id=990 Massimo --

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Alec Taylor
Use MySQL Workbench, throw a screenshot of your schema as an ERD on the #mysql channel on freenode. They'll give you what you're looking for, i.e.: a rational schema. On Tue, Oct 2, 2012 at 10:08 AM, Cliff Kachinske wrote: > Read up on indexing tables. Properly indexed tables can retrieve data

[web2py] Re: symmetric key encryption using PyCrypto

2012-10-01 Thread Massimo Di Pierro
Not sure I understand. Does your library uses PyCrypto or not? What do you mean "due to 1"? Anyway, I would like to see it. Massimo On Monday, 1 October 2012 17:15:51 UTC-5, Dave wrote: > > I wanted to post to the group that I have created a utility class for > performing encryption and decrypt

Re: [web2py] Re: SOLVED 'efficiently search by tag' with postgres

2012-10-01 Thread Cliff Kachinske
With Postgres and Psycopg2, make sure your subquery returns more than zero records. Postgres and Psycopg2 raise an exception when the belongs set is empty. On Monday, October 1, 2012 1:35:14 PM UTC-4, Richard wrote: > > Instead passing your tag, pass an inverse tag selection where you omit you

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Cliff Kachinske
Read up on indexing tables. Properly indexed tables can retrieve data much more quickly because they cut down the number of rows the dbms has to examine. This is especially true across joins. MySQL does not index foreign keys so joined queries can take a long time. On Monday, October

Re: [web2py] Re: Calculated field in SQLFORM.grid

2012-10-01 Thread alex
Thank you for re-thinking at the problem. I had already denormalized, but I will use this below, ... the endless capabilities of web2py ... On Tuesday, October 2, 2012 3:33:39 AM UTC+9, Javier Pepe wrote: > > Hello > > You can create a function to represent in link > > links = [{'header':'Conta

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Massimo Di Pierro
Does it support ssl? We need to benchmark it for non-linux environments. Also I am not sure about the PycURL dependence for python2.5. Can you send us instructions to build a single-file tornado server? Massimo On Monday, 1 October 2012 16:27:11 UTC-5, Ricardo Pedroso wrote: > > On Sun, Sep 30,

[web2py] symmetric key encryption using PyCrypto

2012-10-01 Thread Dave
I wanted to post to the group that I have created a utility class for performing encryption and decryption using the PyCrypto library. It really can't be baked in to web2py due to 1, export restrictions, but also the underlying PyCrypto library is not pure python. There is some optimized C in

[web2py] Re: running a background process on GAE within web2py

2012-10-01 Thread Massimo Di Pierro
Can I use your text verbatim for the book? On Saturday, 29 September 2012 18:26:30 UTC-5, Peter Etchells wrote: > > GAE offers a taskqueue module to allow tasks to be run in background. Each > item added to the taskqueue is a redirect to a web2py URL (or any GAE URL) > with parameters (equivalen

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-10-01 Thread Massimo Di Pierro
I understand the problem. You can chance the DB type (and you did) but web2py still tries to put an 'F' or a 'T' in there. I modified trunk so that this can be achieved: import copy db =DAL() db._adapter.types = copy.copy(db._adapter.types) db._adapter.types['boolean']='TINYINT(1)' db._adapter.T

[web2py] Re: creating tables from user input

2012-10-01 Thread Derek
I'd alter your suggestion a bit - if a game always two and only two teams, then assuming it is like baseball or soccer or football, you'd have two teams, a 'home' team and an 'away' team. So, there would be a 1-1 mapping, not a 1-many. On Monday, October 1, 2012 1:46:38 AM UTC-7, Cliff Kachinsk

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Ricardo Pedroso
On Sun, Sep 30, 2012 at 6:43 PM, Massimo Di Pierro wrote: > We can only package pure python web servers. Tornado does not meet this > requirement. Tornado is pure Python and very fast - and even much faster with PyPy. It only has an optional C module for those who want to use epoll on Linux/Pyt

Re: [web2py] Adding cancel button - form submission

2012-10-01 Thread David Sorrentino
No problem! :) So, is there any method to customize the elements of a form (fields and buttons) without using a custom form? Because I managed to customize it with form.custom... but then I can't add a cancel button. Thanks a lot! :) David On 1 October 2012 22:47, Massimo Di Pierro wrote: > Wh

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Alan
Massimo I think given that neither have received upstream updates in a while, it would be a question of whats more stable for web2py? what was the reason for moving to rocket in the first place from cherrypy? are the fixes for rocket something the web2py community can take on (as a rocket fork i

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Derek
Yea, we get it. Pure python is not a requirement for most of the people who use this software. It is important to you, and I can understand your design decision to keep it that way, but still, we were just talking about alternatives, not a new default. On Monday, October 1, 2012 1:58:14 PM UTC-

Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-01 Thread Massimo Di Pierro
Are you storing a rows object in a session? Do you have DAL in modules instead of models? Do you have multiple db=DAL() statements? On Monday, 1 October 2012 14:33:29 UTC-5, Wes Hall wrote: > > I have been having the same issue and was able to try trunk just now. > > The error persists. > > My wo

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Massimo Di Pierro
It is not pure python. Among the pure python ones, rocket is really good. We just made some improvements to it. Massimo On Monday, 1 October 2012 14:01:12 UTC-5, rochacbruno wrote: > > Take a look at web2py/anyserver.py you can run a lot of webservers, I > specially like Bjorn, it is very fast

Re: [web2py] XML Webservice

2012-10-01 Thread Massimo Di Pierro
Done. In trunk. On Monday, 1 October 2012 13:47:50 UTC-5, Derek wrote: > > I think there should be some kind of encoding mentioned in the file, > especially if you want to output valid XML. It assumes UTF-8 if an encoding > isnt' provided, but since this is an international software, with > tra

Re: [web2py] Adding cancel button - form submission

2012-10-01 Thread Massimo Di Pierro
When you add_button('cancel',) you do not get a form.custom.cancel. Sorry. On Monday, 1 October 2012 13:36:02 UTC-5, David Sorrentino wrote: > > Hi everybody, > > Sorry for re-opening this thread, but I'm trying without success to add a > cancel button to a CRUD form. > > Here my controller:

[web2py] Re: Syntax for update_or_insert with multiple values to match

2012-10-01 Thread Massimo Di Pierro
You can send me a patch. the book is now on github. ;-) On Monday, 1 October 2012 13:05:08 UTC-5, monotasker wrote: > > Thanks Massimo. That's very clear now, and I do like the syntax (very > "pythonic"). I think an example like this would make a helpful addition to > the book. > > Ian > > On Mo

[web2py] Re: meta generating queries

2012-10-01 Thread JaapP
Hi Anthony, Thanks (again) for taking the time to answer my question! This gets me going again! I will post the working result here in case somebody else is trying to archieve something like this. Cheers, Jaap --

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Niphlod
groan, I posted something and it doesn't show up: apologies for double posting if the previous one shows up in a few The "issue" is that you are not session.forget()ting the requests going to the http realm: what you are doing is overriding the cookie before redirecting. Both the browser a

[web2py] Re: Manually send confirmation email

2012-10-01 Thread Bruno Codeman
Thank you, howesec. Solved my problem! :D Em quinta-feira, 27 de setembro de 2012 19h59min04s UTC-3, howesc escreveu: > > you may be able to use the onaccept handler of auth.register() to add > custom processing to auth without too much extra work. you can add extra > fields to the auth form, a

[web2py] Re: running a background process on GAE within web2py

2012-10-01 Thread howesc
Excellent answer! one more thing for the ambitious - if you have a long running task that might hit the google timeout, or that you want to take off of the web serving instances you can target taskqueues to backend instances. https://developers.google.com/appengine/docs/python/backends/ i hav

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Yarin
yes the second- im thinking more and more that session.secure() should create a whole new secure session cookie, rather than trying to secure the existing one- it seems like that's the only way to effectively handle mixed mode- but I'm not familiar enough with the implementation to know how much

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-10-01 Thread MichaelF
I spoke too soon about this fixing the problem. It seems that adding/updating a record with such a field using the admin interface, and using a smartgrid, doesn't do it. I create this table: db.define_table('Test_bool', Field('test_bool', 'boolean')) I also have the following a

Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-01 Thread Wes Hall
I have been having the same issue and was able to try trunk just now. The error persists. My working powerTable code on 1.99.3 no longer works on 2.0.9. On Monday, October 1, 2012 1:23:54 PM UTC-4, Massimo Di Pierro wrote: > > Can you please try the trunk version? > > On Sunday, 30 September 201

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Niphlod
maintaining as in "use that session also for http" ? if that's the case, there is no issue: secured cookies are sent only back to a https, so it's a no-go. if "maintaining" is meant as "retrieve the previously issued cookie only for https pages" then we can inspect it further. Generally web2py

[web2py] Re: Customising "sub page" generated by smartgrid.

2012-10-01 Thread Dominic Cioccarelli
Excellent! Thanks Jim. Getting closer, but still no cigar. What happens if I want the constraint to add to the existing constraints that have been built by smartgrid? For example, if I have the model: db.define_table('make', Field('name')) db.define_table('option', Field('name')) m3t.d

Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Bruno Rocha
Take a look at web2py/anyserver.py you can run a lot of webservers, I specially like Bjorn, it is very fast. --

[web2py] Re: 'efficiently search by tag' with postgres

2012-10-01 Thread Derek
FYI, distinct is the same as "group by all". On Saturday, September 22, 2012 3:18:32 PM UTC-7, Massimo Di Pierro wrote: > > Looks like postgres is picky and wants in groupby all the selected fields > in distinct. This should work: > > rows = db(data.id==tag.record_id)\ > (tag.name.belongs(tag

[web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-01 Thread Derek
I think we all might be asking for the same thing then - can we make the webserver pluggable, like how the databases are now? So if I install Tornado, or Gunicorn, or whatever, I can just specify that in a config file, or perhaps the little gui that comes up i can specify which webserver i pre

Re: [web2py] XML Webservice

2012-10-01 Thread Derek
I think there should be some kind of encoding mentioned in the file, especially if you want to output valid XML. It assumes UTF-8 if an encoding isnt' provided, but since this is an international software, with translations, ISO-8859-1 would be a good default. It should be configurable though,

Re: [web2py] Adding cancel button - form submission

2012-10-01 Thread David Sorrentino
Hi everybody, Sorry for re-opening this thread, but I'm trying without success to add a cancel button to a CRUD form. Here my controller: def insertnews(): form = crud.create(db.news) form.add_button("cancel",URL(r=request,f='index')) return dict(form=form) Here my view: {{=form.cus

Re: [web2py] Re: Calculated field in SQLFORM.grid

2012-10-01 Thread Javier Pepe
Hello You can create a function to represent in link links = [{'header':'Contador', 'body': lambda row: count_b(row.id) }] def count_b(a.id): c = db(db.B.ref_a == id).count() if c: count = c else: count = 0 return count On Sun, Sep 30, 2012 at 9:26 AM, Massimo

Re: [web2py] How do you I use geo-spatial types in Web2py DAL?

2012-10-01 Thread Calvin
Thanks for your suggestion Manuele. I have installed GDAL and also tried point 1, but then I get stuck as web2py throws the following error: Traceback (most recent call last): File "/var/www/web2py/gluon/restricted.py", line 209, in restricted exec ccode in environment File "/usr/share/we

[web2py] Re: Syntax for update_or_insert with multiple values to match

2012-10-01 Thread monotasker
Thanks Massimo. That's very clear now, and I do like the syntax (very "pythonic"). I think an example like this would make a helpful addition to the book. Ian On Monday, October 1, 2012 12:04:21 AM UTC-4, Massimo Di Pierro wrote: > > You must do > > db.tag_records.update_or_insert(condition, >

[web2py] Re: language file fields - text or string?

2012-10-01 Thread Adi
works well :) thanks for fixing it Massimo. Adnan On Monday, October 1, 2012 1:30:03 PM UTC-4, Massimo Di Pierro wrote: > > Oops. This was a mistake. It should now be fixed in trunk. Can you try it? > > On Monday, 1 October 2012 10:44:35 UTC-5, Adi wrote: >> >> Sorry for bringing this up again. T

Re: [web2py] Re: Weird behavior across 2 almost identical Web2py environments

2012-10-01 Thread David Waldrop
Agh.. and I guess it worked in my Dev machine because I had more than one record in the set for 10/1. Sorry to clog this group with thus type of logic error. On Oct 1, 2012 1:22 PM, "Massimo Di Pierro" wrote: > Not all of your results.items()[i][1] have a 'created'. Some only > have {'yymm_coun

Re: [web2py] Re: SOLVED 'efficiently search by tag' with postgres

2012-10-01 Thread Richard Vézina
Instead passing your tag, pass an inverse tag selection where you omit you tag, then use not belongs : ~link.tag_id.belongs(subquery)... Where subquery will something like that : subquery=db(~db.TAGTABLE.TAGNAME.belongs((tag1,tag2,tagEtc))).select( db.TAGTABLE.TAGNAME.id) Richard On Sat, Sep 29

[web2py] Re: language file fields - text or string?

2012-10-01 Thread Massimo Di Pierro
Oops. This was a mistake. It should now be fixed in trunk. Can you try it? On Monday, 1 October 2012 10:44:35 UTC-5, Adi wrote: > > Sorry for bringing this up again. The code hasn't changed in > admin/default/edit_language, and should work as before, but doesn't in my > case. Anyone else sees TE

Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-01 Thread Massimo Di Pierro
Can you please try the trunk version? On Sunday, 30 September 2012 21:32:22 UTC-5, visuallinux wrote: > > Dear Massimo. > > My code is the following: > > @auth.requires_membership('Administrador') > def clientes(): > > > class Virtual(object): > > @virtualsettings(label=T('Editar')) >

[web2py] Re: Weird behavior across 2 almost identical Web2py environments

2012-10-01 Thread Massimo Di Pierro
Not all of your results.items()[i][1] have a 'created'. Some only have {'yymm_count': 1}. Try results = {} for row in set: label = str(row.created_on.strftime('%b-%y')) #works but screw up ordering try: results[label] = {'yymm_count': results[label]['yymm_co

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Yarin
Forget 2 its irrelevant- I'm only securing session for HTTPS requests, but what I'm concerned with is maintaining the secure session even if an HTTP request slips in. For example, I had this in my model to force HTTPS and secure the session (basically the same as request.requires_https()): if r

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Niphlod
uhm. session.secure() is only meant to add the "Secure" bit to the cookie. Then it's browser's responsibility to communicate with the domain of the cookie only submitting that cookie over https In a normal web-app, if you use http://domain.com/whatever to issue out a cookie, that cookie shou

[web2py] Re: Customising "sub page" generated by smartgrid.

2012-10-01 Thread Jim S
You can pass constraints on to linked tables using the following: constraints={'contact':query,'yourtablename':yourconstraintquery} SQLFORM.smartgrid(db.contact, fields=fields, constraints=constraints, orderby=orderby, create=create, details=details, editable=editable,deletable =deletable, csv=

[web2py] Re: language file fields - text or string?

2012-10-01 Thread Adi
Sorry for bringing this up again. The code hasn't changed in admin/default/edit_language, and should work as before, but doesn't in my case. Anyone else sees TEXTAREA if translation string > 40 characters when editing languages? Thanks. def edit_language(): """ Edit language file """ a

[web2py] Problem with securing sessions

2012-10-01 Thread Yarin
I'm bumping up against a problem in the session.secure() implementation. If a session is secured, and then the app is hit with an http request, the session is blown out. This happens even if the session isn't modified by the http request and even if it is immediately redirected to https. The co

Re: [web2py] Smartgrid linked table issue.

2012-10-01 Thread Dominic Cioccarelli
Cheers Adi, spot on! On Wednesday, 26 September 2012 03:19:26 UTC+2, Adi wrote: > > I think you need to flip it around, and use facilities instead of servers, > and then you will get the link to servers: > > facilities = SQLFORM.smartgrid(db.facility, linked_tables={}, > user_signature=False, l

[web2py] Customising "sub page" generated by smartgrid.

2012-10-01 Thread Dominic Cioccarelli
Hi all, ok, making more and more progress with smartgrid but still a couple of gaps. I have a model structure which, simplifying things somewhat, has a hierarchy A-.>B->C. samrtgrid allows me to set up the model structure and then simply define a controller and view for A: I get the CRUD web p

Re: [web2py] Re: Simple-Report

2012-10-01 Thread Marin Pranjić
We were discussing the possibility to merge appliances with web2pyslices. I'd still like to see this happen. Marin On Mon, Oct 1, 2012 at 3:59 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Anybody volunteers to adopt the web2py.com/appliances repo, monitor the > list for code exam

Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-01 Thread FERNANDO VILLARROEL
Dear Bruno. Yes effectively i am using the new version of web2py 2.0.8 --- On Mon, 10/1/12, Bruno Rocha wrote: From: Bruno Rocha Subject: Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual' To: web2py@googlegroups.com Date: Monday, October 1, 2012, 1:04 AM Are

[web2py] Re: SQLFORM.grid custom search where is the error?

2012-10-01 Thread Jim S
So you're really not even using the grid search then. You're controlling the entire search form and placing it on the page in your view, right? -Jim On Saturday, September 29, 2012 9:52:25 PM UTC-5, alex wrote: > > I found the way to bypass the problem. > > I have changed the call to SQLFORM.gr

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Curiouslearn
Thanks Alec. I don't think I will reach those numbers, ever, for one game. This has nothing to do with web2py, but I have a MySQL database with about a 700,000 records and selects are quite slow in it. Some simple queries take 7-8 seconds per query, which is slow in the context of a game. Probably

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Alec Taylor
Those are really low numbers. When you are getting closer to a billion games a week you should consider a schema change, e.g.: multi-tenant. On Mon, Oct 1, 2012 at 10:54 PM, Curiouslearn wrote: > Hi Alec, > > I am using mysql backend. I will most probably host it on dotcloud, > using their Pytho

[web2py] Weird sorting behavior across environments

2012-10-01 Thread david.waldrop
I have a very weird issue I cannot resolve regarding sorting a dictionary based on a DAL query. The code below runs as expected on my dev box, but emits an error when i push to production (both environments are running the same version of web2py 2.0.0 and python v2.7.3. ... results = {}

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Curiouslearn
Hi Alec, I am using mysql backend. I will most probably host it on dotcloud, using their Python and MySQL service. I think as suggested by Cliff and you, I will create only one set of tables for all games. As of now I will probably have only about 50 datapoints per team. There are no images. Righ

Re: [web2py] Re: RBAC example?

2012-10-01 Thread Alec Taylor
On Mon, Oct 1, 2012 at 7:14 PM, Cliff Kachinske wrote: > I use Web2py's RBAC. > > Why reinvent the wheel? > > If you had a group called casual_users, you need to think through the CRUD > permissions on the auth_group, auth_membership and auth_permission tables. > > You also need a way to distingui

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Alec Taylor
Probably not. Where are you hosting this? E.g.: Google App Engine doesn't have "tables", so the whole concept is "irrelevant" there. Also, how much data are you talking per team, and how many teams do you expect to be in the database? Unless you're storing an inordinate amount of images or realt

[web2py] Re: SocketTimeout: Socket timed out before request

2012-10-01 Thread Loreia
Why didn't you post your solution??? This is the top result in Google search for "SocketTimeout: Socket timed out before request." and still there is no resolution of the problem. So, after spending two hours on this, let me save other novices from going down the same route: This error happens

Re: [web2py] Re: creating tables from user input

2012-10-01 Thread Curiouslearn
Hi Cliff, Thanks very much for your input. I am new to databases and appreciate the advice. I was also thinking of the alternative you are talking about. But thought that as the number of games played increased, this would increase the number of records in the tables and make database access slow

[web2py] Re: RBAC example?

2012-10-01 Thread Cliff Kachinske
I use Web2py's RBAC. Why reinvent the wheel? If you had a group called casual_users, you need to think through the CRUD permissions on the auth_group, auth_membership and auth_permission tables. You also need a way to distinguish groups that casual users can manage. That could be done through

[web2py] Re: creating tables from user input

2012-10-01 Thread Cliff Kachinske
Do not let your tables proliferate this way. You need a teams table, even if it contains only the team name or some other identifier. You need a games table. You need to relate these two. One game has multiple teams, I suppose, so that makes a one-to-many relationship. If the same team can

[web2py] Re: invalid table name: no_table

2012-10-01 Thread Neil
Fixed. On Sunday, September 30, 2012 8:23:47 PM UTC+1, Massimo Di Pierro wrote: > > Please try again. I was messing up with trunk. > > On Sunday, 30 September 2012 12:43:16 UTC-5, Neil wrote: >> >> I just upgraded to 2.0.9, but had some problems with the editor, so I >> upgraded to trunk (inciden