[web2py] Re: Custom formstyle for auth

2016-10-27 Thread Niphlod
you can code your own formstyle and pass it to formstyle (or set the global response.formstyle). On top of accepting what's included in web2py as a string, it accepts a callable for "bring your own". On Tuesday, October 25, 2016 at 4:52:12 PM UTC+2, Marko Seppälä wrote: > > Hi, > > I'm trying

[web2py] Re: CouchDB support

2016-10-27 Thread Niphlod
couchdb support is experimental. to "enable" it, you must use the source version and install the 'couchdb' module using pip to make it available to web2py. On Tuesday, October 25, 2016 at 7:06:09 AM UTC+2, Robert F wrote: > > Still on the learning curve regarding Web2py but would like to know

[web2py] Re: Grid export csv

2016-10-24 Thread Niphlod
t 10:54:31 PM UTC+2, Bartosz Baranowski wrote: > > Niphlod, > > I am using latest web2py and pydal from master branches. Any idea where is > the fix? Could you please direct me to the commit? > > W dniu środa, 3 sierpnia 2016 12:51:56 UTC-7 użytkownik Niphlod napisał: >>

[web2py] Re: Randomly stuck web2py

2016-10-24 Thread Niphlod
see the log to trace any DDos attempts (or stuck requests ) On Friday, October 21, 2016 at 10:54:32 PM UTC+2, Wasim Baig wrote: > > Been using web2py for sometime now, thank you all for making life so easy. > > We use stock web2py src on debian 8, with Rocket and mysql and start them > in

[web2py] Re: tasks hierarchy

2016-10-24 Thread Niphlod
you should use "Jobs" for that. any task queued that needs another task to be executed before it should be linked with thejob.add_deps(dependant, parent) in your case: - cat3 is dependant from cat2 - cat2 is dependant from cat1 read more using the https://github.c

[web2py] Re: How to create a front end for an external API?

2016-10-20 Thread Niphlod
before wanting something that helps you implementing something do you have a minimal idea of what you want to happen with your API ? On Thursday, October 20, 2016 at 12:41:34 AM UTC+2, greenpoise wrote: > > RESTFUL API I meant to write > > > > > > > On Wednesday, October 19, 2016 at 2:42:52

[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Niphlod
halt. downloading is something the browser can decide. opening the saved file is something your operating system does. The browser can only send the response which gives the user a choice between saving and opening directly the file. If the user chooses "open" instead of "save" ... nothing can

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Niphlod
so record = thesingle_record_from_the_table for f in db.table.fields: if record[f] is None: db.table[f].readable = False On Monday, October 17, 2016 at 9:18:49 PM UTC+2, Alex Glaros wrote: > > I left this part out. Should only be one record. > > specificAddressID =

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Niphlod
readable is on the Field (i.e. column) so what happens if row 1 has column a,b,c == None and row 2 has a,c,d == None ? On Monday, October 17, 2016 at 9:11:24 PM UTC+2, Alex Glaros wrote: > > Would like to loop through columns in a set object and set readable = > False if the field has no

[web2py] Re: problem with start_time of the scheduler

2016-10-17 Thread Niphlod
BTW: please start adapting your code to use mysched.queue_task() instead of db.scheduler_task.insert(...) . Next releases could change the format of the scheduler_task table and only the queue_task method is the supported one (i.e. will handle eventual corner-cases that won't be possible

[web2py] Re: problem with start_time of the scheduler

2016-10-17 Thread Niphlod
the bug has already been fixed in trunk. You can copy/paste the scheduler.py file from master if you want it solved, or either pass next_run_time equal to start_time to make things work the way they were. On Sunday, October 16, 2016 at 8:30:23 AM UTC+2, mweissen wrote: > > Thank you, but

[web2py] Re: Help with App memory usage

2016-10-14 Thread Niphlod
try using psycopg2 on the prod env too. pg8000 (especially the one shipped with web2py in the latest stable, which was quite old) can exhibit memory leaks (or, for better saying, a premature optimization resulted in an "evil" usage of the memory for the way web2py uses pg8000). On Friday,

[web2py] Re: from apache to nginx

2016-10-14 Thread Niphlod
in-process I think it's a no-go, as nginx just doesn't know how to interpret python in the same process as apache does. http_auth_request together with http_access though can help, as you should be able to code an handler that returns either 200 or 403 instead of true/false . Check

[web2py] Re: appadmin/ccache and dict in cache.disk

2016-10-07 Thread Niphlod
definitely a bug. a PR is on the way. On Friday, October 7, 2016 at 8:49:45 PM UTC+2, Niphlod wrote: > > ok, it's valid syntax. will investigate... > > On Friday, October 7, 2016 at 7:04:51 PM UTC+2, MDSIII wrote: >> >> cval = dict(request.vars) >> cval.update(req

[web2py] Re: appadmin/ccache and dict in cache.disk

2016-10-07 Thread Niphlod
= 0) > > I realize this is sort of rediculous code but it shows all assignment > operations to the object "cval" that happen before it is written to cache. > > > On Friday, October 7, 2016 at 4:12:22 AM UTC-7, Niphlod wrote: >> >> how do you store a dict in c

[web2py] Re: appadmin/ccache and dict in cache.disk

2016-10-07 Thread Niphlod
how do you store a dict in cache.disk ? On Friday, October 7, 2016 at 8:59:34 AM UTC+2, MDSIII wrote: > > When I store a dict in cache.disk and then request > /appadmin/ccache I'm getting a key error: > > Traceback (most recent call last): > File "C:\repos\TCL\web2py\gluon\restricted.py", line

[web2py] Re: set individual action's transaction mode

2016-10-05 Thread Niphlod
tter be prudent > > thanks Niphlod > > > hopefully everything is under control :) Have you seen the movie > melancholia by lars von trier ? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://

