Re: [web2py] HTTPS admin access has stopped working

2012-09-17 Thread Bruno Rocha
assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) --

Re: [web2py] Is it possible to remove row from rows result created from DB?

2012-09-17 Thread Bruno Rocha
In my experience working with this I fired out that it is better to use haversine directly on database, you can find haversine functions for MySQL, Postgres and even for SQlite. I dont know how one can write haversine with DAL api, but you can do it with executesql() as you are going to turn this

Re: [web2py] How to use the new cache-options for referenced table by IS_IN_DB ?

2012-09-17 Thread Bruno Rocha
IS_IN_DB receives a cache parameter so you can do db.table.field.requires = IS_IN_DB(, cache=(cache.ram, 1800)) For that number of records I would use an ajax widget with endless scroll. (http://ivaynberg.github.com/select2/#infinite) --

Re: [web2py] Receiving array passed in from jQuery $.ajax() into Storage object

2012-09-17 Thread Bruno Rocha
You can do something like this: In [17]: request_vars = {'table[0][]': ['1', '2'], 'table[1][]': ['3', '4']} In [18]: table = request_vars.values() In [19]: table[0] Out[19]: ['1', '2'] In [20]: table[1] Out[20]: ['3', '4'] or to be sure about the sequence. In [25]: request_vars =

Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-17 Thread Bruno Rocha
Trunk means the most recent devel version from git or hg, it is unstable but issues are fixed very quickly git clone https://github.com/web2py/web2py hg clone https://code.google.com/p/web2py --

Re: [web2py] Problem with validator IS_LIST_OF(IS_EMAIL())

2012-09-16 Thread Bruno Rocha
I just looked at the code but I cant see how did you solved this, I am having the exact problem on another custom widget. I want a field where users will put recipe ingredients separated by new lines *The field* Field(ingredients, list:string, requires=LINE_SEPARATED_LIST(),

Re: [web2py] Re: [ANN] Started development on web2admin

2012-09-15 Thread Bruno Rocha
I did that, a modal for field details... I did a pull-request with this, maybe you can improve the design. --

Re: [web2py] Re: [ANN] Started development on web2admin

2012-09-15 Thread Bruno Rocha
I did the modal part, now need to do the shortcuts. also as you are working on mult-db support, the code may change a little. look: [image: Inline image 1] [image: Inline image 2] --

Re: [web2py] Re: [ANN] Started development on web2admin

2012-09-15 Thread Bruno Rocha
Your call, also if you prefer to take the modal logic from modules/server side DOM on to HTML template it is easy to change. I just created as Server side DOM because it can be reused. --

Re: [web2py] Re: Is there a way to have a widget like list:string on list:reference?

2012-09-15 Thread Bruno Rocha
I am using the default multi-select and this http://ivaynberg.github.com/select2/ --

Re: [web2py] Re: Problem with validator IS_LIST_OF(IS_EMAIL())

2012-09-15 Thread Bruno Rocha
I have the exact same problem, but it is with tags widget. I tried a lot but did not found the way to solve it :/ BEFORE VALIDATION ERROR: [image: Inline image 1] AFTER VALIDATION ERROR [image: Inline image 2] --

[web2py] Re: Postgres Heroku

2012-09-15 Thread Bruno Rocha
And data-clips are amazing feature! https://postgres.heroku.com/dataclips/icuwejkuecgtzhbdtcpeomdakcyg --

Re: [web2py] Re: Is there a way to have a widget like list:string on list:reference?

2012-09-15 Thread Bruno Rocha
This one:http://ivaynberg.github.com/select2/#infinite It is easy to implement, just a default text box and you bind this. --

Re: [web2py] Re: Loop on form.process(). Validation is not done

2012-09-14 Thread Bruno Rocha
What do you have in your view? are you using any JavaScript to manage the form submission? --

Re: [web2py] Re: [ANN] Started development on web2admin

2012-09-14 Thread Bruno Rocha
There is Pyodel (learning tool), I dont know about the status of QAStak and PyForum. @rif what about multiple databases and databases named differently? your code expects a db object, so I think you can put on the models a config variable for dbs plugin_web2admin_dbs = [db, other_db,

Re: [web2py] Re: [ANN] Started development on web2admin

2012-09-14 Thread Bruno Rocha
@rif I have some suggestion Screenshot: http://i.imgur.com/3t2kv.png For the suggested [fields] buttom it can be done with a modal or popup, it can loads a table style=display:none; id=tablename_fields inside the popup or modal, or if prefered it can retrieve this info via ajax. To retrieve

[web2py] Re: on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
I noted that this happens with memcached too. type 'exceptions.AttributeError' 'list' object has no attribute 'find' My cached .select(cache=(cache.memcache, 1200)) is retrived as a list. Function argument list (menus=[Row {'show_order': 0, 'parent': 1, 'title': 'Co...2, 6, 3, 18, 20, 21),

Re: [web2py] Validating form fields manually

2012-09-13 Thread Bruno Rocha
You can read the read-only or hidden fields from the form directly on request.vars, instead of form.vars use request.vars and it should work. --

Re: [web2py] Beginner trying to adapt the Chapter 11 ajax function 'echo' example

2012-09-13 Thread Bruno Rocha
The ajax function: ajax( url, # here you set a string to a complete url, it can include args and vars [], # form inputs, if you have a form on the page you can set ['name', 'email'] if you do not have a form set it to null target, # an id of any html element where you want the

Re: [web2py] Is there anyway to register a user manually just like login_bare? I am using it in the mobile app.

2012-09-13 Thread Bruno Rocha
*Create this function in some model* * * *def new_user(first_name, last_name, email, passw): **users = db(db.auth_user.email==email).select() **if users: **return users[0].id **else: **my_crypt = CRYPT(key=auth.settings.hmac_key) **

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
Yes, it raises the same error when using cache.disk, so I think for now we should include a note on /book. and I will try to emulate the .find .exclude and .sort externally using listcomprehension or map. --

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
The same problem without cacheable --

[web2py] Re: [web2py-dev] on Redis Rows turns in to list() ?

2012-09-13 Thread Bruno Rocha
Ok, changing all my selects to cacheable=False it works on .disk, redis and memcache. Even on the rows where I am not using the .find() and .exclude() methods the cache are failing. If do {{for row in cached_rows:}} {{pass}} it gives me nothing.. Also {{if cached_rows:}} returns always

Re: [web2py] short term roadmap

2012-09-13 Thread Bruno Rocha
I would like to have a repo of scaffold apps and a command line tool + /admin tool to checkout ADMIN - create new app - SELECT(*['simple', 'bootstrap', 'foundation', 'ecommerce', 'tuned',..long list]) and on command line python web2py.py -S newappname*|*foundation downloading

Re: [web2py] short term roadmap

2012-09-13 Thread Bruno Rocha
also it will need on admin BUTTON('update scaffold list') and in command line web2py.py -S updatescaffold --

Re: [web2py] [ANN] Started development on web2admin

2012-09-13 Thread Bruno Rocha
Nice work! the select2.js is the same as choosen? I really like it! should have a web2py widget for this. SUGGESTION: it is very annoying to request host/app/plugin_web2admin the url does not looks good. To change this, the hard option is tricking on routes. But there is an easy way: NOTE: it

[web2py] Pynes notify

2012-09-12 Thread Bruno Rocha
This plugin for Bootstrap looks very nice for response.flash http://pinesframework.org/pnotify/ --

Re: [web2py] compute fields do not show up in SQLFORM view form

2012-09-11 Thread Bruno Rocha
for that cases shouldn't use _before_insert and _before_update triggers? --

Re: [web2py] Re: Best Method to implement a like button

2012-09-11 Thread Bruno Rocha
db.define_table('likes', Field('username', 'reference auth_user'), Field('songname', 'reference songs'), Field('playlist_name', 'reference playlist'), Field('unique_key', unique=True, notnull=True, compute= lambda row: %(username)s-%(songname)s-%(playlist_name)s), ) Now on any

Re: [web2py] Re: Best Method to implement a like button

2012-09-11 Thread Bruno Rocha
The computation should be compute= lambda row: %(username)s-%(songname)s-%(playlist_name)s % row --

Re: [web2py] Modelless app no longer works with web2py 2.0.x ???

2012-09-11 Thread Bruno Rocha
I did some changes on Movuca, but I still have to solve little issues in order to commit. But I just commited a workarounf for the problem: https://github.com/rochacbruno/Movuca/commit/aa25103e9c37921a34a225b8e82ca0f8634ca831 --

Re: [web2py] Help with python module import error

2012-09-10 Thread Bruno Rocha
if the package is in your Python wen2py have to see this.. you can try inside web2py code (i.e models) import sys sys.path.append(/path/to/installed/package) Have you restarted web2py since you installed the module? On Mon, Sep 10, 2012 at 4:52 PM, monotasker scotti...@gmail.com wrote: I'm

Re: [web2py] Help with python module import error

2012-09-10 Thread Bruno Rocha
If you are running on webfaction, maybe it is under apache and mod_wsgi, so you need to restart Apache to reload the mod_wsgi. $service apache2 restart or $/etc/init.d/apache2 restart (but you need to check if it is running apache, nginx or other) --

Re: [web2py] Modelless app no longer works with web2py 2.0.x ???

2012-09-09 Thread Bruno Rocha
Here is the solution: https://github.com/rochacbruno/web2py_model_less_app/blob/master/modules/myapp.py#L82 That approach subclasses DAL so it need to include _lazy_tables = {} But, now that we have lazy_tables in default DAL, I recommend you to use the default web2py scheme with

Re: [web2py] Re: help test codemirrorw

2012-09-09 Thread Bruno Rocha
Maybe we can put a dropdown select and adjust the prefered editor using cookies in the same way we do with the admin language? So it will be easy to switch from codemirror to ace and no need to edit the 0.py On Sun, Sep 9, 2012 at 4:35 PM, Marin Pranjić marin.pran...@gmail.comwrote: It is not

Re: [web2py] Modelless app no longer works with web2py 2.0.x ???

2012-09-09 Thread Bruno Rocha
On Sun, Sep 9, 2012 at 9:27 PM, Andrew W awillima...@gmail.com wrote: (although I still don't quite really understand what a lazy table is). imagine you have models/db.py db = DAL(...) db.define_table(table1.) db.define_table(table2.) ... ... db.define_table(table30.) So, for

Re: [web2py] Populating widgets with queries

2012-09-08 Thread Bruno Rocha
maybe this? form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(*db(db.table.field == xyz)*, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'),

Re: [web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0

2012-09-08 Thread Bruno Rocha
I am using: cache_key = %s_%s_%s % (query, start, end) total, rows = cache.ram(cache_key, lambda: (db(query).count(), db(query).select(limitby=(start, end), cacheable=True)), 3600) Should I put a dummy cache=(...) just to have the benefits? --

Re: [web2py] help test codemirrorw

2012-09-08 Thread Bruno Rocha
Thats great! I started using codemirror on another project and I find it awesome. I will update from trunk now and test in Ubuntu.. --

Re: [web2py] help test codemirrorw

2012-09-08 Thread Bruno Rocha
code mirror works ok for me in chrome, opera and firefox (ubuntu). --

Re: [web2py] Re: [OT] Ubuntu 12.10 will no longer ship with Python 2

2012-09-07 Thread Bruno Rocha
Let's create a virtual-env with Python 2.7 and it will not be a problem. --

Re: [web2py] invalid view (default/contribuyentes.html)

2012-09-06 Thread Bruno Rocha
that should be under */views/default/contribuyentes.html* On Thu, Sep 6, 2012 at 4:48 PM, ocascante oscarcascantefons...@gmail.comwrote: Hi, i am new in web2py. I have web2py 2.07 installed in my linux mint 13 computer. I used the script available in google to install it. Now, i have a

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Bruno Rocha
db(db.table.field == None).select() should give you all records with field = NULL db(~db.table.field == None).select() All records where field NULL Is that? --

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Bruno Rocha
On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin.pran...@gmail.comwrote: it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. Yes, my bad, you are right, but there is one case where ~ is used in query ~db.table.field.belongs(list) and

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
Your URL should have the vars url: /test01/default/getContent?sourcetitle=xxx If you do not pass the vars on url you can't get them at the called controller --

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
or you call it with .json extension and use the generic json view url: /test01/default/getContent*.json*?sourceTitle=x or you do this on the return import json def getContent(): titleArg = str(request.vars.sourceTitle) print -- print

Re: [web2py] sqlform.grid and query conditions

2012-09-05 Thread Bruno Rocha
You can do: if request.args(0) in ['edit', 'delete']: STORE_DETAILS.id == int(request.args(2)) or redirect(URL('default', 'wherever')) db.pages.stores_id.default = STORE_DETAILS.id query = ((db.pages.stores_id == STORE_DETAILS.id)) form = SQLFORM.grid(query=query)

Re: [web2py] Re: web2pyslices for Android

2012-09-04 Thread Bruno Rocha
That is just a RSS reader with local storage for favorites, read/unread etc.. --

Re: [web2py] Updated cheatsheet

2012-09-04 Thread Bruno Rocha
Small question.. cache.ram.clear(regex='*') will clear the whole cache? --

Re: [web2py] Updated cheatsheet

2012-09-04 Thread Bruno Rocha
So I assume cache.ram.clear() will do the job ? --

Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Bruno Rocha
There is a free option.. I manage the web2py facebook page, (also Massimo and Anthony are added as co-managers), facebook can tweet automatically from page -- twitter. So we can add more people to page management and all publications by page will go to twitter. Just need to enter there, go to

Re: [web2py] Validating form fields manually

2012-09-04 Thread Bruno Rocha
this: def validate_my_form(form) if form.vars.channel == foo: form.errors.channel = This channel is not valid if form.process(onvalidation=validate_my_form).accepted: # do whatever here *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821

Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Bruno Rocha
www.facebook.com/web2py --

Re: [web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Bruno Rocha
cache.ram or even better (memcached) is preferred! if you use session and your sessions are stored on filesystem, if you have too much data it will be hard to load on each request. DATA = cache.ram(request.http_host, lambda: db(..).select(cacheable=True), 86400) # keeps for 24 hours. Now, on

Re: [web2py] Re: web2py book on github

2012-09-03 Thread Bruno Rocha
Martin, I am doing the same for portuguese. Which number did you named your spanish version? 36-spanish-work-in-progress ? I forked and I will put a 37-portuguese-work-in-progress On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote: I know but it's not in markmin, and

Re: [web2py] Re: web2py book on github

2012-09-03 Thread Bruno Rocha
FYK: The portuguese will be done by a community, so we are tracking the statuses on this file: https://github.com/rochacbruno/web2py-book/blob/master/sources/37-web2py-portuguese-work-in-progress/translation_status.md Maybe someone can follow the pattern... --

Re: [web2py] Re: Twitter account for @web2py

2012-09-03 Thread Bruno Rocha
You can use http://feeds.feedburner.com/web2pyslices as source for automatic posts... also it would be nice to include web2py.com/download/changelog.rss (create it) and use as source to tweet automatically when change log gets updated. It can also be done with github commits (you can integrate the

Re: [web2py] help with apache

2012-09-03 Thread Bruno Rocha
I guess it can help you to discover the problems: http://nicolargo.github.com/glances/ (I would like to have a web-socket version of that app) --

Re: [web2py] Re: Checking for upgrades isn't working as I expected (1.99.7 installed)

2012-09-03 Thread Bruno Rocha
If you have access to files (ssh or ftp) you can try to edit this line File ...web2py/applications/admin/controllers/default.py https://192.168.1.102/admin/default/edit/admin/controllers/default.py, line 113, in check_version + XML(' strong class=upgrade_version%s/strong' % version_number)

Re: [web2py] Re: How to persist session data for user across browsers

2012-09-02 Thread Bruno Rocha
I think you can use cache. user_data = cache.ram(user_data_%s % auth.user_id, lambda : dict(field=value, field=value), 86400) --

Re: [web2py] Changing the HTML attribute of fields generated by SQLFORM

2012-09-02 Thread Bruno Rocha
Server side DOM. An example: mysubmitbutton = form.elements('input[type=submit]')[0] mysubmitbutton[_value] = GO mysubmitbutton[_class] = btn btn-primary Other example, if you want to change the class of all input objects. inputs = form.elements(input') for input in inputs: input['_class']

Re: [web2py] Re: Global formstyle configuration

2012-09-02 Thread Bruno Rocha
This should work.. # On models class SQLFORM(SQLFORM): ''' Customized SQLFORM ''' def __init__(self, *args, **kwargs): kwargs.setdefault(formstyle, divs) super(MySQLFORM, self).__init__(*args, **kwargs) On Sun, Sep 2, 2012 at 8:11 PM, vinicius...@gmail.com

Re: [web2py] Classes in markmin

2012-09-02 Thread Bruno Rocha
There is markmin2pdf and markmin2html on gluon.contrib https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin --

Re: [web2py] web2py appliance released by Turnkey Linux

2012-09-01 Thread Bruno Rocha
It is running web2py 1.99.7, is there a way they upgrade to 2.0.5 ? *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: Using Python to get all the external links from a

Re: [web2py] Re: web2py book on github

2012-09-01 Thread Bruno Rocha
Include this: [ ] Rows.find(lambda row: bool(), limitby=(0,1)) --

Re: [web2py] Re: web2py book on github

2012-09-01 Thread Bruno Rocha
Also mention that this [x] new syntax: db.mytable.insert(myuploadfield=open()), thank you Iceberg Now works as: [ ] db.table.myuploadfield.default = open() --

Re: [web2py] Use web2py to create offline desktop application

2012-09-01 Thread Bruno Rocha
Yes! You have some options: 1 Use sqlite locally, use rocket server (built-in), use py2exe to pack your app as a windows application .exe, or py2app to pack as apple application. Take a look on to this: http://web2py.com/books/default/chapter/29/14#How-to-distribute-your-applications-as-binaries

Re: [web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Bruno Rocha
did you turned lazy_tables to True on your db definition? Bruno Rocha http://rochacbruno.com.br mobile Em 31/08/2012 10:02, Jim S j...@qlf.com escreveu: Getting the following: Traceback (most recent call last): File C:\dev\web2py\gluon\restricted.py, line 209, in restricted exec

Re: [web2py] help with apache

2012-08-31 Thread Bruno Rocha
There is something here: http://ubuntuforums.org/showthread.php?t=1636667 On Fri, Aug 31, 2012 at 7:02 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Address already in use: make_sock: could not bind to address [::]:80 --

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I cant understand how versioned folders would help on this case? I ran on to this issue a long time ago and I ended using pure html for this. script src={{=URL('static', 'js', args='mylib.js')}}?{{=get_random_number()}} This works for me when I need to bypass the cache to get the proper js

Re: [web2py] Tweet this and web2py forms. How do I design this?

2012-08-30 Thread Bruno Rocha
Without OAuth and permissions I only can see one way. The twitter url for tweets is: def tweet(): tweet_url = https://twitter.com/intent/tweet?original_referer=%(referer)srelated=%(related)ssource=%(source)stext=%(text)s form = SQLFORM(db.tweets) if form.process().accepted:

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I tested this on a project (maybe web2py version -1.97) response.files.append(URL('static', 'css', args='myfile.css', vars=dict(v=get_random( I dont know if it is working now, but I used the plan html for doing this. --

Re: [web2py] Tweet this and web2py forms. How do I design this?

2012-08-30 Thread Bruno Rocha
It is only possible if you have implemented OAuth and user gave access permission for your application. --

Re: [web2py] Re: Lazy_tables with virtual fields

2012-08-30 Thread Bruno Rocha
How are you defining the db connection? are you using models or modules? which db? --

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I think it is now working, I checked the source and there is: if isinstance(item,str): f = item.lower().split('?')[0] if f.endswith('.css'): s += css_template % item elif f.endswith('.js'): s += js_template % item elif

Re: [web2py] Cannot install on computer

2012-08-30 Thread Bruno Rocha
Which version of web2py? which version of windows? BTW: You have not to install web2py, web2py is executable, no need to install! If you downloaded the windows version .exe you just need to run it (if it is not working, please tell us your version of windows and web2py) If you download the

Re: [web2py] urgent mysql, postgresql, firebird, ... users.

2012-08-30 Thread Bruno Rocha
TICKET ID 127.0.0.1.2012-08-31.01-09-21.3e3284ec-20dd-4076-9a0b-889f72a85cf7 type 'exceptions.RuntimeError' Failure to connect, tried 5 times: Traceback (most recent call last): File /home/bcr/projects/web2py21/gluon/dal.py, line 6722, in __init__ self._adapter = ADAPTERS[self._dbname](*args)

Re: [web2py] urgent mysql, postgresql, firebird, ... users.

2012-08-30 Thread Bruno Rocha
Reverted to old checkout and it worked again, so the passwd it not wrong.. On Fri, Aug 31, 2012 at 1:41 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I do not think this is related. Sure this worked before? Looks like legitimate wrong password. On Thursday, 30 August 2012

Re: [web2py] urgent mysql, postgresql, firebird, ... users.

2012-08-30 Thread Bruno Rocha
Now I got this: bcr@vaiubuntu:~/projects/web2py203$ python web2py.py -a 1234 Traceback (most recent call last): File web2py.py, line 18, in module import gluon.widget File /home/bcr/projects/web2py203/gluon/__init__.py, line 15, in module from globals import current File

Re: [web2py] Sites not working on http://web2py.com/poweredby

2012-08-30 Thread Bruno Rocha
3 of them are hosted on my server. unfortunatelly I got problems migrating my VPS and I am working on this. Bruno Rocha http://rochacbruno.com.br mobile Em 31/08/2012 02:25, Jemes Hsu jemes...@gmail.com escreveu: --

Re: [web2py] Re: {{code}} compile in view

2012-08-29 Thread Bruno Rocha
You can use template render from gluon.template import render html = b{{=name}}/b {{for x in range(10)}} Hellobr {{pass}} print render(content=html, context=dict(name=Bruno)) On Wed, Aug 29, 2012 at 1:14 PM, lucas sjluk...@gmail.com wrote: ok, that is fine for simple code execution, but

Re: [web2py] Removing labels from forms

2012-08-29 Thread Bruno Rocha
for label in form.elements('label'): label[_style] = display:none; On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor alec.tayl...@gmail.com wrote: How do I remove labels from forms? I want to use placeholders instead... (this is for the auth.register form) Thanks for all suggestions,

Re: [web2py] Removing labels from forms

2012-08-29 Thread Bruno Rocha
there be a loop I can add before that to set the placeholder of each input? On Thu, Aug 30, 2012 at 3:58 AM, Bruno Rocha rochacbr...@gmail.com wrote: for label in form.elements('label'): label[_style] = display:none; On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor alec.tayl...@gmail.com

Re: [web2py] Multiple tables or a single big one?

2012-08-29 Thread Bruno Rocha
I generally do this on user function: profile_fields = ['first_name', 'last_name', 'email', 'description', 'picture'] if 'profile' in request.args: for field in db.auth_user.fields: if field not in profile_fields: db.auth_user[field].readable =

Re: [web2py] Changes in trunk when accessing a field in a row?

2012-08-29 Thread Bruno Rocha
can you show the code? I am using db.table.field.compute = lambda row: row.otherfield On Wed, Aug 29, 2012 at 4:09 PM, Daniel Gonzalez gonva...@gmail.com wrote: Hi, I have recently updated trunk. I am using a compute function when creating new entries. In the compute function I access

Re: [web2py] more benchmarks of web2py 2.0 in trunk

2012-08-28 Thread Bruno Rocha
For me on Linux Ubuntu 12.10 bcr@vaiubuntu:~/projects/web2py21$ python web2py.py -S welcome -N -R ../thisfile.py web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2012 Version 2.00.1 (2012-08-28 14:26:44) rc4 Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP

Re: [web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Bruno Rocha
- You can use conditional models. - You can use IF on models if not request.controller == public: # my logic goes here - You can go to the option B (simple separate app) - You can serve the login form as static html file http://yourapp/static/public.html - You can use

Re: [web2py] Major speed improvement need testers

2012-08-27 Thread Bruno Rocha
To solve this issue include in the line 88 of myapp.py https://github.com/rochacbruno/web2py_model_less_app/blob/master/modules/myapp.py#L88 self._LAZY_TABLES = [] On Mon, Aug 27, 2012 at 11:33 PM, Andrew awillima...@gmail.com wrote: Possible Issue, this might be due to the dal changes (or

Re: [web2py] Re: SEO Friendly URLs and Page Titles

2012-08-26 Thread Bruno Rocha
def show(): item_id = request.args(0) item_slug = request.args(1) query = (db.items.id == item_id) (db.items.slug == item_slug) item = db(query).select().first() return dict(item=item) http://myapp/items/show/1/awesome-product http://myapp/items/show/2/awesome-product On

Re: [web2py] web2py size

2012-08-26 Thread Bruno Rocha
examples images has 1.1 MB, examples static has 1.9MB On Sun, Aug 26, 2012 at 8:46 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: According to this the web2py size doubled in Oct 2011 yet I cannot think of what caused this. Can anybody help figure it out? What did we include that

Re: [web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-24 Thread Bruno Rocha
Martin, what about a twitter bootstrap plugin? we can create a plugin to inject bootstrap specific helpers. THUMBNAILS(), POPOVER(), MODAL(), PILLS() also a bootstrap manager. {{=bootstrapmanager(v=2.1, js=True)}} So it will be app agnostic. what do you think about? Em 24/08/2012 08:37,

Re: [web2py] Model for graph hierarchy (many-to-many ralationship)

2012-08-24 Thread Bruno Rocha
can you try changing db.bookpage to reference bookpage Em 24/08/2012 13:01, Niphlod niph...@gmail.com escreveu: There is something else going on. This is the log (no errors creating tables) of the following model on mysql 5.5. web2py trunk (but at least on table creation nothing should have

Re: [web2py] Web2py MVC pattern using wx for V

2012-08-24 Thread Bruno Rocha
You should see Rad2py, created by Mariano Reingart http://code.google.com/p/rad2py/ On Fri, Aug 24, 2012 at 6:14 PM, Christian Espinoza chespin...@gmail.comwrote: Hello guys, There are somebody with some experience using wx instead of a web view layer?? I have some questions about

Re: [web2py] Web2py MVC pattern using wx for V

2012-08-24 Thread Bruno Rocha
this: http://code.google.com/p/gui2py/ --

Re: [web2py] Major speed improvement need testers

2012-08-23 Thread Bruno Rocha
On Thu, Aug 23, 2012 at 3:11 PM, Anthony abasta...@gmail.com wrote: I'd also still be interested to see a real-world example of where this would be useful. Anthony Someone posted an example of GAE CPU Cycles, with class based Lazy Tables it lower to half cycles. Also there is another user

Re: [web2py] Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Bruno Rocha
Great! This new navbar is very better! Thank you Martin! On Thu, Aug 23, 2012 at 3:48 PM, Martín Mulone mulone.mar...@gmail.comwrote: Twitter Bootstrap scatfolding application *updated. Now is awesome :-P * Now based on version 2.1.0 (sync) * Menu based on twitter bootstrap navbar

Re: [web2py] Re: Twitter Bootstrap scatfolding application *updated.

2012-08-23 Thread Bruno Rocha
Put z-index: 0; on flash alert On Thu, Aug 23, 2012 at 4:05 PM, David Marko dma...@tiscali.cz wrote: The alert 'Well done! ...' conflicts somehow with menu when you click e.g. on 'Bootstrap' menu item ... Dne čtvrtek, 23. srpna 2012 20:48:03 UTC+2 Martin.Mulone napsal(a): Twitter

Re: [web2py] Limit output of a details page to only show some items.

2012-08-23 Thread Bruno Rocha
Considering this: def details(): try: equipment = db.equipment[int(request.args(0))] except: equipment = db(db.equipment.slug == request.args(0)).select(). first() return dict(equipment=equipment) Your view details.html should be h1{{=equipment.title}}/h1

Re: [web2py] SQLFORM key error

2012-08-23 Thread Bruno Rocha
web2py version?? On Thu, Aug 23, 2012 at 10:00 PM, pylix pyl...@gmail.com wrote: Here's my model db = DAL('sqlite://storage.sqlite') db.define_table('person', Field('name', requires=IS_NOT_EMPTY()), Field('phone', requires=IS_NOT_EMPTY()), Field('address',

Re: [web2py] Re: Major speed improvement need testers

2012-08-22 Thread Bruno Rocha
Is not an option to create a new branch? keep the current /gluon/* in the default branch and the optimized one in a separate branch, available only for those who want to use Python 2.7.3+ On Wed, Aug 22, 2012 at 10:28 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: We run into a major

<    1   2   3   4   5   6   7   8   9   10   >