Re: [web2py] Update many rows at once separately

2012-08-22 Thread Bruno Rocha
You can try something like this: def test(): rows = db(db.test).select() return dict(rows=rows) def update_level(): for key, value in request.post_vars: try: db.table[key].update_record(level=value) except: # do something if key is invalid.

Re: [web2py] Is there a way to leave a message for other logged in users

2012-08-22 Thread Bruno Rocha
this web2py plugin: http://dev.s-cubism.com/plugin_messaging or, if you want a live chat for all logged-in users you can try pubnub.com http://jsfiddle.net/nolandubeau/4AWFF/3/ On Wed, Aug 22, 2012 at 4:27 PM, Ray Morris r...@crtpoms.com wrote: Just wondering if anyone knows a way that one

Re: [web2py] Update many rows at once separately

2012-08-22 Thread Bruno Rocha
You have to give id and name to form inputs, and select needs options. Ttry this on web2py shell print SELECT(*[OPTION(option, **{_value: option, _selected:selected if option == 1 else None}) for option in (0, 1)], _name=1, _id=1) select id=1 name=1option value=00/optionoption selected=selected

Re: [web2py] Creating a Contact Form

2012-08-22 Thread Bruno Rocha
how is your mail config? from gluon.tools import Mail mail = Mail() mail.settings.sender = ? .server = ? did you configured the login? is it ok? use a try block to check which error you get. try: mail.send() except Exception, e: print str(e) Em 23/08/2012

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

