[web2py] Reserved key error (expires)

2014-12-27 Thread Avi A
Hi, Need some help with setting cookies. While basically setting cookies works, when I add this line : response.cookies['expires'] = 3600 * 24 returns: CookieError: Attempt to set a reserved key: expires Thanks, Avi. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation

[web2py] Re: utf8 problem

2014-12-08 Thread Avi A
It's OK.. On Monday, December 8, 2014 7:51:39 AM UTC+2, Avi A wrote: Hi, On some translations fields I am using Hebrew characters. While they are displayed OK on the Form view and on the admin db view, on the view page it self they are rendered as: 'f_category_t': '\xd7\xa8\xd7\x90\xd7

[web2py] utf8 problem

2014-12-07 Thread Avi A
Hi, On some translations fields I am using Hebrew characters. While they are displayed OK on the Form view and on the admin db view, on the view page it self they are rendered as: 'f_category_t': '\xd7\xa8\xd7\x90\xd7\xa9\xd7\x95\xd7\xa0\xd7\x95\xd7\xaa'} and Angularjs displays it as jibberish,

[web2py] signup and login with ajax.

2014-12-04 Thread Avi A
Hi, Is it possible to replace the default signup and login forms with a customized ajax post? like: ajax(some_sign_upcontroller.load?email=a...@gmail.comname=namepassword=password, '', 'welcome') ajax(some_log_in_controller.load?email=a...@gmail.compassword=somepassword,'', 'welcome again')

[web2py] Re: openshift

2014-11-09 Thread Avi A
-a yourpassword -p 443 then [ctrl]+D to exit. On Saturday, 8 November 2014 12:22:07 UTC-6, Avi A wrote: Hi, Maybe someone can help with that, how do I start the openshift web2py version localy ? Also how do I set the admin password? I mean this is what i have on the parameters_80 file

[web2py] openshift

2014-11-08 Thread Avi A
Hi, Maybe someone can help with that, how do I start the openshift web2py version localy ? Also how do I set the admin password? I mean this is what i have on the parameters_80 file: password=pbkdf2(1000,20,sha512)$b7328c..205b thanks, Avi. -- Resources: - http://web2py.com - http

[web2py] Send data to print.

2014-08-10 Thread Avi A
Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller, then the controller print the string directly to the printer. Any suggestions/directions? Thanks, Avi. -- Resources: - http://web2py.com

[web2py] Re: Send data to print.

2014-08-10 Thread Avi A
javascript to do so, plenty of examples can be found on the web. Regards On Sunday, August 10, 2014 1:20:05 PM UTC+2, Avi A wrote: Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller

[web2py] Re: Send data to print.

2014-08-10 Thread Avi A
I think this is what i need or something similar: https://pypi.python.org/pypi/pycups On Sunday, August 10, 2014 3:45:02 PM UTC+3, Avi A wrote: I want the users to open the app from mobile devices, andriod and ios, and i want the process to be transparent for them. I mean they shoudn't

[web2py] web2py with google visualisation app.

2014-08-06 Thread Avi A
Hi, I just wanted to share a short video of an app I made. What it does in short; I do mobile automated tests locally. I use selenium/appium and applitools (awesome startup) which does screenshots comparison for me and when the test ends, they send a json with failed/passed counts info. when

[web2py] Re: web2py with google visualisation app.

2014-08-06 Thread Avi A
? I always thought that to be difficult and have not ventured far in that area yet. I hope you can share how you did it! Thanks :) On Wednesday, August 6, 2014 7:23:56 PM UTC+8, Avi A wrote: Hi, I just wanted to share a short video of an app I made. What it does in short; I do mobile

[web2py] posting a dict on ajax load vars

