Re: [web2py] Re: REST Unit Testing

2014-05-01 Thread Samuel Marks
That's fine; you'll just want to write some helper functions (`get`, `post`, `put`, `delete`, `patch`) to make it more semantic: self.assertEqual(get("", vars={"x": "y"}), {"a":"b"}) Samuel Marks http://linkedin.com/in/samuelmarks On Fri, May 2, 2014 at 6:24 AM, JosuaS wrote: > Thank you ver

[web2py] Can I use/access Java Database (Derby) using web2py?

2014-05-01 Thread Sarbjit
Hello All, Is it possible to access/use Java database (derby) with web2py application. So, the context is that I am having a Java application which uses Java DB as a database, I want to integrate the web2py application with the java db such that the user's can either use web2py application (acc

[web2py] Re: REST Unit Testing

2014-05-01 Thread JosuaS
Thank you very much for the link, looks very useful. I found a way to call a rest function internally by now, here is an example: def testXYZ(self): request.env.request_method = "POST" request.args = ["event", "1.json"] request.post_vars["username"] = "test" request.post_vars["x"

[web2py] web2py validator doesn´t match

2014-05-01 Thread Thomas Neubrand
Hello, I have two validators in my db.py for my *auth_user* table for the password and the domain field, but both don´t work. When I type in a domain name that is already in the table, there occurs a *"duplicate entry 'test' for key 'domain'" *error. Can you tell me why the validators don´t wo

[web2py] validators don´t work for db fields

2014-05-01 Thread Thomas Neubrand
Hello, I have two validators in my db.py for my *auth_user* table for the password and the domain field, but both don´t work. When I type in a domain name that is already in the table, there occurs a *"duplicate entry 'test' for key 'domain'" *error. Can you tell me why the validators don´t wo

[web2py] gluon\scheduler.py group_names bug

2014-05-01 Thread Peter
I was having trouble with the scheduler being stuck on QUEUE when I've used any group_name other than 'main'. I've looked in the code and noticed the following: https://github.com/web2py/web2py/blob/master/gluon/scheduler.py For line 492 in scheduler.py file.. 491 def __init__(self, db, tas

[web2py] Re: query DAL

2014-05-01 Thread Brian M
The database view trick would work. Or how about adding a "current" flag and whenever you do a situation update/insert you set the new record's current flag to true and those of all that person's other situation records to false. You could either do it in web2py or with a database trigger. Seems

[web2py] Re: Controller vs. appliance

2014-05-01 Thread Scott Hunter
Suppose I have an appliance A1 w/ some functionality within a specific controller. I could move that controller into a new appliance A2, which will still access the same database that A1 does. My question is: is there any performance benefit to doing so? (Note that this is orthogonal to any

[web2py] Re: Controller vs. appliance

2014-05-01 Thread 黄祥
pardon me, i'm not sure what do you mean with appliance's controller and appliance, perhaps if you concern about performance tunning, please take a look at the book : ref: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Efficiency-tricks best regards, stifan -- Resources: - ht

[web2py] Controller vs. appliance

2014-05-01 Thread Scott Hunter
Are there any performance benefits to be gained by moving some functionality from one appliance's controller into its own appliance, but still on the same server, assuming it still accesses the same database as before (in my case, it is a MySQL DB)? (Moving to a separate server, in this case,

Re: [web2py] Re: REST Unit Testing

2014-05-01 Thread Samuel Marks
I use bottle with webtest. You could probably do the same with web2py. (WSGI and all) Samuel Marks http://linkedin.com/in/samuelmarks On 02/05/2014 12:11 am, "samuel bonill" wrote: > I really do not know how to do a REST Unit Testing with web2py api, I use > postman ( http://www.getpostman.com/

[web2py] Re: Line Breaks in DAL Entries

2014-05-01 Thread Mark Billion
Perfect. Thank you so much. On Thursday, May 1, 2014 4:27:51 PM UTC-4, Anthony wrote: > > Are you saying you want to retain the line breaks when it is rendered in > HTML (e.g., in a grid or read-only form)? If so, you can do something like: > > Field('myfield', 'text', represent=lambda v, r: XML

[web2py] Re: Line Breaks in DAL Entries

2014-05-01 Thread Anthony
Are you saying you want to retain the line breaks when it is rendered in HTML (e.g., in a grid or read-only form)? If so, you can do something like: Field('myfield', 'text', represent=lambda v, r: XML(v.replace('\n', '' ))) or Field('myfield', 'text', represent=lambda v, r: PRE(v)) Anthony On

[web2py] Fill out a webform and process the result

2014-05-01 Thread Kenneth
Hello, I'd like to make a form in web2py that asks one string. This string is sent to another webform on another server. That webpage searches its database and returns the same page but with an link to an info page about the string. The page I'd like to process and use that info to fill out my

[web2py] Line Breaks in DAL Entries

2014-05-01 Thread Mark Billion
I have a database entry that looks like this when I enter the DB admin: Mark's Restaurant MEAL PLAN NOTICE When it prints, I get: Mark's Restaurant MEAL PLAN NOTICE My problem is that I would like to split the text by line but I cant figure out what the raw symbol is for the break (i.e., \

Re: [web2py] OAuth - Can Users Authenticate without an Internet connection?

2014-05-01 Thread Brando
Really stupid question.I'm not planning on using the DAL (because i'll be using CouchBase). I'd rather not use sqlite at all. What do I need to do to save the credentials into the couchbase db instead of the sqlite? I'm assuming the DAL handles the password encryption and all that. Thank

Re: [web2py] OAuth - Can Users Authenticate without an Internet connection?

2014-05-01 Thread Carlos Costa
If they share the same DB and they all are in the same network, the builtin authentication will work. If not, you may want to sync the authentication tables while you have connection. So each local application will have a copy. 2014-05-01 12:22 GMT-03:00 Brando : > What are my options if I wan

Re: [web2py] OAuth - Can Users Authenticate without an Internet connection?

2014-05-01 Thread Brando
What are my options if I want users to be able to login with or without an internet connection and still be able to centrally control authentication on all the nodes? Keep in mind that these machines will have internet connection throughout the day, however they will be offline for an hour or

[web2py] grid issues

2014-05-01 Thread LaDarrius Stewart
def qadata(): form2=FORM(LABEL("",INPUT(_type="text",_name="lastname",requires=IS_LENGTH(minsize=3), _placeholder="Company Name", _size="35", _style="font-size:15px")), BUTTON("Submit", _type="submit",_value="Submit", _data={'loading-text':'loading'})) grid=None

[web2py] Re: REST Unit Testing

2014-05-01 Thread samuel bonill
I really do not know how to do a REST Unit Testing with web2py api, I use postman ( http://www.getpostman.com/ ) El miércoles, 30 de abril de 2014 05:31:38 UTC-5, JosuaS escribió: > > Hello > > I found this nice description to do Unit Testing in web2py: > http://www.web2py.com/AlterEgo/default/sh

Re: [web2py] Re: GAE: Downloading uploaded images

2014-05-01 Thread Christian Foster Howes
sounds good. good luck! note that if i was re-implementing it right now i would take a serious look at using google cloud storage to put the images in. i'm not sure but it might be easier to access files as a site owner that are in cloud storage. cfh On 5/1/14, 1:31 , St. Pirsch wrote: T

[web2py] web2py populate foreign key constraint error

2014-05-01 Thread Walter Okine
i am using the web development with python and web2py part2 video, creating a reddit_clone. When i use the web2py database populate command to add fields to comm table i get a foreign key constraint from this line Field('parent_comm','reference comm'), when Field('parent_comm','reference comm')

[web2py] Replace an entire form via ajax

2014-05-01 Thread Michael Lundager
I am working on making a plugin where you have a list of fields i.e. telephone no and types and a insert form. That works very well. Now, I want to add a facility that replaces the insert form with an update form once you click on one of the list items (telephone no). I am sending the correct d

Re: [web2py] Re: first() as aggregation function

2014-05-01 Thread Manuele Pesenti
Il 01/05/14 10:16, Manuele Pesenti ha scritto: > ok, I tried without success... > with the solution I found patching the dal source code adding the > array_agg expression method as described I defined this query. > Can you help me to get the same using expressions? well... I solved in this way at t

[web2py] Re: GAE: Downloading uploaded images

2014-05-01 Thread St. Pirsch
Thank You for the hind. They are stored in the datastore at the moment. I found a description for blobstore-uploads from web2py work here: http://www.web2pyslices.com/slice/showcomment/948 I think that was made by you, a couple of years ago. I'll try to make it work that way. thanks, Stephan

Re: [web2py] Re: first() as aggregation function

2014-05-01 Thread Manuele Pesenti
Il 28/04/14 22:39, Manuele Pesenti ha scritto: >> there's no need to introduce a new method you can use expression >> > themselves in the select, and extract the field as usual >> > >> > myexpr = 'first_value(b_field) over (partition by a_field order by >> > b_field)' >> > rows = db2(db2.test_t

Re: [web2py] Re: How to redirect an error ticket response to the current url

2014-05-01 Thread Alfonso Serra
Im sorry posted by accident without finishing. the last code works but with some limitations. Im trying to replicate the function ticket from admin/default.py into the display_errors function It displays the error on the url that caused the ticket but it is not using the same layout as the admin a