[web2py] Re: set individual action's transaction mode

2016-10-04 Thread Niphlod
it's because DBAPI opens a new transaction the same way web2py does. On Monday, October 3, 2016 at 1:54:20 PM UTC+2, Pierre wrote: > > ok, understood. > now let's go back to the basic situation of a single transaction. you > suggest I should discard posgresql transaction parameters in the

[web2py] Re: Scheduler - response.render no longer working

2016-10-03 Thread Niphlod
hum. Trunk has been recently updated in the management of caching code for controllers and views wonder if this is related to that. On Monday, October 3, 2016 at 5:15:18 AM UTC+2, Brian M wrote: > > OK, so I've had multiple scheduled tasks running for years that use >

[web2py] Re: Under Scheduler request.is_scheduler is None rather than True - Why?

2016-10-03 Thread Niphlod
can you please file a bug on https://github.com/web2py/web2py/issues ? I'd like to keep track of it and fix ASAP On Monday, October 3, 2016 at 5:45:21 AM UTC+2, Brian M wrote: > > Is there a reason why when something is run under the scheduler > request.is_scheduler = None rather than True?

[web2py] Re: set individual action's transaction mode

2016-10-01 Thread Niphlod
a transaction is live from the first command you execute AFTER the first commit() or rollback(). Web2py automatically commit() at the end of a request, or rollback() in case an error occurred. Everything runs separated in each thread (which means every thread runs its own transaction) and -

[web2py] Re: set individual action's transaction mode

2016-09-30 Thread Niphlod
tl;dr you can't . You ABSOLUTELY can't survive a transaction in different processes. If you need to control concurrency, implement your own "lock" in the app (i.e. using a "light" record in a table). On Friday, September 30, 2016 at 7:30:30 PM UTC+2, Pierre wrote: > > Hi, > > it's late and the

[web2py] Re: how to do 2 step verification authentication????

2016-09-29 Thread Niphlod
I think he's referring to two-step verification On Thursday, September 29, 2016 at 8:05:11 PM UTC+2, Dave S wrote: > > > > On Wednesday, September 28, 2016 at 12:13:05 PM UTC-7, prashant joshi > wrote: >> >> how configure email?? >> i do according to the book but it not work... >> >> please

[web2py] Re: How to restrict access to a public webservice using a key?

2016-09-29 Thread Niphlod
ot; style-decorator. On Thursday, September 29, 2016 at 3:28:05 PM UTC+2, Lisandro wrote: > > Thanks Niphlod, nice and clean solution. > I was trying to just that, but I was trying to validate that token using > the decorator @auth.requires(lambda: validate_token()) for the call() &

[web2py] Re: scheduler processes cooperation issue

2016-09-29 Thread Niphlod
ha: yep, the logic is totally flawed. You can't be sure your task has been correctly processed just by queueing it. The task DOESN'T obviously run in the same transaction the webpage displaying the form is. On Thursday, September 29, 2016 at 5:54:20 PM UTC+2, Pierre wrote: > > very confusing

[web2py] Re: scheduler processes cooperation issue