2012-08-21 Thread Bruno Rocha
You want to create a slug? web2py comes with IS_SLUG validator which helps with this. db.define_table(product, Field(title, unique=True), ... ... Field(slug, compute=lambda row: IS_SLUG()(row.title)[0] ) So now you can use slug field to build your urls. URL(product, show,

Re: [web2py] Accessing db['auth_user'] raises exception

2012-08-21 Thread Bruno Rocha
which web2py version? On Tue, Aug 21, 2012 at 7:41 PM, Daniel Gonzalez gonva...@gmail.com wrote: Hi, I have defined so my authorization table (db.py): # Use the authorization table for agents agent_table = auth.settings.table_user_name db.define_table( agent_table,

Re: [web2py] Problem trying to get a value from a rows object

2012-08-21 Thread Bruno Rocha
You are getting an empty rows object def change_membership(): if request.vars.id: row = db(db.auth_membership.user_id == request.vars.id).select() if not row: redirect(.) id = row[0].id form = SQLFORM(db.auth_membership,

Re: [web2py] Clarification on using classes in models

2012-08-20 Thread Bruno Rocha
You can define classes on models or controllers, the only caveat is that you can never import that classes in to other modules. They will be defined and will be available for the current request on global environment (means that it will be available on the flow of

Re: [web2py] generic.html controller wide?

2012-08-20 Thread Bruno Rocha
Not tested, but should work. in your controllers/default.py response.view = default/generic.%s % request.extension def index(): return dict(message=Hello from index) def contact(): return dict(message=Hello from contact) then, in your views folder create a generic file:

Re: [web2py] Creating None DB forms in the Controller with Formating?

2012-08-18 Thread Bruno Rocha
form = SQLFORM.factory(Field(name), Field(email, requires=IS_EMAIL())) On Sat, Aug 18, 2012 at 7:11 AM, Simon Carr simonjc...@gmail.com wrote: Hi, I understand how to create forms using SQLFORM and FORM, but the latter does not provide any table formatting as SQLFORM does. How do I create

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

2012-08-18 Thread Bruno Rocha
are you using auth.signature in any table? if you have Auth, the auth tables will not be lazy (I think) because it needs to be defined on auth.define_tables() On Sat, Aug 18, 2012 at 6:58 AM, David Marko dma...@tiscali.cz wrote: I have redesigned one of my app by moving requires into Field

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

2012-08-18 Thread Bruno Rocha
What about db.table.field.readable = True db.table.field.default = x ? --

Re: [web2py] Where to host web2py

2012-08-18 Thread Bruno Rocha
I use Linode (1024 and 2048 instances) powered by NGINX and UWSGI. Also I am now hosting web2pyslices.com sponsored by http://pythonanywhere.com, I have plans to move to Python Anywhere when they release the PRO plan with Postgres. But if did not needed postgres, I would like to use

Re: [web2py] Where to host web2py

2012-08-18 Thread Bruno Rocha
http://rochacbruno.com.br/web2py-on-pythonanywhere/ --

Re: [web2py] Select a table given its table name?

2012-08-17 Thread Bruno Rocha
def feed(table): return db(db[table].id0).select() --

Re: [web2py] Get row count for query without loading data into memory

2012-08-17 Thread Bruno Rocha
It returns no Row. It return an int object db(db.person.id 0).count() *Translates to SELECT count(*) FROM PERSON WHERE ID )* *So the result is an integer object.* *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br |

Re: [web2py] Select a table given its table name?

2012-08-17 Thread Bruno Rocha
Also, you would get exceptions if table does not exists, so: def feed(table): *try*: return db(db[table].id0).select() *except* KeyError: return Sorry, table not found *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821

Re: [web2py] Adding hyperlink to response.subtitle?

2012-08-15 Thread Bruno Rocha
response.subtitle = *XML*(T('Aggregator for')+A('Company', _href=' http://company.org/')) *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: Open links which points outside your own site in a new

Re: [web2py] How to access app directly without subfolder ?

2012-08-15 Thread Bruno Rocha
Maybe it can help you: http://rochacbruno.com.br/web2py-routes/ --

Re: [web2py] url validator

2012-08-15 Thread Bruno Rocha
I would use something like this: *import requests* class IS_VERIFIED_URL(object): def __init__(self, error_message=url does not exist!): self.error_message = error_message def __call__(self, url): error = None *response = requests.get(url)* if

Re: [web2py] Complex query in DAL?

2012-08-15 Thread Bruno Rocha
Thats evil! I would create a view or a procedure in database. On Wed, Aug 15, 2012 at 6:41 PM, pbreit pbreitenb...@gmail.com wrote: Should I even attempt a complex query like this in DAL? Where do I begin? $q = SELECT u.user_id, u.fname, u.lname, u.telephone1, u.email, u.is_active,

Re: [web2py] Is powergrid considered dead ?

2012-08-15 Thread Bruno Rocha
HI, I am not updating this project since web2py gets the SQLFORM.grid feature, But, I am using this on some websites and its working very well for Json datasources. Bur you can go and use datatables.net or Jqgrid, or sencha, or wijmo grid ( http://wijmo.com/widgets/wijmo-complete/grid/) this

Re: [web2py] Re: Model-less approach should be standadized in web2py in future releases ...

2012-08-15 Thread Bruno Rocha
On Wed, Aug 15, 2012 at 5:52 PM, pbreit pbreitenb...@gmail.com wrote: I disagree. Current model definition works fine for vast majority of projects and the alternatives are still much too confusing IMO. I just proposed a solution for testing: http://rochacbruno.com.br/lazy-dal-beta-working/

Re: [web2py] Re: Helper for many-to-many result sets?

2012-08-14 Thread Bruno Rocha
Taking this exact example Foreach movie in movies print movie.title foreach stars in movie.stars print star.name I guess `movie.stars` is a list:string field? if so.. there's one-liner solution table = TABLE(*[TR(TD(movie.title), TD(UL(*[LI(star.name) for star in

Re: [web2py] Re: Helper for many-to-many result sets?

2012-08-14 Thread Bruno Rocha
, delete* methods But it will only happens depending on your model and relations definition. Can you share your model for those 2 tables? On Tue, Aug 14, 2012 at 3:10 AM, Bruno Rocha rochacbr...@gmail.com wrote: Foreach movie in movies print movie.title foreach stars in movie.stars

Re: [web2py] Re: Book clarification regarding verify_email reset_password

2012-08-14 Thread Bruno Rocha
Thinking again I am guessing a better option for this... (note: the problem here is not to get the 'key', the problem is to be able to build the string and interpolate multiple keys on to it on different running times) I think this could be better. auth,messages.verify_email = 'Click on the

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

2012-08-14 Thread Bruno Rocha
in your controller.. if request.args(0) == view: db.table.field.readable = True grid = SQLFORM.grid(.) http://zerp.ly/rochacbruno Em 14/08/2012 09:37, Mandar Vaze mandarv...@gmail.com escreveu: I have a few fields that have compute attribute defined. I've only inserted the records

Re: [web2py] Re: Functions in Views

2012-08-14 Thread Bruno Rocha
maybe {{=prettydate(item.timestamp, *T*)}} --

Re: [web2py] Grahs

2012-08-14 Thread Bruno Rocha
If it is a webapp you can start looking here: https://google-developers.appspot.com/chart/interactive/docs/index --

Re: [web2py] how to use Not belongs

2012-08-13 Thread Bruno Rocha
use the unary ~ operator db(~db.table1.field1.belongs(array)).update(field2=False) Bruno Rocha www.rochacbruno.com.br Em 13/08/2012 05:21, Pradeesh pradeeshnara...@gmail.com escreveu: In my control I have an array with so many values. I want to write a dal query to update a table rows which

Re: [web2py] enter a 'comma' instead of dot for floating point numbers.

2012-08-13 Thread Bruno Rocha
take a look on custom validators http://rochacbruno.com.br/custom-validator-for-web2py-forms/ Em 13/08/2012 10:54, max dulip.withan...@gmail.com escreveu: One of my users use german keyboard. is there any possibility for the dot in a floating point number identified as comma. for me global

Re: [web2py] some explanations needed on prettydate

2012-08-13 Thread Bruno Rocha
It also happens for me, I did not found a better way to solve, but I think prettydate needs to be rewritten for accurate responses. On Mon, Aug 13, 2012 at 6:11 PM, Pystar aitoehi...@gmail.com wrote: Hi guys, I am storing my timestamp in my database using the datetime.datetime.now()

Re: [web2py] Functions in Views

2012-08-13 Thread Bruno Rocha
You only can call functions that are in global scope. if you define function in /models/ so you can call those functions in controllers and views. If you defined in controller, so you have to return it to the view. controller/default.py --- def foo(): return bar

Re: [web2py] cherokee alive

2012-08-13 Thread Bruno Rocha
Its Great! I would like to use Cherokee again! (I used it with Pylons on the past) On Mon, Aug 13, 2012 at 9:23 PM, Michele Comitini michele.comit...@gmail.com wrote: https://github.com/cherokee/webserver Good to see new commits lately. mic -- --

Re: [web2py] Re: Appengine CPU cycles

2012-08-13 Thread Bruno Rocha
The easy way is /models/ . nothing here ... /modules/mymodels.py from gluon import current from gluon.dal import DAL, Field def define_my_tables(*table_list): db = DAL() tables_definitions = { owner: {fields: [Field(name), Field(gender)], format: %(name)s, migrate:

Re: [web2py] Re: Appengine CPU cycles

2012-08-13 Thread Bruno Rocha
Thinking again... It could be better if define_my_tables run once on the very first request and table keeps defined forever from there --

Re: [web2py] Re: Book clarification regarding verify_email reset_password

2012-08-13 Thread Bruno Rocha
Why not: auth.messages.verify_email = 'Click on the link http://%(env)s/%(url)s/%(key)s to verify your email' \ % dict(env=request.env.http_host, url=URL(...), key= lambda : lazy_get_the_key()) Should this works? being lazy_get_the_key() a function which selects

Re: [web2py] 500 Error at http://www.web2py.org/

2012-08-12 Thread Bruno Rocha
I never knew about web2py.org (what is that? is it a web2py foundation web site?) --

Re: [web2py] trouble ... call a model and a module by the same name?

2012-08-12 Thread Bruno Rocha
No problem! Thats how plugins works models/plugin_foo.py modules/plugin_foo.py *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: web2py routes https://rochacbruno.snipt.net/web2py-routes/ Get a

Re: [web2py] Random Records From Database

2012-08-12 Thread Bruno Rocha
db(db.table).select(orderby=random) # does not works on GAE *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: web2py routes https://rochacbruno.snipt.net/web2py-routes/ Get a signature like this.

Re: [web2py] Connecting with database that has tables in it

2012-08-12 Thread Bruno Rocha
That feature exists only for Mysql and Postgres under scripts/extract_mysql_models.py You can try to rewrite this for SQLserver, or you can use db.executesql(RAW SQL) *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br |

Re: [web2py] Triggering LOAD

2012-08-12 Thread Bruno Rocha
/views/default/index.html !-- begin -- button class=load_content data-url={{=URL('default', 'otherthing1')}} data-target=ajax_container Click to load content1 /button button class=load_content data-url={{=URL('default', 'otherthing2')}} data-target=ajax_container Click to load content2 /button

Re: [web2py] Problems with restful + PUT

2012-08-10 Thread Bruno Rocha
On Fri, Aug 10, 2012 at 11:00 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Which web2py version? On Friday, 10 August 2012 08:39:40 UTC-5, Tito Garrido wrote: Same error using locals() :( On Thu, Aug 9, 2012 at 5:23 PM, Bruno Rocha rocha...@gmail.com wrote: try to replace

Re: [web2py] Batch upload of media?

2012-08-10 Thread Bruno Rocha
https://github.com/mdipierro/web2py-recipes-source/raw/master/apps/04_advanced_forms/web2py.app.fileuploader.w2p https://github.com/mdipierro/web2py-recipes-source/raw/master/apps/04_advanced_forms/web2py.app.upload.w2p

Re: [web2py] Re: How do larger teams develop with Web2py?

2012-08-09 Thread Bruno Rocha
+1 Great words Massimo! its the best conclusion of Programming-Motherfucker method! :) Em 09/08/2012 10:48, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: Listen everybody. This thread is hilarious but not very professional. I think most of the people on this thread are hardcore

Re: [web2py] Problems with restful + PUT

2012-08-09 Thread Bruno Rocha
try to replace return dict(GET=GET, POST=POST, PUT=PUT, DELETE=DELETE) withreturn locals() I dont know, but maybe its the problem On Wed, Aug 8, 2012 at 10:49 PM, Tito Garrido titogarr...@gmail.com wrote: Hi folks, *I have a simple table:* *db.define_table('estadio',

Re: [web2py] Implementing a messaging system

2012-08-08 Thread Bruno Rocha
did you see the messaging plugin? web2py.com/plugins http://zerp.ly/rochacbruno Em 08/08/2012 01:58, shartha m.mirghorb...@gmail.com escreveu: Hi, I'd like to implement a messaging system (between the users of the website), and I need help to implement it. The way I've done it is to create

Re: [web2py] Re: Implementing a messaging system

2012-08-08 Thread Bruno Rocha
In this page: http://dev.s-cubism.com/web2py_plugins you can find a set of plugins, one of them are message plugin. (experimental, but I used and it works well) Also there is a video (in portuguese) about real time message: https://vimeo.com/38972256 --

Re: [web2py] *** integer values into string variable ***

2012-08-08 Thread Bruno Rocha
Is that SQLITE? did you created it as integer and after that changed to string? SQLITE does not have ALTER-TABLE command, so even if you change a field from integer to string, web2py will see it as string, but the db will still store as integer. You need to change the datatype to CHAR() on your

Re: [web2py] Re: Setting cookies in models?

2012-08-08 Thread Bruno Rocha
I think you need to use current from gluon import current and inside the decorator function access current.request instead of request On Wed, Aug 8, 2012 at 5:48 PM, Yarin ykess...@gmail.com wrote: A little more about what I'm trying to do: I have a decorator function defined in a model

Re: [web2py] Re: Setting cookies in models?

2012-08-08 Thread Bruno Rocha
if he is setting the cookie inside a decorator function (inner-function) maybe it gets defined on the start of the request. when the decorated function gets passed to the decorator inner-function, I guess the cookie will be already setted. (but we need to take a look at the code to figure out the

Re: [web2py] Re: How do larger teams develop with Web2py?

2012-08-08 Thread Bruno Rocha
That is how I am used to work: http://programming-motherfucker.com/ --

Re: [web2py] Re: Simple ? How to remove Form Name (form :) from FORM Helper

2012-08-07 Thread Bruno Rocha
replace this: {{=BEAUTIFY(response._vars)}} with this: {{=form}} --

Re: [web2py] Re: Appengine CPU cycles

2012-08-06 Thread Bruno Rocha
What do you have in models? All model files runs alphabetically for each request, so we need to know what are you doing on model files. Can you try to test with an empty brand new app, remove all files from models folder and try your simple controller import logging def test():

Re: [web2py] Re: Appengine CPU cycles

2012-08-06 Thread Bruno Rocha
On Mon, Aug 6, 2012 at 4:19 PM, Felipe Meirelles fel...@felipemeirelles.com.br wrote: Without any model I have a huge drop on the cpu use, from around 300ms to around 60ms. Still higher than with Django, but its acceptable by the concept of the framework. Because of that I am using a

Re: [web2py] Re: Appengine CPU cycles

2012-08-06 Thread Bruno Rocha
On Mon, Aug 6, 2012 at 5:43 PM, Pystar aitoehi...@gmail.com wrote: but doesnt going your model less route go against web2py tenet of convention over configuration? although it looks interesting Yes, my sample code is very complex to implement. And this is why I am insisting on tests. If

Re: [web2py] Re: grid not ordering lambda-generated column values correctly

2012-08-06 Thread Bruno Rocha
Basically you have to keep in mind that 'orderby and limitby will be done by the database engine, the db does not know anything about your lambda' logic. --

Re: [web2py] newline in Linktext

2012-08-05 Thread Bruno Rocha
{{=A(XML(i.A.ShortTitle+br /+i.Title) ,_href=URL(r=request,f=' Article',vars=dict(id=i.id)))}} On Sun, Aug 5, 2012 at 6:02 PM, BlueShadow kevin.bet...@gmail.com wrote: {{=A(XML(i.A.ShortTitle+\n+i.Title) ,_href=URL(r=request,f='Article',vars=dict(id=i.id)))}} --

Re: [web2py] insert() syntax problem

2012-08-05 Thread Bruno Rocha
You have an extra u u = db.user_media_interactions id = db(u).insert(*user_id*=int(request.vars.user_id), *lecture_id*=li.lecture_id, *lecture_item_id*=int(request.vars.lecture_item_id), *rawstring*=istr, * progress*=prg) On Sun, Aug 5, 2012 at 6:48 PM, lucas sjluk...@gmail.com wrote: u =

Re: [web2py] Webservice for web widgets: security

2012-08-03 Thread Bruno Rocha
I think you can generate a KEY in script.js (you need to generate this file dynamically) So you will have a key to check back when the widget gets rendered. On Fri, Aug 3, 2012 at 12:31 PM, Tito Garrido titogarr...@gmail.com wrote: Hi Folks, I have created a jsonp function that will be used

Re: [web2py] URL strategy for single application

2012-08-02 Thread Bruno Rocha
routes.py routers = dict( BASE = dict( default_application = 'myapp', default_controller = 'mycontroller', default_function = 'function1', controllers = ['default', 'mycontroller', 'etc'], functions =

Re: [web2py] RESTful services with curl and/or python

2012-08-02 Thread Bruno Rocha
you can also post this in web2pyslices.com http://zerp.ly/rochacbruno Em 02/08/2012 13:30, Dirk Krause dir...@googlemail.com escreveu: Hi, I tried to pull together the different sources for restful services, including various hints in this group and of course the excellent web2py

Re: [web2py] Giving a talk promoting web2py over Django

2012-08-01 Thread Bruno Rocha
web2py has a more flexible template engine, you can use Python there and does not need to create a tons of template filters to get simple things done. Also in Django the template language sucks a lot because of the limitations. Let me give an example: To build a map using google maps API you

Re: [web2py] Re: web2pyslices.com down

2012-07-31 Thread Bruno Rocha
HI! Sorry, it is getting too much hits/day and my VPS are not able to handle. I am migrating the website to PythonAnywhere.com - which is now the hosting sponsor for web2pylices. I hope to get it published there by end of the day. Thanks On Tue, Jul 31, 2012 at 1:43 PM, Alec Taylor

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-31 Thread Bruno Rocha
I agree that we need to focus on PLUGIN-SYSTEM improvement. Web2py needs a better plugin architecture, integrated with git/hg repos, with a distribution tool like PyPi or RubyGEMS (I think plugins has to be independent Python modules distributed in PyPi and instaled with pip install

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-31 Thread Bruno Rocha
Movu.ca can be used as a base for all those things. Also, the publushing system that Massimo created can be easily integrated with Movu.ca for page administrations. The most complete website I made with Movuca is ( http://www.menuvegano.com.br/) - The whole thing was created for the needs of

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-31 Thread Bruno Rocha
Thanks! That is a vegan cooking social network. where people has a profile[1] to post recipes and tips, and also creates a virtual cook book. It has an Android app for recipe publishing/searching [1]http://www.menuvegano.com.br/person/show/rochacbruno --

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-31 Thread Bruno Rocha
http://localhost:8000/demo/**setup/installhttp://localhost:8000/demo/setup/install yields: invalid function (setup/install) For security reason, I did a temporary change in setup controller https://github.com/rochacbruno/Movuca/blob/master/controllers/setup.py You can see I included a x

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-31 Thread Bruno Rocha
Traceback (most recent call last): File /web2py_github/gluon/**restricted.py, line 205, in restricted exec ccode in environment File /web2py_github/applications/**muvuca/views/bootstrap/app/**home.html, line 423, in module NameError: name 'featured_members' is not defined

Re: [web2py] Re: Generating web2py views for use in PhoneGap?

2012-07-31 Thread Bruno Rocha
In my point of view mobile projects with PhoneGap have to be RESTful, you need to create static/JavaScript based pages and use jquery to access the API created in web2py. I've done some apps with Tiggzi.com --

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Bruno Rocha
put extension=False in URL redirect(URL('index2',extension='html',vars={'text':request.vars.text}, extension=False)) --

Re: [web2py] BR()

2012-07-25 Thread Bruno Rocha
Good idea, very easy, I am used to do this. {{=CAT(*[BR() for i in range(5)])}} --

Re: [web2py] Re: auth for entire controller

2012-07-25 Thread Bruno Rocha
You can do in the way anthony said, but you can do it all in models, no need to touch controller code. models/...py auth = Auth() # a dict of controllers as keys, and a list of allowed groups as values auth_rules = {

Re: [web2py] Re: auth for entire controller

2012-07-25 Thread Bruno Rocha
You can do in the way anthony said, but you can do it all in models, no need to touch controller code. Note, I did suggest moving it to a model file to avoid unnecessarily executing all the models. The redirect in: if not any(has_membership): redirect(URL(r=request, c='default',

Re: [web2py] BR()

2012-07-25 Thread Bruno Rocha
On Thu, Jul 26, 2012 at 12:39 AM, pbreit pbreitenb...@gmail.com wrote: Wow, you would write that instead of brbrbrbrbr?? Sometimes the repetition is a variable {{=CAT(*[BR() for i in xrange(*how_many_times*)])}} --

Re: [web2py] computed fields question

2012-07-24 Thread Bruno Rocha
you dont need to set writable=False. I think it is default for conputed fields. I've seem this happening before, but I cant remember the reason. (may be the writable False can be the issue) http://zerp.ly/rochacbruno Em 24/07/2012 07:34, Vasile Ermicioi elff...@gmail.com escreveu: hi, I have

Re: [web2py] computed fields question

2012-07-24 Thread Bruno Rocha
yes I think it is a bug. the update form method checks for writable fields. should be documented or fixed. can you open the ticket? http://zerp.ly/rochacbruno Em 24/07/2012 10:26, Vasile Ermicioi elff...@gmail.com escreveu: may be the writable False can be the issue yes, that is, thanks a

Re: [web2py] Re: weird behavior in crud update

2012-07-24 Thread Bruno Rocha
In your view, do you have any link a or any img or any iframe? My be you have an empty href='' or an empty src='' ? If you have it, so that is the problem! empty href or src or rel attributes leads on to form submit problems --

Re: [web2py] Re: weird behavior in crud update

2012-07-24 Thread Bruno Rocha
http://www.bennadel.com/blog/2236-Empty-SRC-And-URL-Values-Can-Cause-Duplicate-Page-Requests.htm http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/ --

Re: [web2py] client-side validation plugin

2012-07-24 Thread Bruno Rocha
Sounds great! I would like to see it built in in SQLFORM(..., clientvalidation=True) On Mon, Jul 23, 2012 at 5:36 PM, Franco franco.alar...@gmail.com wrote: Greetings everyone, I want to share with you a plugin that adds client side validation to your forms. I hope this be helpful to you.

Re: [web2py] Re: prettydate question

2012-07-23 Thread Bruno Rocha
do you have an it-it.py in languages folder? looks like the encoding of translations file is corrupted. try replacing T with lamba x: x for testing td{{=prettydate(row.deadline, lambda x: x)}}/td On Mon, Jul 23, 2012 at 1:28 PM, ctrlSoft zerooo...@gmail.com wrote: yes.

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Bruno Rocha
there is no request.auth_user by default, did you created this? I think you can do (with trunk) {{if thisgroupid in auth.user_groups:}} --

Re: [web2py] Logic check in View, to check if auth.user.group_id...

2012-07-23 Thread Bruno Rocha
, Jul 24, 2012 at 5:36 AM, Alec Taylor alec.tayl...@gmail.comwrote: On Tue, Jul 24, 2012 at 5:09 AM, Bruno Rocha rochacbr...@gmail.comwrote: there is no request.auth_user by default, did you created this? I think you can do (with trunk) {{if thisgroupid in auth.user_groups

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Bruno Rocha
Also, there is a nice example in the web2py cookbook Source code is here: https://github.com/mdipierro/web2py-recipes-source/tree/master/source/04_advanced_forms/06_Creating_a_Form_Wizard App is here:

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-23 Thread Bruno Rocha
fixed link for app: https://github.com/mdipierro/web2py-recipes-source/raw/master/apps/04_advanced_forms/web2py.app.form_wizard.w2p --

Re: [web2py] HOWTO: getting web2py to run on Android mobile devices

2012-07-22 Thread Bruno Rocha
That works on my Galaxy S - http://www.web2pyslices.com/slice/show/1490/how-to-install-web2py-on-android-for-fun-without-rooting-the-device --

Re: [web2py] http://www.web2pyslices.com/ is down

2012-07-20 Thread Bruno Rocha
Yeah, sorry. I have to upgrade my Linode, also, bots from google and baidu are eating my server. I need to solve some sessions problems. I will upgrade the Linode for webslices and also I will put a bigger donate, sponsor link in web2pyslices website, I am paying backups and hosting by my own,

Re: [web2py] web2py.com offline

2012-07-20 Thread Bruno Rocha
Well, I think web2py.com and web2pyslices.com needs a better hosting solution. On Fri, Jul 20, 2012 at 2:22 PM, Dave davidramsayreinh...@gmail.com wrote: can't get to the website today. -- --

Re: [web2py] web2py.com offline

2012-07-20 Thread Bruno Rocha
I could not be able to restart NGINX/UWSGI, I am waiting my backups to finish and I will need to restart my Linode. The same problem :/ On Fri, Jul 20, 2012 at 3:58 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Anyway, considering they have different hosting it is suspicious they

Re: [web2py] Routing by SLUG with default controller?

2012-07-20 Thread Bruno Rocha
I dont know if it is a bug or feature (but I like it), you can do it in models! models/0_routing.py if request.controller in MYLISTOFGROUPS: groupslug = str(request.controller) # here you can use deep copy or just str() request.controller = 'group' request.function = 'show'

Re: [web2py] DAL/Postgres not creating a table

2012-07-20 Thread Bruno Rocha
are you sure the migrate is not False in db = DAL(...) ? try including migrate=True in your define_table On Fri, Jul 20, 2012 at 6:17 PM, Marek Mollin rog...@gmail.com wrote: Hey, Problem is as follows. I start a clean db in psql. Test the connection + delete all the /databases files to

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-19 Thread Bruno Rocha
The only problem here is WHO will build the Killer web2py CMS? Instant Press is built by @Martin and I dont know if he gets contribution Movu.ca is built by @rochacbruno (me) and I did not get too much contribution (two or 3 people helped with ideas and translations) Sorry community, but we do

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-07-19 Thread Bruno Rocha
IMHO the real question is *what is the cause of plugins little usage?* The misunderstanding of plugin system, to be honest I think the web2py plugin system is not good. Now with modules, we can have a better base for plugin development. --

Re: [web2py] tenjin template engine and web2py

2012-07-18 Thread Bruno Rocha
controllers/default.py from tenjin import * from tenjin.helpers import * engine = tenjin.Engine(path=['views']) def index(): context = dict(form=SQLFORM(db.table)) return engine.render('page.pyhtml', context) That should works!

Re: [web2py] Re: [web2py-dev] Asyncronous Application Sync

2012-07-17 Thread Bruno Rocha
I would set a Dropbox shared folder on both machines (there is a server dropbox.py for linux) So create a script which copies the .sqlite in to Dropbox folder. On city machine a scheduled task read records on sqlite and import new records directly to mysql. You are going to need a 'signal'

Re: [web2py] customizing email for registration verification

2012-07-17 Thread Bruno Rocha
You need to use the url like this img src='+URL('static', 'images', args='poweredby.png', host=True, scheme=True)+'/ --

Re: [web2py] Re: Recommendations on model file size (database tables)

2012-07-17 Thread Bruno Rocha
The conditional models are good, but the problem is the fact that they are not reusable, when you need the same table on multiple controllers, or you have to define it globally, or you have to repeat the definition on every sub model. I think having a module with functions or classes to define

Re: [web2py] Re: Hiding columns in SQLFORM.grid

2012-07-17 Thread Bruno Rocha
if request.function == 'new': db.mytable.myfield.readable = False db.mytable.myfield2.readable = False db.mytable.myfield3.readable = False On Tue, Jul 17, 2012 at 5:16 PM, Ashraf Mansour ad...@aqar-riyadh.comwrote: Hi, How can i hide columns in the create form generated by

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruno Rocha
I am having a related problem. Your Linode, blouserver, has exceeded the notification threshold (1000) for disk io rate by averaging 1382.77 for the last 2 hours: I receive this message every 2 hour, so my nginx get bas gateway and I need to do rm sessions/* and also /etc/init.d/uwsgi restart

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruno Rocha
16, 2012 8:14 AM, Bruno Rocha rochacbr...@gmail.com wrote: I am having a related problem. Your Linode, blouserver, has exceeded the notification threshold (1000) for disk io rate by averaging 1382.77 for the last 2 hours: I receive this message every 2 hour, so my nginx get bas gateway and I

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