[web2py] Re: web2py validator doesn´t match

2014-05-02 Thread Christian Foster Howes
did you use a SQLForm? if not then you probably didn't trigger the validators to run. On Thursday, May 1, 2014 9:14:28 AM UTC-7, Thomas Neubrand wrote: > > 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

[web2py] Re: HELP: REST service problem when api in remote server.

2014-05-02 Thread Charles Levesque
Typical code 18 with the ID 10T. That part slipped through my hands. Thanks Richard. Le vendredi 2 mai 2014 00:13:57 UTC-4, Charles Levesque a écrit : > > Hi everyone, > > I have a problem with my application. It is a function that uses the > @request.restful() decorator. The app gets events fro

[web2py] Re: items in databases folder getting corrupted

2014-05-02 Thread peter
version is 3.6.21 > >> -- 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 Issues) --- You received this message because you are subscribed to the Google Groups "web2py

[web2py] Re: Error when implementing search_widget for SQLFORM.smartgrid

2014-05-02 Thread Seth J
Found a solution to this problem. It appears that "contactSearch" needs two parameters and should be defined as follows (older examples had it wrong): def contactSearch(self, url): ... return form Topic is considered to be closed by me. On Friday, April 11, 2014 1:49:12 PM UTC-4, Seth J wr

[web2py] sqltable and aggregrate function