2016-09-28 Thread Niphlod
the POV of this question is wrong. Scheduler processes do what you ask them to do, without nothing else added. The same thing you observe would happen if you try to execute your tasks manually. It just seems that what you are asking them to do violates your model (i.e. either you had already a

[web2py] Re: How to restrict access to a public webservice using a key?

2016-09-28 Thread Niphlod
jwt is the emerging standard for apis and such, but if the usage is all-internal, why don't you just start simple and do if request.vars.token not in ('xa', 'bbxb', 'cc'): raise HTTP(403) ? On Wednesday, September 28, 2016 at 2:15:19 PM UTC+2, Marlysson Silva wrote: > > This

[web2py] Re: Error in redis_cache.py after upgrading web2py to last stable version

2016-09-28 Thread Niphlod
I know what's going on. > I've found this post from Niphlod regarding new redis cache: > > https://groups.google.com/forum/#!searchin/web2py/redis$20unavailable$20instance%7Csort:relevance/web2py/x1CCFWflmV8/POdMQmcYEgAJ > > There he says: "...want to connect to red

[web2py] Re: new redis_tools, new redis-backed scheduler

2016-09-28 Thread Niphlod
ters to > RConn? Do I need to generate those certificates locally? > If that's the case, is there any example that can help me? > > > Thanks in advance! > Regards, > Lisandro > > > > El sábado, 2 de enero de 2016, 20:44:15 (UTC-3), Niphlod escribió: >> >>

[web2py] Re: AppConfig and % interpolation

2016-09-27 Thread Niphlod
giorno martedì 27 settembre 2016 17:30:21 UTC+2, Niphlod ha scritto: >> >> hum. did you try excaping the % with % , which means basically having %% >> instead of % ? >> >> On Tuesday, September 27, 2016 at 4:15:45 PM UTC+2, Ivan wrote: >>> >>&

[web2py] Re: AppConfig and % interpolation

2016-09-27 Thread Niphlod
hum. did you try excaping the % with % , which means basically having %% instead of % ? On Tuesday, September 27, 2016 at 4:15:45 PM UTC+2, Ivan wrote: > > I don't want to interpolate. > I have an option with a % inside and the AppConfig raises an exception. > -- Resources: - http://web2py.com

[web2py] Re: AppConfig and % interpolation

2016-09-27 Thread Niphlod
and it's correct that it does, as it can work with json with doesn't have any interpolation facilities. if you want to interpolate, for the moment, use your app's code. On Tuesday, September 27, 2016 at 3:43:24 PM UTC+2, Ivan wrote: > > If the .ini file contains an option with a % (eg a

[web2py] Re: Scheduler task runs before it is supposed to run

2016-09-21 Thread Niphlod
BTW: it has been merged . You can safely take scheduler.py from master and overwrite your own if you want to avid specifying next_run_time On Wednesday, September 21, 2016 at 5:57:44 PM UTC+2, Bernardo Leon wrote: > > Niphlod I will use postgresql in production and your solution a

[web2py] Re: Off topic (1) what data warehouse with w2p data and (2) survey: which ones are you using?

2016-09-21 Thread Niphlod
postgresql is fairly supported. on top of the usual suspects, qlikview and tableau are really great, if you can spend some money. On Wednesday, September 21, 2016 at 7:21:37 PM UTC+2, Alex Glaros wrote: > > Using Postgres to store web2py transactional data. Any advice regarding > data warehouse

[web2py] Re: scaling web2py

2016-09-21 Thread Niphlod
I saw a relatively/mostly related issue on the repo and so I feel I should give an answer... web2py is a web framework: we're not in the business of managing processes nor webservers. We're in the business of realizing an app that does what you want in response to a web request. For

[web2py] Re: Scheduler task runs before it is supposed to run

2016-09-21 Thread Niphlod
te-L55-C#18606:error popping tasks > > why do I have this error? Thanks. > > El lunes, 19 de septiembre de 2016, 13:37:05 (UTC-5), Niphlod escribió: >> >> sorry, a bug slipped in. In the wait for the fix, please use >> next_run_time in addition to start_time. >> &g

[web2py] Re: scheduler and long tasks

2016-09-19 Thread Niphlod
nope. Technically, tasks are queued as long as the "outer" thingy (be it whatever) get all of the pending transactions committed (a task IS queued when the corresponding "insert" is committed to the database). Every task gets processed according by the usual rules, but if you want coordination

[web2py] Re: Scheduler task runs before it is supposed to run

2016-09-19 Thread Niphlod
sorry, a bug slipped in. In the wait for the fix, please use next_run_time in addition to start_time. On Monday, September 19, 2016 at 6:27:28 PM UTC+2, Bernardo Leon wrote: > > Hi, I am trying to run tasks in the future based on a time the user > specifies but as soon as the task is queued it

[web2py] Re: replaced by × in url

2016-09-19 Thread Niphlod
what version are you using ? can you try starting a shell and doing this ? >>> URL(vars=dict(loc='foo', timestamp='bar')) my output is '/welcome/default/index?loc=foo=bar' On Monday, September 19, 2016 at 3:31:17 PM UTC+2, Gael Princivalle wrote: > > Hello. > > When I build this URL: > url

[web2py] booking/event calendar

2016-09-18 Thread Niphlod
Go for fullcalendar -- 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] scheduler and long tasks

