[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_c

[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, f

[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.com&name=name&password=password, '', 'welcome') ajax(some_log_in_controller.load?email=a...@gmail.com&password=somepassword,'', 'welcome again

[web2py] Re: openshift

2014-11-09 Thread Avi A
> > or with > > python web2py.py -S welcome -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 ve

[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://w

[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

[web2py] Re: Send data to print.

2014-08-10 Thread Avi A
browser print dialog. You can use > 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 >>

[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: web2py with google visualisation app.

2014-08-06 Thread Avi A
On Wednesday, August 6, 2014 8:51:40 PM UTC+3, lyn2py wrote: > > Thank you for sharing the short clip! > > I was wondering how you did the auto-loading of the content within each > drop down menu at the top? > I always thought that to be difficult and hav

[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 tes

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

2014-06-08 Thread Avi A
ate_report(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}

[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: boolean field type in a query.

2014-03-27 Thread Avi A
; null=True)).select() > > On Thursday, March 27, 2014 12:46:18 PM UTC+1, Avi A wrote: >> >> i checked all items as clones, then unchecked those i wanted,, and it's >> all fine now. >> thanks. >> >> On Thursday, March 27, 2014 1:20:28 PM UTC+2, Mandar

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

2014-03-27 Thread Avi A
gure out what you may be doing wrong in DAL > query > > You can also try > > (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.crea

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

2014-03-26 Thread Avi A
March 26, 2014 9:28: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. >

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

2014-03-26 Thread Avi A
= 'F')); thanks. 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&

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

2014-03-26 Thread Avi A
perators can be > overloaded (in the case of the DAL, via 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

[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
; > right ? > > On Saturday, March 22, 2014 8:49:11 PM UTC+1, Avi A wrote: >> >> Same. >> /models/z_import_catalog.py", line 13, in >> item = db(db.t_items.unfi_product == row[5]).select().first() >> NameError: name 'db' is not defined >> >

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

2014-03-22 Thread Avi A
day, March 22, 2014 3:34:48 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? >&

[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 h

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

2014-03-22 Thread Avi A
habetically. > > On Friday, 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 g

[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 = csv.reader(webpage

[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 writes: > > > > > > > > >

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 > wrote: > > I do the same I get: > > TypeError: string indices must be integers, not str > > > Try catching that exception and prin

[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(

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 > wrot

[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":

[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 "req

[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: How to pre filter a table I want to join.

2014-02-24 Thread Avi A
ery) Many thanks. :). 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 e

[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 w

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

2014-02-24 Thread Avi A
.select(join=db.t_tests.on(db. t_tests_results.f_test == db.t_tests.id)) 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

[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)).sele

[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 filt

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

2014-02-23 Thread Avi A
er_query).select(,) > return dict(filtered_list = filtered_list) > > Anthony > > On Saturday, 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 >> replac

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

2014-02-22 Thread Avi A
specify 0 as the "ALL" parameter is counterintuitive > eco/0/1/0/6/0/0 sounds a lot more ugly than eco?b=1&d=6 > > On Saturday, February 22, 2014 7:28:33 PM UTC+1, Avi A wrote: >> >> Hi, >> Assuming I want to create an ajax query that will filter t

[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== re

[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

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

2014-02-16 Thread Avi A
#x27; if the password is just "123" 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: >

[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 som

[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: >> &g

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

2014-02-16 Thread Avi A
rieve later with response.vars.something > > > On Sunday, February 16, 2014 1:36: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',

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

2014-02-16 Thread Avi A
ling validation on > the server when form.process() is called? Do you have an IS_STRONG > validator defined? What is happening 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

[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?

[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', >>

[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: Trying to build a post api.

2014-02-03 Thread Avi A
ence field, but looks like you > 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: &g

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

2014-02-02 Thread Avi A
.id return t.validate_and_insert(**t._filter_fields(post_params)) else: raise 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 somethi

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

2014-02-02 Thread Avi A
post_params['f_device']).select(db.t_devices.id).first().id return 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&

[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, unle

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

2014-02-01 Thread Avi A
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', 

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

2014-02-01 Thread Avi A
insert. It's hard to say how > it should look without knowing your 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 stri

[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 wrot

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

2014-02-01 Thread Avi A
31, 2014 4:18:53 PM UTC-5, Avi A wrote: >> >> Well, not sure what to check. >> You saw the tables definitions and this is the call: >> test_params = {'api_key': 'e5dcc229-906d-47f8-b6ab-d184509f4f0b', >> 'f_test': 'test', '

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

2014-01-31 Thread Avi A
;, 'f_device': 'Toshiba', 'f_steps': '10', 'f_matches':'7', 'f_missmatches': '3'} On Friday, January 31, 2014 10:58:11 PM UTC+2, Anthony wrote: > > Doesn't look like that's going into a string field. Ma

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

2014-01-31 Thread Avi A
ignature, format='%(f_platform_name)s', migrate=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

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

2014-01-31 Thread Avi A
l=T('Missmatches')), auth.signature, format='%(f_test)s', migrate=settings.migrate) On Friday, January 31, 2014 9:32:06 PM UTC+2, Anthony wrote: > > Sorry, it should be post_params['api_key'] rather than post_params.api_key. > > Anthony > &

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

2014-01-31 Thread Avi A
Friday, January 31, 2014 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

[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) - http://github.c

[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) - https://code

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

2014-01-30 Thread Avi A
31, 2014 2:27:47 AM UTC+2, Anthony wrote: > > No, just run this code from a Python shell: > > test_params = {'api_key': 'api_key', 'test': 'test', 'f_platform': > 'platform', 'f_device': 'device', &#x

[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) - http://github.com

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

2014-01-30 Thread Avi A
day, January 30, 2014 4:22:29 PM UTC-5, Avi A wrote: >> >> All I get in the client is: >> Process finished with exit code 0 >> >> On Thursday, January 30, 2014 11:20:11 PM UTC+2, Anthony wrote: >>> >>> .validate_and_insert returns a response object

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

2014-01-30 Thread Avi A
ent of > that return value 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 U

[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 no

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

2014-01-30 Thread Avi A
us. > > 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 script instance: >> import requests >> >> test_params = {'api_key': 'api_key',

[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

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

2014-01-30 Thread Avi A
14 10:33:19 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 mea

[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 finish

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

2014-01-30 Thread Avi A
and iterate over all auth_user records > to check the API key -- just check 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)) > > Anthon

[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 = reque

[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] 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

[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, 20

[web2py] Re: update via ajax getting error.

2014-01-29 Thread Avi A
Wednesday, January 29, 2014 11:09:40 PM UTC+1, Avi A wrote: >> >> Hi, >> I am trying something like that: (render current api key and update it if >> clicking) >> >> on the view: >> >> Get new api key >> {{=LOAD('default','api

[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: Get new api key {{=LOAD('default','api_key.load',ajax=True)}} $(document).ready(function(){ $("#change_api_key").click(function(){ url = 'api_key.load/1' ; ajax(default/url, '

[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] 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 Iss

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

2014-01-12 Thread Avi A
tion is > to simply don't upload your applications//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, Janua

[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: 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/we

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

2013-12-31 Thread Avi A
ng > the org_code 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

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

2013-12-31 Thread Avi A
} on web2py it renders: /parking/default/org_form_load.load/%22%20%2B%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 t

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

2013-12-30 Thread Avi A
rg_code')}}'; > $.web2py.component(url, 'org_form_target'); > } > > Note the URL is generated in Python, hence its inclusion within the > {{...}} template delimiters. > > Anthony > > On Monday, December 30, 2013 3:58:10 PM UTC-5, Avi A wrote: >> >&

[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... function insert_component(org_code) { alert(org_code); "$.web2py.component('%s', 'org_form_target');" % URL('default', 'org_form_load.load/org_code'); } On Monday, December 30, 2013 8:27:00 PM UTC+2, Avi A wrot

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

2013-12-30 Thread Avi A
ad.load/some_name). 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" (i

[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

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

2013-12-30 Thread Avi A
org_form_target');" % > URL('default', 'org_form_load.load')}}" > > Anthony > > On Monday, 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 sti

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

2013-12-30 Thread Avi A
ony > > On Monday, December 30, 2013 10:21:58 AM UTC-5, Avi A wrote: >> >> Hi, >> I have this on the view: >> >> >> >> >> >> >> and something like this on the controller: >> >> def o

[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: and something like this on the controller: def org_form_load(): org_code = request.vars.name org_code_name = db(..).select(..) if org_code_name: db.t_org_members.f_org_member.default = auth.user.id form = SQLFORM(db

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 > wrote: > > member.auth_user.email throws the same error. > auth_user.email is defin

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

2013-12-27 Thread Avi A
:35:54 AM UTC+2, Jonathan Lundell wrote: > > On 27 Dec 2013, at 2:20 PM, Avi A > wrote: > > Now I am able to get the list as you suggested with append. > But i don't know how to render it. > This is what I try in the view but it says that NameError: name 'auth_user

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,

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

2013-12-27 Thread Avi A
ay, 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 member

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

2013-12-27 Thread Avi A
27, 2013 8:54:34 PM UTC+2, Jonathan Lundell wrote: > > On 27 Dec 2013, at 10:53 AM, Avi A > > 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 Frida

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 > > wrote: > > Thanks, > I wasn't wrong, this is what I need: > >

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 > > wrote: > > Thanks, > I wasn't wrong, this is what I need: > > {{for member in org_me

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

2013-12-27 Thread Avi A
as a dict 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 > wrote: > > Hi, > I'm doing something like that: > if auth.user: > my_org = db(d

  1   2   >