[web2py] Re: SQLFORM very slow when table is big

2015-02-22 Thread André Kablu
Ok Thank you Niphlod, just found in manual this: If you want the field validated, but you do not want a drop-down, you must put the validator in a list.db.dog.owner.requires = [IS_IN_DB(db, 'person.id', '%(name)s')] hahaha sorry I was desperate to solve my problem.. Thanks! On Sunday,

[web2py] Re: SQLFORM very slow when table is big

2015-02-22 Thread André Kablu
Oh ok I got it... I just forgot about this b/c I use a manual autocomplete function... I was using IS_IN_DB just as a validator to make sure user don't try to input wrong value I think I`ll make one validator just for validate user... Do you think this is a good idea to add to the framework?

[web2py] SQLFORM very slow when table is big

2015-02-21 Thread André Kablu
Hi, I made some tests with lots of data on some tables. In some tests I was using: SQLFORM(db.table, record=rc) But it became very slow after putting data When I was debugging I found that if you use IS_IN_DB() it searches the other table even if you are selecting one existing record or

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-02-21 Thread André Kablu
Please add us Massimo: Company: NRG Internet Solutions Incorporated: Brazil website: http://www.nrg.com.br On Sunday, February 15, 2015 at 8:21:36 PM UTC-2, Massimo Di Pierro wrote: We need to update the list of companies that provide web2py consulting. This list is obsolete:

[web2py] After update 2.9.12, response.json is messing the screen

2015-01-21 Thread André Kablu
Hi all, I just updated one of my projects to 2.9.12 and after that all views that have a code like this does not work: SCRIPT('somecode(' + response.json + ')') the response.json is changing the content-type of the page to json... if we use: return response.json there will be no problem,

[web2py] Re: After update 2.9.12, response.json is messing the screen