2016-09-18 Thread Niphlod
You can have a task that selects and groups and queues for each group the task that processes the atom. -- 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) ---

[web2py] Re: avoiding duplicate field names

2016-09-16 Thread Niphlod
the query is right, but *requires=* *require *- excuse the repetition - a validator, not a query (those nifty IS_LENGTH() thingies) On Friday, September 16, 2016 at 5:18:30 AM UTC+2, Alex Glaros wrote: > > are there any simple mistakes in this syntax or am I approaching it wrong? > >

[web2py] Re: Need help to understand (and reproduce) this error

2016-09-13 Thread Niphlod
this is the only proper way, and it relies on the underlying driver implementation. On Tuesday, September 13, 2016 at 5:08:30 PM UTC+2, Lisandro wrote: > > Thank you Niphlod. > I've seen that db.executesql receives the "placeholders" argument in order > to do the escapi

[web2py] Re: JSON getting the series data into view

2016-09-13 Thread Niphlod
definitely something is going on with your setup: did you play with routes ? the default scheme includes the app name right after the host name, and that's why you got the example with /app/controller/function. On Tuesday, September 13, 2016 at 5:38:11 PM UTC+2, Aydin wrote: > > @N

[web2py] Re: JSON getting the series data into view

2016-09-13 Thread Niphlod
then please check with whoever wrote """ function(data){series: [{ type: 'area', name: 'Response(kW)', data: data }] """ PS: may I suggest that you'd need to call /app/default/getdata*.json *that sets automatically also the correct

[web2py] Re: Need help to understand (and reproduce) this error

2016-09-13 Thread Niphlod
app/controller/function=everythingyoucanthinkof . NEVER . EVER. EVER. build queries without proper escaping. On Monday, September 12, 2016 at 3:12:50 PM UTC+2, Lisandro wrote: > > Hi there! > I have a simple view with a form (with GET method), in order to allow my > visitors to do some search.

[web2py] Re: Turbolinks?

2016-09-13 Thread Niphlod
e.com/d/msg/web2py/RHwErNSdu6M/-rozimgeCQAJ> > <URL:https://groups.google.com/d/msg/web2py/OYy6pOMJzB0/ANFhQy93BAAJ> > > Sounds interesting, and things that Niphlod likes I would consider to have > a good recommendation. > > /dps > > -- Resources: - http://web2py.c

[web2py] Re: GAE integration is MASSIVELY broken again (in multiple ways in multiple versions)

2016-09-13 Thread Niphlod
I absolutely love when the most used by big guys backend seems to fail for the most basic reasons...is someone really using web2py on GAE or it's just for show ? On Tuesday, September 13, 2016 at 9:02:19 AM UTC+2, webm...@trytha.com wrote: > > First, sometime around the 2.13 or 2.14 change,

[web2py] Re: JSON getting the series data into view

2016-09-13 Thread Niphlod
did you check if your js is working before blaming web2py ? On Tuesday, September 13, 2016 at 3:46:52 AM UTC+2, Aydin wrote: > > The methods to get the data in the view of web2py does not seem working. I > used the method mentioned in > http://web2py.com/books/default/chapter/29/10/services

[web2py] Re: as_list AttributeError: 'dict' object has no attribute 'myLabel'

2016-09-12 Thread Niphlod
as list returns a proper dictionary, not a list of Row objects. At this point, as_list() in your code is superflous. But if you want to use it, you then have to access "myLabel" as row['myLabel'] On Monday, September 12, 2016 at 10:11:46 AM UTC+2, Annet wrote: > > I have the following query: >