2014-06-08 Thread Avi A
Hi, I want to pass a dict in ajax function like that: $(#create_report).click(function(){ url_report = 'eco_reports?graph_data={{=graph_data}}'; ajax(url_report, '', 'save_as_link'); and the controller starts with something like that: def eco_reports()::

[web2py] Re: posting a dict on ajax load vars

2014-06-08 Thread Avi A
(graph_data): .. On Monday, June 9, 2014 1:02:00 AM UTC+3, Avi A wrote: Hi, I want to pass a dict in ajax function like that: $(#create_report).click(function(){ url_report = 'eco_reports?graph_data={{=graph_data}}'; ajax(url_report

[web2py] Re: boolean field type in a query.

2014-03-27 Thread Avi A
:16 PM UTC+1, Avi A wrote: Now I use: my_tests_list = db((db.t_tests.created_by == auth.user.id) (db.t_tests.f_test_is_a_clone == False) ).select() and the list is still emply. SELECT t_tests.id, t_tests.f_test_name, t_tests.f_test_project, t_tests. f_test_platform

[web2py] Re: boolean field type in a query.

2014-03-27 Thread Avi A
(db.t_tests.f_test_is_a_clone != True) -Mandar On Thursday, March 27, 2014 1:58:16 AM UTC+5:30, Avi A wrote: Now I use: my_tests_list = db((db.t_tests.created_by == auth.user.id) (db.t_tests.f_test_is_a_clone == False) ).select() and the list is still emply. SELECT t_tests.id

[web2py] Re: boolean field type in a query.

2014-03-27 Thread Avi A
need to fetch False OR NULL records db( (db.t_tests.f_test_is_a_clone == False) | (db.t_tests.f_test_is_a_clone == None) ).select() or (hidden gem) db(db.t_tests.f_test_is_a_clone.belongs((False, None), null=True)).select() On Thursday, March 27, 2014 12:46:18 PM UTC+1, Avi

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Avi A
the Expression class) but the latter cannot. Anthony On Tuesday, March 25, 2014 8:08:40 PM UTC-4, Avi A wrote: Hi, i have a table with a boolean field: Field('f_test_is_a_clone', type='boolean', label=T('Test is a clone')), And this is the query, where I don't want to return cloned

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Avi A
. On Wednesday, March 26, 2014 8:53:10 PM UTC+2, Avi A wrote: Thanks you all and for the debugging tip. :) On Wednesday, March 26, 2014 7:57:28 PM UTC+2, Anthony wrote: In DAL queries, you must use , |, ==, and ~ rather than and, or, is, and not. This is because in Python, the former

[web2py] boolean field type in a query.

2014-03-25 Thread Avi A
Hi, i have a table with a boolean field: Field('f_test_is_a_clone', type='boolean', label=T('Test is a clone')), And this is the query, where I don't want to return cloned tests: my_tests_list = db((db.t_tests.created_by == auth.user.id) (not db.t_tests .f_test_is_a_clone)).select()

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-23 Thread Avi A
22, 2014 8:49:11 PM UTC+1, Avi A wrote: Same. /models/z_import_catalog.py, line 13, in module item = db(db.t_items.unfi_product == row[5]).select().first() NameError: name 'db' is not defined On Saturday, March 22, 2014 9:20:03 PM UTC+2, Niphlod wrote: try calling it z_whatever.py

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
, March 21, 2014 9:28:14 PM UTC+1, Avi A wrote: Hi, I'm trying to create a background job/function. I'm locating the file on the models directory, as I read on the book. When I try to run the script manually, I get an error saying that db is not defined. This is part of the code where I get

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
Sorry, I'm still getting the same error. I called that file: db_wizard_catalog_insert.py , so it's located after the db_wizard.py and I just run the file. Is that what you meant? On Saturday, March 22, 2014 4:05:03 PM UTC+2, Avi A wrote: Yes I tried that too, it didn't help. but now for some

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
PM UTC+1, Avi A wrote: Sorry, I'm still getting the same error. I called that file: db_wizard_catalog_insert.py , so it's located after the db_wizard.py and I just run the file. Is that what you meant? On Saturday, March 22, 2014 4:05:03 PM UTC+2, Avi A wrote: Yes I tried that too

[web2py] Creating a background task script on models, db is not defined.

2014-03-21 Thread Avi A
Hi, I'm trying to create a background job/function. I'm locating the file on the models directory, as I read on the book. When I try to run the script manually, I get an error saying that db is not defined. This is part of the code where I get the error: .. .. catalog =

[web2py] Re: Great summary of web2py