2015-01-21 Thread André Kablu
json(data, default=default or custom_json) On Wednesday, January 21, 2015 at 5:04:31 PM UTC-2, André Kablu wrote: Hi all, I just updated one of my projects to 2.9.12 and after that all views that have a code like this does not work: SCRIPT('somecode(' + response.json

[web2py] Re: Error with response ?BUFFER? limitations

2014-10-28 Thread André Kablu
/issue8493 On Monday, October 27, 2014 12:38:02 PM UTC-7, André Kablu wrote: Hi all, Anyone can tell me if there are any limitations on response buffer size? I created a proccess that generates 6000 lines, when I try to output them to browser1 i got the error from Rocket: File /web2py/gluon

[web2py] Re: Error with response ?BUFFER? limitations

2014-10-28 Thread André Kablu
28, 2014 12:54:26 PM UTC-7, Derek wrote: I've looked at other bugs similar to this one, and one reports that on 32-bit Python, 2gb seems to be the largest amount of data you can send in one sendall. On Tuesday, October 28, 2014 10:35:10 AM UTC-7, André Kablu wrote: Thanks Derek, But seems

[web2py] Error with response ?BUFFER? limitations

2014-10-27 Thread André Kablu
Hi all, Anyone can tell me if there are any limitations on response buffer size? I created a proccess that generates 6000 lines, when I try to output them to browser1 i got the error from Rocket: File /web2py/gluon/rocket.py, line 152, in _sendall_darwin sent = self.socket.send(buf[offset:])

[web2py] one default application per domain

2014-06-28 Thread André Kablu
it should be a recurrent question, but I could not find anything related... I have two domains using the same web2py: routes.py # -*- coding: utf-8 -*- routers = dict( # base router BASE=dict( default_application='app1', domains = { 'py.test.com': 'app1',

[web2py] Re: ERROR when MYSQL try to CAST() to LONGTEXT

2014-06-13 Thread André Kablu
Sure. Did you pushed it? I cannot find it there... Many thanks! On Friday, June 13, 2014 1:45:44 PM UTC-3, Massimo Di Pierro wrote: I have a possible fix in trunk. Can you help test it? On Wednesday, 11 June 2014 23:06:44 UTC-5, André Kablu wrote: I have a mysql database and created

[web2py] ERROR when MYSQL try to CAST() to LONGTEXT

2014-06-11 Thread André Kablu
I have a mysql database and created a LIST:INTEGER field It is created in MYSQL as LONGTEXT type of data In one of my queries I have received an error: *WEB2PY QUERY:* db.table.id_field_list.contains(db.table2.id) *MYSQL QUERY:* SELECT * FROM table, table2 WHERE (table.id_field_list LIKE

[web2py] list reference with ondelete=set null breaking when delete parent

2014-03-20 Thread André Kablu
I have 2 tables, using sqlite: db.define_table('color', Field('color', 'string')) db.define_table('tshirt', Field('name', 'string'), Field('colors', 'list:reference color', ondelete=SET NULL)) When I delete a color, all

[web2py] list reference with ondelete=set null breaking when delete parent

2014-03-20 Thread André Kablu
I have 2 tables, using sqlite: db.define_table('color', Field('color', 'string')) db.define_table('tshirt', Field('name', 'string'), Field('colors', 'list:reference color', ondelete=SET NULL)) When I delete a color, all

[web2py] Re: form.custom.begin doesn't add the form _class and other attributes

2014-03-20 Thread André Kablu
you can do it by using FORM(_class='yourclass', _role='role') Em quinta-feira, 20 de março de 2014 13h14min17s UTC-3, Leonel Câmara escreveu: {{form['_class'] = 'service-form'}} {{form['_role'] = 'form''}} {{=form.custom.begin}} The generated html was: form action=#

Re: [web2py] Re: list reference with ondelete=set null breaking when delete parent

2014-03-20 Thread André Kablu
Yes just migrated to mongodb, and there really exist some issue. using CASCADE or SET NULL, it does not matter, web2py does not respect and remove the reference from the referencing collection or delete the reference... Em quinta-feira, 20 de março de 2014 16h16min43s UTC-3, André Kablu

[web2py] list:reference does not apply notnull=True

2014-03-02 Thread André Kablu
I am using version 2.9.1 beta When creating a db, if I use this: Field('product_ids', 'list:reference product') Does not force user to fill the field (not null). Even if I put notnull=True, the user can bypass the field and left it blank. Any ideas? -- Resources: - http://web2py.com -

[web2py] Re: list:reference does not apply notnull=True

2014-03-02 Thread André Kablu
just found the answer multiple=(1,x) anyway would be good if the notnull param works Em domingo, 2 de março de 2014 16h34min35s UTC-3, André Kablu escreveu: I am using version 2.9.1 beta When creating a db, if I use this: Field('product_ids', 'list:reference product') Does

[web2py] Possible BUG using legacy tables

2014-02-16 Thread André Kablu
Here is what I have: I have a legacy db in mysql named cep, so I'd created two dbs in my application, one for the app and one for this legacy table: db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all']) db_endereco = DAL('mysql://user:pass@localhost/cep')

[web2py] Re: Custom login form - How to detect login failure?

2014-02-16 Thread André Kablu
Or you could automatically check for auth.user_id right after the validation. Em domingo, 16 de fevereiro de 2014 12h39min40s UTC-3, Anthony escreveu: I suppose you could do: if response.flash == auth.messages.invalid_login: Otherwise, you can create an auth.settings.login_onfail

[web2py] Heavy memory usage

2013-09-02 Thread André Kablu
Hi all, I'd created one application that loads 15 lines of a mysql database. Then I put all 150k lines in a list(), doing many math calculations. The results are displayed to the user and process is finished. It is a very simple select, and a for loop to put values on the array and do math

[web2py] Re: github - please follow

2013-08-25 Thread André Kablu
Done. +1 Em sábado, 24 de agosto de 2013 20h26min03s UTC-3, Massimo Di Pierro escreveu: web2py has many users but few github followers. This is a problem because the number of followers is a metric that can be used to guess popularity. You can help. Get a github account and click on the

[web2py] Re: sqlform.factory multiple requires problem

2013-07-24 Thread André Kablu
If you use IS_IN_DB it will automatically check if is not empty. The function IS_IN_DB, if used inside list brackets [IS_IN_DB(...,...)] will not show the dropdown. This is the correct behavior. Em quarta-feira, 24 de julho de 2013 20h19min18s UTC-3, Antonis Konstantinos Tzorvas escreveu:

[web2py] date fields not to display NONE in grid

2013-07-06 Thread André Kablu
Is there a way to not display None in not filled date fields when displaying in SQLFORM.grid? I tried to use represents but I cannot change type to string to show '' or a message. Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group.

[web2py] LOAD does not work after upgrading to last GIT

2013-07-04 Thread André Kablu
)}} Any ideas? Thanks! André Kablu -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https

[web2py] Re: LOAD does not work after upgrading to last GIT

2013-07-04 Thread André Kablu
Ok just got it... I replaced static folder and it worked... Something that was changed in there will not accept backward compatibility. Em quinta-feira, 4 de julho de 2013 16h22min10s UTC-3, André Kablu escreveu: Hi, I just updated my web2py to last GIT version, and all my LOAD functions

[web2py] Re: php and web2py together in shared hosting

2013-06-20 Thread André Kablu
Hi, The best way to do this is to create subdomains. So you will have: /home/user/www /home/user/phpapp and you can create a subdomain this way: php.mydomain.com (that refers to /home/user/phpapp) to call it directly using your main www.mydomain.com you can create a redirect app. in web2py