[web2py] Re: why request.vars are added an additional key “records” with null value when I used the sqlform.grid?

2016-09-12 Thread Niphlod
it's to hold selected lines, I think. Anyway, you should use request.get_vars to get your data (since your method is "get"). Also, please note that the grid is coded in such a way that the grid is the sole "manager" of the request/response cycle, so fiddling in the same page with your own

[web2py] Re: scheduler task_id assigned to multiple workers

2016-09-08 Thread Niphlod
load balancing i'm refering to our actualy webserver. We load balance > on 3 machines, and each machine has 3 worker processes running on it. it > seems that those web2py processes lock the table and cause deadlocks > > On Tuesday, August 30, 2016 at 3:37:41 PM UTC-4, Niphlod wrote: >&g

[web2py] Re: queue_task :: trouble with quoted json strings for pvars and args

2016-09-08 Thread Niphlod
s at begin and end. The scheduler part of web2py >> tried to read scheduler records and fails because this (damn) extra quotes. >> >> E. >> >> > I don't use Oracle and I don't have JSON arguments for tasks (yet), so I > can't tell you if the "problem&qu

[web2py] Re: app slow on pythonanywhere

2016-09-05 Thread Niphlod
I think I said it at least 5 times (and there's the book ). Each option has its own environment. And everything follows a logic. A) migrate on DAL sets a default for migrate for all tables

[web2py] Re: Deploy with postgresql

2016-09-05 Thread Niphlod
migrations are enabled! I dont know where is the problem. > I checked to try to create the tables directly in postgresql and it is > running normal. But, using web2py... > > Thanks > > Em segunda-feira, 5 de setembro de 2016 13:11:04 UTC-3, Niphlod escreveu: >> >>

[web2py] Re: File widget traduction

2016-09-05 Thread Niphlod
giorno lunedì 5 settembre 2016 18:08:52 UTC+2, Niphlod ha scritto: >> >> if your custom widget doesn't have T() it can't be translated. if your >> custom widget GETS translated, it's browser's fault. if you have T() but >> nothing in specific language file, how can web2py tran

[web2py] Re: Deploy with postgresql

2016-09-05 Thread Niphlod
ectly in pgadmin even prompt from ubuntu. > > I reinstall everything and got the problem again. > > Thank you very much! > BR > > > Em segunda-feira, 5 de setembro de 2016 04:33:49 UTC-3, Niphlod escreveu: >> >> seemingly no response was given to a simple &qu

[web2py] Re: File widget traduction

2016-09-05 Thread Niphlod
if your custom widget doesn't have T() it can't be translated. if your custom widget GETS translated, it's browser's fault. if you have T() but nothing in specific language file, how can web2py translate it ? On Saturday, September 3, 2016 at 11:07:06 AM UTC+2, Gael Princivalle wrote: > >

[web2py] Re: Deploy with postgresql

2016-09-05 Thread Niphlod
seemingly no response was given to a simple "how many records are there". sure the tables have been created ? On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, Morganti wrote: > > Hi people! > > I just almost in go-live. So, I tried to create a Postgresql database and > starting to configure

[web2py] Re: profanity filter

2016-09-01 Thread Niphlod
definitely the way to go if you can, and I'd also add to learn about virtualenv as soon as you can. for simple packages you may also place their source into site-packages on the web2py root dir (works even with the binaries) Profanity doesn't depend on 3rd party packages, and the source code is

Re: [web2py] Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Niphlod
items isn't a roblem for check_reserved. On Thursday, September 1, 2016 at 10:14:47 PM UTC+2, Richard wrote: > > > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=reserved+word#Reserved-keywords > > Do you have it in your connection string? > > You should be

Re: [web2py] Best way to pre-populate a database on start-up

2016-08-31 Thread Niphlod
controller is hit for another function)... and you can offload the task, e.g., to the scheduler. On Wednesday, August 31, 2016 at 2:33:15 PM UTC+2, Manuele wrote: > > Il 30/08/16 21:40, Niphlod ha scritto: > > +1 for Dave . > > > > with isempty() in a model you're ex

[web2py] Re: Locating Table Definitions in a Module

2016-08-31 Thread Niphlod
versus having them in the model ? imho it's not worth the effort. migrate=False, lazy_tables and conditional models SHOULD get you very far without this kind of complications. On Wednesday, August 31, 2016 at 8:54:35 PM UTC+2, Scott Hunter wrote: > > Is there any benefit to putting the code to