2014-05-02 Thread peteb3100
Hey guys, I want to display some aggregated stats (items per year) with a sqltable, but the aggregate count column never shows up in the sqltable. Basically only the groupby column is shown. This is my controller count = db.stats.id.count() stats = db(db.stats.id).select(db.stats.created_year, c

Re: [web2py] Smartgrid and archive buttons

2014-05-02 Thread Seth J
Found a solution to my last question here: db.your_table_archive._plural = 'Your Label' renames record archive links for smartgrid. Topic is considered closed by me. On Monday, April 7, 2014 6:18:29 PM UTC-4, Seth J wrote: > > Thanks for leading me in the right direction regarding separatin

Re: [web2py] Re: REST Unit Testing

2014-05-02 Thread JosuaS
Using a helper function is a very good idea, thanks! Instead of "" I just passed a "pointer" of the controller function. Or is there a possibility to call a controller function by (Sub)URL? Another question. I have a REST function that looks like this: (like above but with the "fixed" paramete

[web2py] Re: Foreign key

2014-05-02 Thread Beat Kohler
Hi Derek... you are right ... this is it.. works as designed: Just modified the definition for the MATERIALS; added "format...": db.define_table("MATERIALS", Field ("MATNR", "string", length=18, notnull=True, default=None), Field

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Web2py admin console has a red line at for f, v in request.vars: and then says too many values to unpack. my function is def transition_form(): for f, v in request.vars: db.table[f].default = v form = SQLFORM(db.table, user_signature=True) return dict(form=form) Should I have extra v

[web2py] Re: items in databases folder getting corrupted

2014-05-02 Thread Niphlod
what sqlite version are you on ? On Friday, May 2, 2014 10:32:28 PM UTC+2, peter wrote: > > It means I get a ticket, and the error says > > .. auth_cas.table appears corrupted. > > Peter > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/we

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Austin Taylor
I actually see it trying to return the values in the variables in the URL it says field1='data', field2='data2', but its hanging for some reason... On Fri, May 2, 2014 at 4:15 PM, Austin Taylor wrote: > return **dict(form=form)? I am sorry I know my questions are noob, but I > can't tell you ho

[web2py] Re: web2py TO WordPress API with OAuth2

2014-05-02 Thread Dave S
On Friday, May 2, 2014 11:36:09 AM UTC-7, JoeCodeswell wrote: > > Dear web2py-users, > > I have developed an example of a web2py app using the WordPress.com REST > API with OAuth2. > > You can see it here > http://joecodeswell.wordpress.com/2014/05/02/web2py-to-wordpress-api-with-oauth2/ > > Ni

[web2py] Re: items in databases folder getting corrupted

2014-05-02 Thread peter
It means I get a ticket, and the error says .. auth_cas.table appears corrupted. Peter -- 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 Issues) --- You recei

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Austin Taylor
return **dict(form=form)? I am sorry I know my questions are noob, but I can't tell you how much I appreciate your help. I've spent two days on this problem. On Fri, May 2, 2014 at 4:11 PM, Richard Vézina wrote: > **dict(...) > > > On Fri, May 2, 2014 at 4:10 PM, Austin Taylor wrote: > >> I will

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
**dict(...) On Fri, May 2, 2014 at 4:10 PM, Austin Taylor wrote: > I will definitely upgrade in the upcoming months... but for now I"m stuck > with 2.6. Your dict comprehension worked, but now I'm getting an error when > I click bthe button saying there are too many values to unpack. I'm > gues

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Austin Taylor
I will definitely upgrade in the upcoming months... but for now I"m stuck with 2.6. Your dict comprehension worked, but now I'm getting an error when I click bthe button saying there are too many values to unpack. I'm guessing this is because I'm using 2.6 again and its something to do with my func

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
Try with dict() contructor in one of my last email if you want to stay in 2.6 Richard On Fri, May 2, 2014 at 4:02 PM, Richard Vézina wrote: > python2.7 web2py ... > > > On Fri, May 2, 2014 at 4:01 PM, LoveWeb2py wrote: > >> Is there a way to force web2py to use 2.7 instead of 2.6? I thought it

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
python2.7 web2py ... On Fri, May 2, 2014 at 4:01 PM, LoveWeb2py wrote: > Is there a way to force web2py to use 2.7 instead of 2.6? I thought it was > using 2.7. Thank you for being so patient. > > > On Friday, May 2, 2014 3:59:06 PM UTC-4, Richard wrote: > >> Upgrade to 2.9.5 web2py 2.3 is very

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Is there a way to force web2py to use 2.7 instead of 2.6? I thought it was using 2.7. Thank you for being so patient. On Friday, May 2, 2014 3:59:06 PM UTC-4, Richard wrote: > > Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for > python... > > > http://stackoverflow.com/question

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
dict((f, row[f]) for f in db.table.fields) Richard On Fri, May 2, 2014 at 3:59 PM, Richard Vézina wrote: > Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for > python... > > > http://stackoverflow.com/questions/1747817/python-create-a-dictionary-with-list-comprehension > > You ca

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for python... http://stackoverflow.com/questions/1747817/python-create-a-dictionary-with-list-comprehension You can adapt Richard On Fri, May 2, 2014 at 3:44 PM, LoveWeb2py wrote: > Okay... I think I see the issue. My web2py is ru

Re: [web2py] HELP: REST service problem when api in remote server.

2014-05-02 Thread Richard Vézina
Hello Charles, I think you miss the views in prod for your parser controller and api function... http://web2py.com/books/default/chapter/29/10/services?search=generic#Generic-views For security reasons the generic views are only allowed to be accessed on localhost. In order to enable the access

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Okay... I think I see the issue. My web2py is running Python 2.6 and my Interpreter is 2.7. dictionary comprehension changed between those versions. I'm going to try and construct a dict comprehension for 2.6 and try it again. On Friday, May 2, 2014 3:40:53 PM UTC-4, LoveWeb2py wrote: > > Okay

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Okay quick update: I loaded a row into python to test the comprehension. row = db(db.table.id>0).select().first() {f: row[f] for f in db.table.fields} prints out the list fine and its exactly how I"d like to prepopulate my field on the transition form. Thank you for getting me this far. Howeve

[web2py] Re: items in databases folder getting corrupted

2014-05-02 Thread Niphlod
what does it mean exactly when you say a table gets "corrupted" ? On Friday, May 2, 2014 5:32:21 PM UTC+2, peter wrote: > > I have several web2py 2.8.2 applications running on a VPS under Centos 5 > with nginx and uwsgi. I use sqlite with all the apps. Items in > the databases folder regularly g

Re: [web2py] Re: scheduler: task concurrency

2014-05-02 Thread Niphlod
What's the "general" use case ? There are a bunch of simple different things you can do right in the current scheduler to achieve that goal - schedule the same with different start_time(s) - queue the first with enabled=True and the following with enabled=False with a callback that flips the

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
I just realized I might be running into problems because I'm using 2.3. I haven't upgraded because the new web2py threw my css off. It looks like you're referencing the virtual fields? http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Old-style-virtual-fields If you t

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
for this part: {f: row[f] for f in db.table.fields} what do I put for fields... could I just leave it as fields? On Friday, May 2, 2014 11:16:09 AM UTC-4, Richard wrote: > > Yes, so you want to pas by a transitionnal form with the data preset base > on the copied record values, where you can

[web2py] web2py TO WordPress API with OAuth2

2014-05-02 Thread JoeCodeswell
Dear web2py-users, I have developed an example of a web2py app using the WordPress.com REST API with OAuth2. You can see it here http://joecodeswell.wordpress.com/2014/05/02/web2py-to-wordpress-api-with-oauth2/ Thanks for A GREAT FRAMEWORK AND COMMUNITY. Love and peace, Joe -- Resources: -

[web2py] items in databases folder getting corrupted

2014-05-02 Thread peter
I have several web2py 2.8.2 applications running on a VPS under Centos 5 with nginx and uwsgi. I use sqlite with all the apps. Items in the databases folder regularly get corrupted. Nothing else appears to get corrupted. The most common file to get corrupted across different apps is auth_cas.ta

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
Yes, so you want to pas by a transitionnal form with the data preset base on the copied record values, where you can make the change you want before submit the form. So if you have a grid where you can select the record to copy with the icon you want that link to the transitionnal form, you just ha

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Basically... right now I have a magnifying glass, the pencil, and a trash can for my records. I want to add a plus next to each one of my records and when I click on the plus it copies that records values into a new record and creates a new ID. I can then modify some of the values in the record

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
This is very helpful, Richard. I have about 20 fields so I think I would have to iterate through the fields and insert the request.vars to the database. Ahhh after looking at your code it looks like that could would write a record from one table to another. In this case I just want to copy a re

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
What do you mean? You can redirect (A('Link', _href=URL(controler, function, vars=dict(pass_your_record_vars_here=record_vars1, ...))) to a function that do what I wrote above... Just pass record value throught vars then request.vars.field1 request.vars.field2 and assign .default= request.vars.fie

Re: [web2py] Re: scheduler: task concurrency

2014-05-02 Thread Paolo Valleri
yes, the function name identifies the same task Paolo 2014-05-02 14:19 GMT+02:00 Niphlod : > how do you identify "the same task" ? the same function name ? > > > On Friday, May 2, 2014 12:19:53 PM UTC+2, Paolo Valleri wrote: > >> I don't think about arbitrary workflow, I would only avoid concu

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Richard, How do I assign this to a button though? On Friday, May 2, 2014 9:30:21 AM UTC-4, Richard wrote: > > keepvalues > > or > > row = db(...).select(db.table.record).first() > > db.other_table.field1.default = row.field > > form = SQLFORM(db.table, ...) > > Richard > > > On Fri, May 2, 2014 a

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Richard Vézina
keepvalues or row = db(...).select(db.table.record).first() db.other_table.field1.default = row.field form = SQLFORM(db.table, ...) Richard On Fri, May 2, 2014 at 9:07 AM, Oli wrote: > I hope this help. > > def copy_and_edit(): > """ > copy_and_edit > """ > record = db.t_di

[web2py] Re: Create a copy record button in SQLFORM?

2014-05-02 Thread Oli
I hope this help. def copy_and_edit(): """ copy_and_edit """ record = db.t_disciplin(request.args[0]) vals = {} for k,v in record.items(): if k in db.t_disciplin.fields: if k == 'f_title': v = v + "_copy" recname = str(v)

[web2py] Re: Pagination with two queries

2014-05-02 Thread Anthony
If the provinces are mutually exclusive (is that the case), of course there won't be any records that match both of them. Do you perhaps want to use "||" instead? On Friday, May 2, 2014 7:01:02 AM UTC-4, Ruud Schroen wrote: > > I tried that, it returns zero results.. > > Also when i print the qu

[web2py] Create a copy record button in SQLFORM?

2014-05-02 Thread LoveWeb2py
Hello, There are many times when I just want to copy the values of one record in my sqlform and create a new record, but modify the content and save it. Is there an easy way to do this with web2py or would I have to write the code? Many thanks -- Resources: - http://web2py.com - http://web2p

Re: [web2py] Re: scheduler: task concurrency

2014-05-02 Thread Niphlod
how do you identify "the same task" ? the same function name ? On Friday, May 2, 2014 12:19:53 PM UTC+2, Paolo Valleri wrote: > > I don't think about arbitrary workflow, I would only avoid concurrent > execution of the same task. > > > Paolo > > > 2014-05-02 11:52 GMT+02:00 Niphlod >: > >> let's

[web2py] Re: Pagination with two queries

2014-05-02 Thread Ruud Schroen
I tried that, it returns zero results.. Also when i print the query, this comes out: ((kamernet.province = 'Limburg') AND (kamernet.province = 'North Brabant')) > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - ht

[web2py] Re: request.is_local is false?

2014-05-02 Thread Cássio Botaro
> > One alternative is : > if request.is_local or request.env.cmd_options.shell: # developer configuration else: # production configuration -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: Pagination with two queries

2014-05-02 Thread 黄祥
please try (not tested): query = (db.kamernet.province == 'Limburg') & (db.kamernet.province == 'North Brabant') best regards, stifan On Friday, May 2, 2014 5:45:15 PM UTC+7, Ruud Schroen wrote: > > Hi, > > I'm trying to use the pagination from web2py_utils with two queries. > Usually the code

[web2py] Pagination with two queries

2014-05-02 Thread Ruud Schroen
Hi, I'm trying to use the pagination from web2py_utils with two queries. Usually the code looks like this: query = db.table.id > 0 count = db(query).count() results = db(query).select(orderby=~db.table.created_on) orderby = ~db.table.id pcache = (cache.ram, 15) paginate = web2py_utils.paginate.P

Re: [web2py] Re: scheduler: task concurrency

2014-05-02 Thread Paolo Valleri
I don't think about arbitrary workflow, I would only avoid concurrent execution of the same task. Paolo 2014-05-02 11:52 GMT+02:00 Niphlod : > let's say that "parallel" is the default behaviour > when you need to run a task to avoid parallel (for speech sake, let's turn > to "concurrent"

[web2py] Re: SQLFORM.grid pagination problem

2014-05-02 Thread Niphlod
does this "magically" happens when you just left another grid at page # 1000 ? because that would be expected, since all grids share the same session values to "remember" what the page # is. Also, please make sure you're not using "reserved" request.vars (i.e. page=x) because then you're tricki

[web2py] Re: validators don´t work for db fields

2014-05-02 Thread Niphlod
what is the expected result ? of course if a domain already exist in the table, a error is raised ... On Thursday, May 1, 2014 11:31:14 PM UTC+2, Thomas Neubrand wrote: > > Hello, > > I have two validators in my db.py for my *auth_user* table for the > password and the domain field, but both

[web2py] Re: gluon\scheduler.py group_names bug

2014-05-02 Thread Niphlod
please read the docs for the scheduler group_names is meant as a way to allow sending tasks to a (or more) specific workers. Any task queued without the group_name parameter gets a default of 'main', that indeed is included in the default value of group_names of the scheduler. Of course,

[web2py] Re: scheduler: task concurrency

2014-05-02 Thread Niphlod
let's say that "parallel" is the default behaviour when you need to run a task to avoid parallel (for speech sake, let's turn to "concurrent" ) executions. in respect to what ? any other task? one task only ? all tasks named as 'foo' or 'bar' ? The possibilities for creating a workflow f

[web2py] scheduler: task concurrency

2014-05-02 Thread Paolo Valleri
Dear all, I've been using the scheduler for a long time, and it worked very well. Now I need to instantiate several workers to run several tasks, few of them are light, other will take several minutes to complete. The problem I have is that: few of them can be executed in concurrency, other no.