[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread André Kablu
Hi, I don`t know why you are referencing another table, but if this is only for populate that field and you know that those values will not change or increase, you may consider using lists: METALS = ( (1, 'silver'), (2, 'gold'), (3, 'iron'), (4, 'zinc') )

[web2py] smartgrid reference problem

2013-06-17 Thread André Kablu
Hi all, I am trying to create a grid with a query for auth_user table doing this: def controller1(): query = ((db.auth_user.id == db.auth_membership.user_id) (db.auth_membership.group_id == 1)) grid = SQLFORM.smartgrid(db.auth_user,

[web2py] Re: smartgrid reference problem

2013-06-17 Thread André Kablu
20h36min24s UTC-3, André Kablu escreveu: Hi all, I am trying to create a grid with a query for auth_user table doing this: def controller1(): query = ((db.auth_user.id == db.auth_membership.user_id) (db.auth_membership.group_id == 1)) grid = SQLFORM.smartgrid

[web2py] Re: requires_login() not working for second instance of auth

2013-06-11 Thread André Kablu
Nevermind... found that this is no bug... need to add auth.settings.controller = 'x' ;) Em segunda-feira, 10 de junho de 2013 23h17min49s UTC-3, André Kablu escreveu: I wrote some code here extending auth to create different sessions... Then I could create here the second instance of Auth

[web2py] Re: requires_login() not working for second instance of auth

2013-06-10 Thread André Kablu
it a shot. Anthony On Monday, June 10, 2013 1:04:29 AM UTC-4, André Kablu wrote: Thanks again Anthony! It is a good alternative. .. However It would be very good if we could use 2 auth... As you can see I'd changed table names... I'll study auth class in deep to see if i can extend

[web2py] Re: changing class of a custom form not working

2013-06-09 Thread André Kablu
This works fine for defining another class like: input id=test class=input-small type=text value= name=test But not for defining size manually like: input id=test size=30 type=text value= name=test Anyway we can change fields using classes now! Thanks!!! Em domingo, 9 de junho de 2013

[web2py] does redirect acts like return?

2013-06-09 Thread André Kablu
just a question if I have this code: def test(var): if var: redirect('x') other code... return if I do test(true) will other code run or the function just exits? thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users

[web2py] Re: does redirect acts like return?

2013-06-09 Thread André Kablu
well, just to understand better lets say I have this: def test(var): if var: redirect('x') other code... return def test2(): Em domingo, 9 de junho de 2013 18h53min41s UTC-3, André Kablu escreveu: just a question if I have this code: def test(var): if var

[web2py] requires_login() not working for second instance of auth

2013-06-09 Thread André Kablu
I build a application that have 2 AUTH objects... I use 1 Auth object for the main site functionality that contains many levels of users (using default tablename settings for auth) and I made 1 more Auth table to use as SITE ADMIN, just to control main site admin functions on a separated

[web2py] Re: requires_login() not working for second instance of auth

2013-06-09 Thread André Kablu
Thanks again Anthony! It is a good alternative. .. However It would be very good if we could use 2 auth... As you can see I'd changed table names... I'll study auth class in deep to see if i can extend it and change some function to make it accept some parameter so it would be possible to set

[web2py] changing class of a custom form not working

2013-06-07 Thread André Kablu
Hi all, I am trying to change a class of a field using form.element on my user.html view: {{=form.custom.begin}} Name: {{ form.element('input',_name='first_name')['_class']='input-medium' =form.custom.widget.first_name }} {{=form.custom.end}} It changes the HTML on the source

[web2py] Re: changing class of a custom form not working

2013-06-07 Thread André Kablu
one more information... if I put on my html file a html code like this: input id=test class=input-small type=text value= name=test it also does not change the css effect to the correct class input-small Em sexta-feira, 7 de junho de 2013 16h51min36s UTC-3, André Kablu escreveu: Hi all, I am

[web2py] Re: changing class of a custom form not working

2013-06-07 Thread André Kablu
! Em sexta-feira, 7 de junho de 2013 17h02min25s UTC-3, André Kablu escreveu: one more information... if I put on my html file a html code like this: input id=test class=input-small type=text value= name=test it also does not change the css effect to the correct class input-small Em sexta

[web2py] Re-create database tables

2013-05-31 Thread André Kablu
Hi all, I am creating a new app using MYSQL... and many times I needed to change the fields, including keys, foreign keys, etc... And I always get many mysql errors of not possible to rename, not possible to delete, not possible to create, etc... So what I need to do is to copy all my files

[web2py] Re: help with functions index

2013-05-30 Thread André Kablu
recipes book. On Monday, 27 May 2013 20:50:08 UTC-5, André Kablu wrote: O I got that... thanks for the response... However I still miss some details... like for an example I was looking some way to redirect the successful register to another view... to continue the registration process

[web2py] Re: help with functions index

2013-05-27 Thread André Kablu
is the key you want to retrieve from the dictionary, and the second is a default value to return in case the key does not exist. Anthony On Sunday, May 26, 2013 3:38:17 PM UTC-4, André Kablu wrote: Hi all, I have been adventuring myself with web2py for some months now, just to learn

[web2py] help with functions index

2013-05-26 Thread André Kablu
Hi all, I have been adventuring myself with web2py for some months now, just to learn it, and I am enjoying very much. web2py is an awesome MVC. However it is my first time with python (yes I am only using python now b/c of web2py :D ), and I am missing so much some kind of functions index for