Re: [web2py] Best way to pre-populate a database on start-up

2016-08-30 Thread Niphlod
fabfile ATM is a show-off, and we can't put in there code related to an app which doesn't exist :P We can't pin each and every thread a "useful" information is written, as I really don't see how 40 pinned threads will contribute to web2py's knowledge for - and especially - newbies. IMHO at

Re: [web2py] Best way to pre-populate a database on start-up

2016-08-30 Thread Niphlod
+1 for Dave . with isempty() in a model you're executing a query for each and every request for absolutely NO REASON. This are activities that needs to be carried on on a post-deployment fire-only-when-needed scenario, and outside the web environment. On Tuesday, August 30, 2016 at 8:24:53 PM

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-30 Thread Niphlod
> > On Tuesday, August 30, 2016 at 11:48:42 AM UTC-4, Niphlod wrote: >> >> when the backend has orrible performances :D >> 12 workers with the default heartbeat are easily taken care by a dual >> core 4GB RAM backend (without anything beefy on top of that). >>

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-30 Thread Niphlod
seeing that our load balanced server > with processes runnin on all three machines are causing a lot of deadlocks > in MSSQL. Have you seen that before? > > On Friday, August 19, 2016 at 2:40:35 AM UTC-4, Niphlod wrote: >> >> yep. your worker setup clearly can't stabl

[web2py] Re: TAG helper and unnamed argument

2016-08-29 Thread Niphlod
correct me. On Monday, August 29, 2016 at 11:37:53 PM UTC+2, Niphlod wrote: > > ATM "False" or "None" don't have the corresponding attribute inserted. > There's no way to generate an attribute without value. > > BTW: that is definitely not a good example as it's

[web2py] Re: TAG helper and unnamed argument

2016-08-29 Thread Niphlod
ATM "False" or "None" don't have the corresponding attribute inserted. There's no way to generate an attribute without value. BTW: that is definitely not a good example as it's not HTML5 valid syntax. A better one could have been http://n.example.org/rfc4287;> hi @mdipierro: any

[web2py] Re: Help with Patterns

2016-08-29 Thread Niphlod
are you talking about a general idea for the api ? I'd use 'all' ... On Monday, August 29, 2016 at 2:41:16 AM UTC+2, Diego Marinho wrote: > > I have this pattern: > > > "/jobs/year-start/{jobs.year_start.year}/amount-range-id/{jobs.amount_range_id}/neighbourhood-id/{jobs.neighbourhood_id}" > > I

Re: [web2py] Re: I am trying to login from Phonegap app into my web2py app, what's wrong here?

2016-08-29 Thread Niphlod
ect()* >>>> >>>> >>>> *if db(db.auth_user.username == request.vars.username and >>>> db.auth_user.password == >>>> CRYPT(digest_alg='md5')(request.vars.password)[0]).select(): * >>>> >>>> Both of them don't wo

[web2py] Re: I am trying to login from Phonegap app into my web2py app, what's wrong here?

2016-08-26 Thread Niphlod
fortunately the password doesn't get stored in plain text on web2py :D You need to apply CRYPT() before comparing. Read more about that on the book. On Friday, August 26, 2016 at 3:31:54 PM UTC+2, Steve Joe wrote: > > IN PHONEGAP: > > https://#someurl#.pythonanywhere.com/welcome/phonegap/login >

[web2py] Re: Getting only the latest "version" in a query of items with versions.

2016-08-25 Thread Niphlod
you're thinking with a human mind instead of thinking on how a database works... with sets of data. How can you ask a database to return a single set grouped by something and at the same time as for granular records??? When you use groupby, you can just ask for granular records of the columns

[web2py] Re: uploads of large files

2016-08-25 Thread Niphlod
You can't offload the upload to a task in a separate process: there would be no socket to munge the data in :D Use modern js solutions to return information to the user for multiple uploads and a custom action and use a real webserver in front of web2py (read: nginx) that will buffer the