2014-03-05 Thread Avi A
I think that there on the features list, frameworks seekers would love to hear about the amazing web2py ajax and component functions and all the eco method as part of the awesome mvc system. On Wednesday, March 5, 2014 6:23:14 PM UTC+2, Jorge Pereira wrote: VP vtp2007@... writes:

[web2py] How to render a returned json

2014-03-04 Thread Avi A
Hi, I'm getting on a controller a json response as expected, and I didn't find a way how to parse it yet: r = requests.post(url, data=json.dumps(payload), headers=headers) r.content returns something like that: { owner_ids: [ ], labels: [ { id: 7864106, created_at:

Re: [web2py] How to render a returned json

2014-03-04 Thread Avi A
thanks, i've tried it but I am not able to parse it: I tried both: pivotal = json.loads(r.content) session.flash(pivotal['url']) session.flash(pivotal[0].url) On Tuesday, March 4, 2014 5:18:02 PM UTC+2, Jonathan Lundell wrote: On 4 Mar 2014, at 5:35 AM, Avi A avia...@gmail.com javascript

[web2py] Re: How to render a returned json

2014-03-04 Thread Avi A
I do the same I get: TypeError: string indices must be integers, not str On Tuesday, March 4, 2014 3:35:31 PM UTC+2, Avi A wrote: Hi, I'm getting on a controller a json response as expected, and I didn't find a way how to parse it yet: r = requests.post(url, data=json.dumps(payload

Re: [web2py] Re: How to render a returned json

2014-03-04 Thread Avi A
Yes, got it now, many thanks. On Tuesday, March 4, 2014 7:42:28 PM UTC+2, Jonathan Lundell wrote: On 4 Mar 2014, at 9:19 AM, Avi A avia...@gmail.com javascript: wrote: I do the same I get: TypeError: string indices must be integers, not str Try catching that exception and printing

[web2py] using requests library ques

2014-03-03 Thread Avi A
Hi, I need some help with implementing requests library. What I did: I have cloned the requests library to my app modules app. (didn't install anything) I tried these both options I found, one at a time: requests = local_import('requests') from modules import requests And in both cases I got:

[web2py] Re: using requests library ques

2014-03-03 Thread Avi A
Lol, that works. thanks. On Monday, March 3, 2014 6:20:55 PM UTC+2, Anthony wrote: Try just doing: import requests Anthony On Monday, March 3, 2014 11:15:33 AM UTC-5, Avi A wrote: Hi, I need some help with implementing requests library. What I did: I have cloned the requests library

[web2py] How to pre filter a table I want to join.

2014-02-24 Thread Avi A
Hi, I want to join t_a and t_b: rows = db(db.t_a.created_by == auth.user.id).select(join=db.t_b.on(db.t_a.f_y == db.t_b.id)) that works, But first I want to filter out t_b, for example: t_b to include only records where f_x == 3. what I tried did not work, it just ignored it, nothing was

[web2py] Re: How to pre filter a table I want to join.

2014-02-24 Thread Avi A
thanks, yes i just realised i don't need the joint for the filtering. On Monday, February 24, 2014 4:57:37 PM UTC+2, Anthony wrote: t_b = db.t_b.f_x ==3 Doesn't look like you do anything with the above. Why not: rows = db((db.t_a.created_by == auth.user.id) (db.t_b.f_x == 3)).select(

[web2py] Re: How to pre filter a table I want to join.

2014-02-24 Thread Avi A
)) return locals() On Monday, February 24, 2014 5:03:36 PM UTC+2, Avi A wrote: thanks, yes i just realised i don't need the joint for the filtering. On Monday, February 24, 2014 4:57:37 PM UTC+2, Anthony wrote: t_b = db.t_b.f_x ==3 Doesn't look like you do anything with the above. Why

[web2py] Re: How to pre filter a table I want to join.

2014-02-24 Thread Avi A
I'll try to filter the t_tests only first. On Monday, February 24, 2014 4:51:31 PM UTC+2, Avi A wrote: Hi, I want to join t_a and t_b: rows = db(db.t_a.created_by == auth.user.id).select(join=db.t_b.on(db.t_a.f_y == db.t_b.id)) that works, But first I want to filter out t_b, for example

[web2py] Re: How to pre filter a table I want to join.

2014-02-24 Thread Avi A
= db.t_tests.f_test_milestone == request.vars.milestone graph_query = graph_query (milestone_query) if request.vars.env !='ALL': env_query = db.t_tests.f_tests_env == request.vars.env graph_query = graph_query (env_query) Many thanks. :). On Monday, February 24, 2014 4:51:31 PM UTC+2, Avi

[web2py] Re: return all results for a field if no query.

2014-02-23 Thread Avi A
, February 22, 2014 3:25:34 PM UTC-5, Avi A wrote: Great, thanks. the moreover idea is what i was missing. Yeah, I'll replace the args with vars url, thanks. On Saturday, February 22, 2014 9:36:58 PM UTC+2, Niphlod wrote: every db.table.column == parameter is something that further

[web2py] return all results for a field if no query.

2014-02-22 Thread Avi A
Hi, Assuming I want to create an ajax query that will filter the results according to some data in fields: for example: ajax url: ... eco/1/6/4/5/3 def eco: my_content = db.table.created_by == auth.user.id query_a = db.table.field_a == request.args(0) query_b = db.table.field_b==

[web2py] Re: return all results for a field if no query.

2014-02-22 Thread Avi A
PM UTC+1, Avi A wrote: Hi, Assuming I want to create an ajax query that will filter the results according to some data in fields: for example: ajax url: ... eco/1/6/4/5/3 def eco: my_content = db.table.created_by == auth.user.id query_a = db.table.field_a == request.args(0

[web2py] Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
Hi, I created a table with a password field. I got an ajax (web2py component) form where a user fill the password, and if it's OK, it does something. It works fine, but the problem is that if I use for example ! in the password field , the form won't be accepted. Is there a solution for that? I

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
with the Ajax call in the browser? Please show some more code an explain exactly what is happening. On Sunday, February 16, 2014 5:52:04 AM UTC-5, Avi A wrote: Hi, I created a table with a password field. I got an ajax (web2py component) form where a user fill the password, and if it's OK, it does

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
:17 PM UTC+1, Avi A wrote: All I see is:invalid request rendered on the #org_form_target #model db.define_table('t_orgs', Field('f_org_name', type='string', label=T('Organization Name')), Field('f_org_code', type='password', label=T('Organization pasword

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
ReferenceError: encodedURIComponent is not defined How do I define it? Do I have to import something? Thanks. On Sunday, February 16, 2014 3:05:04 PM UTC+2, Avi A wrote: great, thanks . On Sunday, February 16, 2014 3:03:40 PM UTC+2, Niphlod wrote: and what you expected ? :-P you built

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
This almost works (no error): encodeURIComponent (without the d). But it doesn't find it On Sunday, February 16, 2014 3:48:22 PM UTC+2, Avi A wrote: ReferenceError: encodedURIComponent is not defined How do I define it? Do I have to import something? Thanks. On Sunday, February 16

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
it works. (and not 123!). On Sunday, February 16, 2014 4:35:55 PM UTC+2, Anthony wrote: Sorry, should be encodeURIComponent. What do you mean it doesn't find it? On Sunday, February 16, 2014 8:52:06 AM UTC-5, Avi A wrote: This almost works (no error): encodeURIComponent (without the d

[web2py] Re: Special chars (like !) on ajax form.

2014-02-16 Thread Avi A
Oops. alright, thanks a lot. On Sunday, February 16, 2014 4:58:06 PM UTC+2, Anthony wrote: You didn't update your controller code -- request.args(0) should now be request.vars.code. On Sunday, February 16, 2014 9:46:47 AM UTC-5, Avi A wrote: I mean that it displays the searching

[web2py] Show items i created only on form reference fields.

2014-02-08 Thread Avi A
Hi, Assuming different users are adding projects to the t_projects table which is a referenced field in t_tests table as below: db.define_table('t_tests', Field('f_test_name', type='string', label=T('Test Name')), Field('f_test_project', type='reference t_projects', ..

[web2py] Re: Show items i created only on form reference fields.

2014-02-08 Thread Avi A
great thanks. On Sunday, February 9, 2014 3:47:44 AM UTC+2, Anthony wrote: Assuming different users are adding projects to the t_projects table which is a referenced field in t_tests table as below: db.define_table('t_tests', Field('f_test_name', type='string', label=T('Test

[web2py] Re: Trying to build a post api.

2014-02-03 Thread Avi A
are only converting one of them. You'll need to do some debugging to figure out exactly which field or fields are generating errors, and then make the appropriate corrections. On Sunday, February 2, 2014 4:21:37 PM UTC-5, Avi A wrote: getting this error: ValueError: invalid literal for long

[web2py] Re: Trying to build a post api.

2014-02-02 Thread Avi A
t.validate_and_insert(**t._filter_fields(post_params)) else: raise HTTP(400) return locals() On Saturday, February 1, 2014 11:24:02 PM UTC+2, Avi A wrote: Yes, that's what I want. I'll give it a try , thanks. On Saturday, February 1, 2014 10:30:28 PM UTC+2, Anthony wrote

[web2py] Re: Trying to build a post api.

2014-02-02 Thread Avi A
HTTP(400) return locals() Apologize for the confusion I made. Thanks. On Thursday, January 30, 2014 12:30:52 PM UTC+2, Avi A wrote: Hi, I am trying something like that: #on one local script instance: import requests test_params = {'api_key': 'api_key', 'test': 'test', 'f_platform

[web2py] Re: Trying to build a post api.

2014-02-01 Thread Avi A
: The string field you showed was for f_platform_name, but in your test_params, you have f_platform, which I assume must be an integer or reference field (the str(long(obj)) code is only called for id, integer, and reference type fields in the DAL). On Friday, January 31, 2014 4:18:53 PM UTC-5, Avi

[web2py] Re: Trying to build a post api.

2014-02-01 Thread Avi A
Alright, I turned those fields to be strings, also had to modify the DAL and added (no idea why): , adapter_args=dict(foreign_keys=False), And now it's working. Thanks a lot of the support, the teaching and the patient. On Saturday, February 1, 2014 11:19:36 AM UTC+2, Avi A wrote: Yes, some

[web2py] Re: Trying to build a post api.

2014-02-01 Thread Avi A
data model and what you're trying to achieve with the API. Anthony On Saturday, February 1, 2014 9:16:09 AM UTC-5, Avi A wrote: Alright, I turned those fields to be strings, also had to modify the DAL and added (no idea why): , adapter_args=dict(foreign_keys=False), And now it's working

[web2py] Re: Trying to build a post api.

2014-02-01 Thread Avi A
Yes, that's what I want. I'll give it a try , thanks. On Saturday, February 1, 2014 10:30:28 PM UTC+2, Anthony wrote: Without the ability to post data to reference fields it's a problem to achieve it. just posting the reference data as strings won't allow me to make these filters, unless I

[web2py] Re: join after filtering first table

2014-01-31 Thread Avi A
It's OK thanks. On Friday, January 31, 2014 7:57:45 PM UTC+2, Massimo Di Pierro wrote: Please show the model and explain in english what you want to do. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Trying to build a post api.

2014-01-31 Thread Avi A
rest_action = _action().get(method, None) AttributeError: 'NoneType' object has no attribute 'get' On Friday, January 31, 2014 2:12:44 PM UTC+2, Anthony wrote: Yes, now check what is in r.content. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Trying to build a post api.

2014-01-31 Thread Avi A
9:09:21 PM UTC+2, Anthony wrote: Is that what's in r.content? If so, looks like you didn't add the return locals() line at the bottom of your api() function. Anthony On Friday, January 31, 2014 1:23:53 PM UTC-5, Avi A wrote: rest_action = _action().get(method, None) AttributeError

[web2py] Re: Trying to build a post api.

2014-01-31 Thread Avi A
post_params.api_key. Anthony On Friday, January 31, 2014 2:20:57 PM UTC-5, Avi A wrote: I did, but now I see that i didn't put it left enough. Now the error I get: if db(db.auth_user.api_key == post_params.api_key).count(): AttributeError: 'dict' object has no attribute 'api_key' Maybe I

[web2py] Re: Trying to build a post api.

2014-01-31 Thread Avi A
=settings.migrate) On Friday, January 31, 2014 10:04:05 PM UTC+2, Anthony wrote: Oops, this: t.validate_and_insert(t._filter_fields(**post_params)) should be: t.validate_and_insert(**t._filter_fields(post_params)) Anthony On Friday, January 31, 2014 2:46:23 PM UTC-5, Avi A wrote

[web2py] Re: Trying to build a post api.

2014-01-31 Thread Avi A
'} On Friday, January 31, 2014 10:58:11 PM UTC+2, Anthony wrote: Doesn't look like that's going into a string field. Maybe check the call being made. On Friday, January 31, 2014 3:20:51 PM UTC-5, Avi A wrote: return str(long(obj)) ValueError: invalid literal for long() with base 10

[web2py] post (**vars) question.

2014-01-30 Thread Avi A
Hi, Looking at that example: def POST(table_name,**vars): return db[table_name].validate_and_insert(**vars) I'm trying to do something like this: @request.restful() def api(): clients = db(db.auth_user).select(db.auth.api_key) t = db.t_tests_results def POST(**post_params):

[web2py] Trying to build a post api.

2014-01-30 Thread Avi A
Hi, I am trying something like that: #on one local script instance: import requests test_params = {'api_key': 'api_key', 'test': 'test', 'f_platform': 'platform', 'f_device': 'device', 'steps': 'steps', 'matches':'matches', 'missmatches': 'missmatches', 'steps': 'steps'} r =

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
for the existence of that single key via a query. if db(db.auth_user.api_key == post_params.api_key).count(): return t.validate_and_insert(t._filter_fields(**post_params)) Anthony On Thursday, January 30, 2014 5:30:52 AM UTC-5, Avi A wrote: Hi, I am trying something like that: #on one local

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
I understand the if, only the .count() I don't understand. On Thursday, January 30, 2014 5:33:19 PM UTC+2, Avi A wrote: Sorry for the not working, I thought my mistake would be obvious. On the console where i sent the post i got Process finished with exit code 0 but i could not see

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
AM UTC-5, Avi A wrote: Sorry for the not working, I thought my mistake would be obvious. Describing the specific failure often makes it easier to home in on the source of the problem. First line: does it mean that this if statement knows to search the auth.user records till it finds

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
Actually I do get an error: rest_action = _action().get(method, None) AttributeError: 'NoneType' object has no attribute 'get' On Thursday, January 30, 2014 7:28:23 PM UTC+2, Avi A wrote: Thanks for the explanation. It stiil doesn't add records to the table. Is there any where I can

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
UTC-5, Avi A wrote: Hi, I am trying something like that: #on one local script instance: import requests test_params = {'api_key': 'api_key', 'test': 'test', 'f_platform': 'platform', 'f_device': 'device', 'f_steps': '10', 'f_matches':'7', 'f_missmatches': '3', 'f_missing

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
what do you mean? How can I check it? On Thursday, January 30, 2014 8:39:56 PM UTC+2, Anthony wrote: What does .validate_and_insert return? On Thursday, January 30, 2014 1:11:18 PM UTC-5, Avi A wrote: Thank you very much. No errors now, but still not inserting. I'll give it some more

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
from the client where you are making the API requests. Anthony On Thursday, January 30, 2014 2:29:02 PM UTC-5, Avi A wrote: what do you mean? How can I check it? On Thursday, January 30, 2014 8:39:56 PM UTC+2, Anthony wrote: What does .validate_and_insert return? On Thursday, January 30

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
Nothing is returned: avi@avi-S500CA:~/applitools$ python test_json.py avi@avi-S500CA:~/applitools$ On Thursday, January 30, 2014 11:42:24 PM UTC+2, Anthony wrote: Just run your request code from a Python shell and check the value of r.content. Anthony On Thursday, January 30, 2014 4:22

[web2py] join after filtering first table

2014-01-30 Thread Avi A
Is that the way to do it?: filtered_t_a= db.t_a.created_by == auth.user.id rows = db(filtered_t_a.id== db.t_b.id).select() for r in rows: print row.filtered_t_a.name, 'has', row.t_b.description -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Trying to build a post api.

2014-01-30 Thread Avi A
= requests.post('http://127.0.0.1:8000/qatests/api', params=test_params) and check the value of r.content. On Thursday, January 30, 2014 4:47:20 PM UTC-5, Avi A wrote: Nothing is returned: avi@avi-S500CA:~/applitools$ python test_json.py avi@avi-S500CA:~/applitools$ On Thursday, January 30, 2014

[web2py] update via ajax getting error.

2014-01-29 Thread Avi A
Hi, I am trying something like that: (render current api key and update it if clicking) on the view: button type=button id=change_api_keyGet new api key/button div id= target{{=LOAD('default','api_key.load',ajax=True)}}/div script type=text/javascript $(document).ready(function(){

[web2py] Re: update via ajax getting error.

2014-01-29 Thread Avi A
Thanks, I'm still getting the same error. On Thursday, January 30, 2014 12:18:35 AM UTC+2, Niphlod wrote: the syntax is wrong it's db(condition).update(column_name=value) not db(condition).update(db.table.column_name=value) On Wednesday, January 29, 2014 11:09:40 PM UTC+1, Avi

[web2py] Re: update via ajax getting error.

2014-01-29 Thread Avi A
db(db.auth_user.id == auth.user.id).update(api_key == uuid.uuid4()) TypeError: update() takes exactly 1 argument (2 given) On Thursday, January 30, 2014 12:30:04 AM UTC+2, Avi A wrote: Thanks, I'm still getting the same error. On Thursday, January 30, 2014 12:18:35 AM UTC+2, Niphlod

[web2py] Re: update via ajax getting error.

2014-01-29 Thread Avi A
I also get on the error log on the Variables : ).update undefined On Thursday, January 30, 2014 12:42:03 AM UTC+2, Avi A wrote: db(db.auth_user.id == auth.user.id).update(api_key == uuid.uuid4()) TypeError: update() takes exactly 1 argument (2 given) On Thursday, January 30, 2014 12:30

[web2py] Send local script results to web2py

2014-01-25 Thread Avi A
Hi, Assuming I want to run a testing script locally and send the test results to a web2py app. Would that be the way to do it? #local script import requests test_results = {'api_key': x, 'Fail': 'etc'} r = requests.get(somedomain.com/default/api/*get*, params=test_results) # link def api():

[web2py] How not to update data on live version.

2014-01-12 Thread Avi A
Hi, Assuming i got my local version, which I want to upload to the live version. How do I make the updating without overwritng/updating the db on the live version? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: How not to update data on live version.

2014-01-12 Thread Avi A
upload your applications/yourapp/databases folder. You really should read about database migrations in the web2py book and provide more information when asking such questions, ie. the database type, etc. Regards On Sunday, January 12, 2014 11:20:08 AM UTC+1, Avi A wrote: Hi, Assuming i got

[web2py] can't see errors on components.

2014-01-12 Thread Avi A
Hi, Working on ajax components, I got error/s. It flashes there is an error. but where can I find the code? thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: Important New Year News: Edison Award

2014-01-03 Thread Avi A
Good luck :). On Saturday, January 4, 2014 6:08:38 AM UTC+2, Massimo Di Pierro wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-31 Thread Avi A
%20org_code%20%2B%20%22 ((adding the encoded or decoded chars + NOT replacing the var with it's value.) Thanks. On Tuesday, December 31, 2013 12:26:43 AM UTC+2, Avi A wrote: I was in the direction in one of the tries... Thanks. On Monday, December 30, 2013 11:17:44 PM UTC+2, Anthony wrote

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-31 Thread Avi A
variable must be done in Javascript, so it would be: var url = '{{=URL('default', 'org_form_load.load')}}'; $.web2py.component(url + '/' + org_code, 'org_form_target'); Anthony On Tuesday, December 31, 2013 2:38:37 PM UTC-5, Avi A wrote: Still stuck with that. While this is rendered

[web2py] with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
Hi, I have this on the view: div input name=name onkeyup=ajax('org_form_load.load', ['name'], 'org_form_target') / /div div id = org_form_target/div and something like this on the controller: def org_form_load(): org_code = request.vars.name org_code_name =

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
30, 2013 6:14:57 PM UTC+2, Anthony wrote: The form is not accepted when it is first created, so you will always get that error message. Instead, you want: elif form.errors: response.flash = 'There was an error..' Anthony On Monday, December 30, 2013 10:21:58 AM UTC-5, Avi

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
, December 30, 2013 12:18:33 PM UTC-5, Avi A wrote: Thanks, It solved the error getting after the form is loaded into the page, but still nothing happen if I submit the form. This is what I do: if form.process().accepted: response.flash = 'Success!' elif form.errors

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
How is the name (input value) is passed in this component template/case? (i click the code and the form won't load into the page.). On Monday, December 30, 2013 7:49:32 PM UTC+2, Avi A wrote: Thanks. I will look into it. Happy new year! and thanks for all the awesome support! On Monday

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
). Then call $.web2py.component() with that URL, and in the org_form_load action, use request.args(0) instead of request.vars.name. Anthony On Monday, December 30, 2013 12:56:19 PM UTC-5, Avi A wrote: How is the name (input value) is passed in this component template/case? (i click the code

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
It works only till the alert... script function insert_component(org_code) { alert(org_code); $.web2py.component('%s', 'org_form_target'); % URL('default', 'org_form_load.load/org_code'); } /script On Monday, December 30, 2013 8:27:00 PM UTC+2, Avi A wrote: ok thanks. On Monday, December 30

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
within the {{...}} template delimiters. Anthony On Monday, December 30, 2013 3:58:10 PM UTC-5, Avi A wrote: It works only till the alert... script function insert_component(org_code) { alert(org_code); $.web2py.component('%s', 'org_form_target'); % URL('default', 'org_form_load.load

[web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
Hi, I'm doing something like that: if auth.user: my_org = db(db.t_org_members.f_org_member == auth.user.id).select(db.t_org_members.f_org_rep) if my_org: for m in my_org: my_org_members = db(db.t_org_members.f_org_rep ==

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
or as locals() and it still renders the last one only. On Friday, December 27, 2013 8:12:15 PM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 9:53 AM, Avi A avia...@gmail.com javascript: wrote: Hi, I'm doing something like that: if auth.user: my_org = db(db.t_org_members.f_org_member

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
Alright, I see what you mean. I'll give it a try. Thanks. On Friday, December 27, 2013 8:37:55 PM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 10:23 AM, Avi A avia...@gmail.com javascript: wrote: Thanks, I wasn't wrong, this is what I need: {{for member in org_member_data:}} what

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
for case my_org is empty i wrote: if my_org: not good enough? (if not empty?) On Friday, December 27, 2013 8:37:55 PM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 10:23 AM, Avi A avia...@gmail.com javascript: wrote: Thanks, I wasn't wrong, this is what I need: {{for member

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
:54:34 PM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 10:53 AM, Avi A avia...@gmail.com javascript: wrote: for case my_org is empty i wrote: if my_org: not good enough? (if not empty?) If that happens, what does the view see? On Friday, December 27, 2013 8:37:55 PM UTC+2

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
, December 27, 2013 9:14:55 PM UTC+2, Avi A wrote: user logged in the view: if he is in a group: till now he will see the group members' data and take some action later on. else: will sign up for a group. after page refresh will see the group members' data. (will have a different page

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
member.auth_user.email throws the same error. auth_user.email is defined in the select on the controller, as far as i understand, among other fields from the auth user table.. On Saturday, December 28, 2013 12:35:54 AM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 2:20 PM, Avi A avia

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
/tdtd111/tdtdaviavia4u+1@g.../td tdfile/tdtdAvi/tdtdAbramovitch/td/tr/tbody/table On Saturday, December 28, 2013 12:35:54 AM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 2:20 PM, Avi A avia...@gmail.com javascript: wrote: Now I am able to get the list as you suggested with append. But i

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Avi A
I created a dict instead of a list and I'm getting there...thanks. On Saturday, December 28, 2013 12:44:09 AM UTC+2, Jonathan Lundell wrote: On 27 Dec 2013, at 2:42 PM, Avi A avia...@gmail.com javascript: wrote: member.auth_user.email throws the same error. auth_user.email is defined

  1   2   >