[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2016-08-25 Thread Niphlod
if you get any error with __tmp is because you didn't drop tables on the backend AND .table files before hitting the app with migrate=True. On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote: > > Hi Niphlod, > I deleted all the scheduler tables , created a new

[web2py] Re: Getting only the latest "version" in a query of items with versions.

2016-08-23 Thread Niphlod
what you want is the latest version for each item_id . That is the row having the greatest version_date if you divide your dataset for each item_id. that is what groupby item_id does. and what max(version_date) does too. On Tuesday, August 23, 2016 at 11:05:52 AM UTC+2, Encompass solutions

[web2py] Re: how make repository on github for windows users?

2016-08-23 Thread Niphlod
you download git for windows and do the same exact thing as in linux On Tuesday, August 23, 2016 at 6:02:17 AM UTC+2, Dmitri Ermolaev wrote: > > What steeps? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Niphlod
mit >> the string field entry but also want requires not empty, how to go about it? >> >> (2) for my sql, do I still need length = 64 (or 255 etc)? Its redundant >> when I define IS_LENGTH(64) or do I need both? >> >> >> >> >> On Monday, Aug

[web2py] Re: How to invoke recurring Scheduler task

2016-08-22 Thread Niphlod
t;recurring tasks all the way down"). > > - Scott > > On Monday, August 22, 2016 at 7:47:07 AM UTC-4, Niphlod wrote: >> >> just queue the task in a protected controller that checks before >> inserting if another instance has been already queued and call that >

[web2py] Re: How to recreate Scheduler tables?

2016-08-22 Thread Niphlod
mysched = Scheduler(., migrate=True) On Monday, August 22, 2016 at 3:17:24 PM UTC+2, Tito Garrido wrote: > > I have upgraded from 2.5.1 to the latest version but seems that the > scheduler tables had changed... I have dropped the old ones and now I am > trying to set web2py to recreate it.

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Niphlod
requires=IS_LENGTH(64) will limit insertion upon validation. the "length" attribute gets translated, wherever possibile, to backend-specific syntaxes. On Sunday, August 21, 2016 at 4:21:22 AM UTC+2, billy...@gmail.com wrote: > > How we limit string length in DAL? It seems length = 64 doesn't

[web2py] Re: How to invoke recurring Scheduler task

2016-08-22 Thread Niphlod
just queue the task in a protected controller that checks before inserting if another instance has been already queued and call that protected controller once in a while (i.e. once per day) On Monday, August 22, 2016 at 3:10:44 AM UTC+2, Scott Hunter wrote: > > The book seems pretty clear

[web2py] Re: Getting only the latest "version" in a query of items with versions.

2016-08-22 Thread Niphlod
max(version_date) . group by item.id On Monday, August 22, 2016 at 9:52:55 AM UTC+2, Encompass solutions wrote: > > Consider the following pseudo model. > > item > ->name = "string" > > version > ->item_id = item.id > ->version_date = "datetime" > > > While I can easily create a

Re: [web2py] LDAP authentication and user creation

2016-08-22 Thread Niphlod
see the source and adapt to your likings: web2py is not going to become an LDAP inventory automatically...studying LDAP is not bad per se: you'll find its query syntax pretty much in every 3rd party tool that integrates with LDAP for some kind of reason. On Friday, August 19, 2016 at 4:23:14

[web2py] Re: How does web2py save JSON fields?

2016-08-19 Thread Niphlod
why don't you just pass request.vars without quoting and unquoting anyway, json is always utf-8 encoded. that's the difference you're seeing. On Friday, August 19, 2016 at 11:43:55 AM UTC+2, Ramos wrote: > > Hi,im starting a new post because i found that JSON fields change data as > they

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-19 Thread Niphlod
ntly coming back as "None" i'm guessing there >> is an error somewhere in that try block and the db commit is being rolled >> back >> >> i'm using MSSQL and nginx... currently upgrading web2py to see it >> continues >> >> >> >&g

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-18 Thread Niphlod
plbGX8J > > our workers seems to be restarting quickly and we're trying to figure out > why > > On Thursday, August 18, 2016 at 3:55:55 AM UTC-4, Niphlod wrote: >> >> small recap...a single worker is tasked with assigning tasks (the one >> with is_ticker=True) and

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-18 Thread Niphlod
he scheduler_run table, it seems to be added as > many times as it can while the run is going... a short run will add just 2 > of the workers and stop adding them once the initial run is completed > > On Wednesday, August 17, 2016 at 11:15:52 AM UTC-4, Niphlod wrote: >> &g

[web2py] Re: High worker count in scheduler_worker table

2016-08-18 Thread Niphlod
550.000 means 550.000 processes have been started. In 2 weeks, if math is right, there are 20.160 minutes. your workers are starting and diying way too much On Wednesday, August 17, 2016 at 9:24:41 PM UTC+2, Jason Solack wrote: > > Hello all, this may be typical, but i'm trying to determine if

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-17 Thread Niphlod
t; On Wednesday, August 17, 2016 at 3:11:11 AM UTC-4, Niphlod wrote: >> >> nothing in particular. what backend are you using ? >> >> On Tuesday, August 16, 2016 at 8:35:17 PM UTC+2, Jason Solack wrote: >>> >>> task = scheduler.queue_task(tab_run

[web2py] Re: Bug?: Spanish formatted dates won't store on database(english ones do)

2016-08-17 Thread Niphlod
you're overriding the default IS_DATETIME() validator attached to datetime with IS_NOT_EMPTY() ... that's the reason it's not working. On Wednesday, August 17, 2016 at 1:51:08 AM UTC+2, Luciano Laporta Podazza wrote: > > Hello, > > I'm working on a simple case file project and realized that

[web2py] Re: db.executesql() is taking 10 times longer than it should to run a query in Web2py

2016-08-17 Thread Niphlod
sure that timings aren't affected by the first query rather than the last ? I mean rows = db(db.Word.normalform == aword.normalform).select(db.Word.id ) On Wednesday, August 17, 2016 at 1:51:08 AM UTC+2, junde...@launchpnt.com wrote: > > Greetings. db.executesql() is

[web2py] Re: Speeding up scheduler assignment time

2016-08-17 Thread Niphlod
redis. also, 1 second heartbeat with a moderate number of workers needs a very responsive backend. On Monday, August 15, 2016 at 4:31:44 PM UTC+2, Jason Solack wrote: > > Hell all, i'm currently leveraging the scheduler to do some data > processing and i'm finding it takes 5-10 seconds for my

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-17 Thread Niphlod
nothing in particular. what backend are you using ? On Tuesday, August 16, 2016 at 8:35:17 PM UTC+2, Jason Solack wrote: > > task = scheduler.queue_task(tab_run, > pvars=dict(tab_file_name=tab_file_name, the_form_file=the_form_file), > timeout=60 * 60 * 24, sync_output=2,

[web2py] Re: web2py in production mode and improving execution time

2016-08-12 Thread Niphlod
use --profiler_dir and then use runsnakerun to inspect. On Thursday, August 11, 2016 at 4:57:38 PM UTC+2, Ron Chatterjee wrote: > > I use MATLAB a lot and they have something call profile. > http://www.mathworks.com/help/matlab/ref/profile.html > > That allows to profile an application based on

[web2py] Re: How to access class variable in web2py like we do in flask?

2016-08-09 Thread Niphlod
The solution lies in knowing web2py's unique execution model (which is BY FAR different from Flask's) AND reading the source code. When faced with the same problem years ago, finding the solution (was already there, as it is now) made me a better coder, so I won't - on purpose - propose a cut

Re: [web2py] Re: Reading date from controller to view in web2py

2016-08-09 Thread Niphlod
the problem is not the resultset: it's how it's injected into the view On Tuesday, August 9, 2016 at 8:28:23 PM UTC+2, Dave S wrote: > > > > On Tuesday, August 9, 2016 at 10:56:48 AM UTC-7, madhu nomula wrote: >> >> db.define_table('ActivityMapping', >> Field('mapping_id'),

[web2py] Re: Get Distinct dates

2016-08-09 Thread Niphlod
database. On Tuesday, August 9, 2016 at 3:08:20 PM UTC+2, Marlysson Silva wrote: > > Backend: database or language programming? > > Em terça-feira, 9 de agosto de 2016 09:59:37 UTC-3, Niphlod escreveu: >> >> let the backend do set operations: it's by far faster tha

[web2py] Re: Get Distinct dates

2016-08-09 Thread Niphlod
let the backend do set operations: it's by far faster than pure python (saves bandwith, too) On Tuesday, August 9, 2016 at 12:49:35 PM UTC+2, Marlysson Silva wrote: > > Use of a SET in list returned of result. > > Em segunda-feira, 8 de agosto de 2016 15:21:58 UTC-3, madhu nomula > escreveu: >>

[web2py] Re: Ubuntu 16.04 - installation script stops

2016-08-09 Thread Niphlod
> I have tried: > wget > https://gist.githubusercontent.com/niphlod/8a13025001363657f0201b2a15dad41c/raw/482fd6973d3c73c415c610dcaf64cd6d8327cfd2/web2py-on-ubuntu.sh > > chmod 755 web2py-on-ubuntu.sh > ./web2py-on-ubuntu.sh > > I got an error message - these are the last line

<    1   2   3   4   5   6   7   8   9   10   >