[web2py] Re: sessions in redis logout error

2015-03-21 Thread Niphlod
fixed https://github.com/web2py/web2py/pull/864 On Saturday, March 21, 2015 at 8:30:41 PM UTC+1, Niphlod wrote: it's a bug. could you please file it on github issues so it gets tracked ? On Saturday, March 21, 2015 at 4:56:42 PM UTC+1, Rod Watkins wrote: Hi all, Has anyone run

[web2py] Re: Where do upload files get stored?

2015-03-21 Thread Niphlod
Beware..something is wrong with your usage of os.path.join. All the arguments passed should not have ANY path separator inside, that's the whole deal of os.path.join. Else, you may just concatenate strings by hand!!! import os os.path.join('a', 'b', 'c') 'a/b/c' os.path.join('a', 'b',

Re: [web2py] Re: Performance problems when executing the sessions2trash.py script

2015-03-21 Thread Niphlod
This last post is a dream come true for my boss. Glossary: - developer -- someone that can create logics in programs, coding in some programming language - sysop -- someone who knows inside out every bit of the pieces the developer uses to make programs work - devop -- someone who is a coder,

Re: [web2py] Re: No module named objects / 2.9.12-stable+timestamp.2015.03.17.18.03.34 / Windows

2015-03-20 Thread Niphlod
. The backend is postgres. The password needs to be updated, before you test it. Kiran Subbaramanhttp://subbaraman.wordpress.com/about/ On Thu, 19-03-2015 12:58 PM, Niphlod wrote: nope, can't replicate. Try downloading the latest. On Thursday, March 19

[web2py] Re: several vars in page

2015-03-20 Thread Niphlod
ohhh my. how can you even suppose someone is going to read throughout all the code to find the culprit ? That's the most unpythonic, repeating template page I've ever seen. Remember that that code will be read more than written, and that's going to be a problem to your

[web2py] Re: Performance problems when executing the sessions2trash.py script

2015-03-20 Thread Niphlod
you can check with the verbose option the things you could be interested in (and helping me/us understand the possible issues): - if cleaning on panel right after cleaning init actually cleans up something -- it shouldn't if your masterapp is always init - how many sessions are you inspecting -

[web2py] Re: Performance problems when executing the sessions2trash.py script

2015-03-20 Thread Niphlod
2015, 20:18:57 (UTC-3), Niphlod escribió: you can check with the verbose option the things you could be interested in (and helping me/us understand the possible issues): - if cleaning on panel right after cleaning init actually cleans up something -- it shouldn't if your masterapp is always

[web2py] Re: last minute web2py hackaton

2015-03-20 Thread Niphlod
damn. I should have waited all those months. muhahahaha! let's see if money speed up things. BTW; I'd have included that with the fix should be included a regression test to make it never happen again, but that's just me -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Dal cache key name

2015-03-20 Thread Niphlod
why cache_prefix has been thrown under the bus ? Let's stick to what we have instead of supplying yet another method! On Friday, March 20, 2015 at 5:53:20 PM UTC+1, Massimo Di Pierro wrote: OK in pydal now: select(, cache=dict(model=cache.ram, expiration=10, key='mykey')) lease give it

[web2py] Re: Performance problems when executing the sessions2trash.py script

2015-03-20 Thread Niphlod
are sessions stored on files, db, memcache or redis ? On Friday, March 20, 2015 at 11:33:15 PM UTC+1, Lisandro wrote: I'm using we2py in production to serve about 15 websites, each one of them is served by it's own web2py installation. I want to clean up expired sessions every certain

[web2py] Re: SQLFORM.factory and inserting records...

2015-03-20 Thread Niphlod
There are a few errors in the code, and in the assumptions you are doing: - SQLFORM.factory doesn't do any db I/O, so process() doesn't actually store anything - either you use form.process().accepted or form.accepts(request, session) - you're hacking auth.forms, which is undocumented and

Re: [web2py] Re: No module named objects / 2.9.12-stable+timestamp.2015.03.17.18.03.34 / Windows

2015-03-19 Thread Niphlod
Subbaramanhttp://subbaraman.wordpress.com/about/ On Thu, 19-03-2015 1:13 AM, Niphlod wrote: is it the source or the binary version ? On Wednesday, March 18, 2015 at 6:25:22 PM UTC+1, Kiran Subbaraman wrote: Bumping this thread: https://groups.google.com/d/msg/web2py/6lWIcIAYoHY

Re: [web2py] Re: No module named objects / 2.9.12-stable+timestamp.2015.03.17.18.03.34 / Windows

2015-03-19 Thread Niphlod
it. Kiran Subbaramanhttp://subbaraman.wordpress.com/about/ On Thu, 19-03-2015 12:58 PM, Niphlod wrote: nope, can't replicate. Try downloading the latest. On Thursday, March 19, 2015 at 5:46:43 AM UTC+1, Kiran Subbaraman wrote: Downloaded it from

[web2py] Re: Layout login

2015-03-19 Thread Niphlod
default/user.html is probably using {{extend 'layout.html'}} instead of {{extend 'layout_site.html'}} On Thursday, March 19, 2015 at 9:46:54 AM UTC+1, Gael Princivalle wrote: Hello all. In all my applications I use a custom layout.html called layout_site.html. When the user login the

[web2py] Re: can't pack app on pythonanywhere

2015-03-18 Thread Niphlod
and there we are. https://github.com/web2py/web2py/pull/855 On Wednesday, March 18, 2015 at 10:22:07 PM UTC+1, Massimo Di Pierro wrote: I agree. Can you make a patch. Else I will do it later today. On Wednesday, 18 March 2015 12:07:16 UTC-5, Leonel Câmara wrote: The bug is that the cache

[web2py] Re: Printing data on web2py view page is different from python shell

2015-03-18 Thread Niphlod
On Wednesday, March 18, 2015 at 11:00:50 PM UTC+1, Gray Kanarek wrote: Could also try BEAUTIFY(), which will accept a list and print it out as a table. but won't preserve newlines, that's pretty much the entire deal about the issue ^_^ -- Resources: - http://web2py.com -

[web2py] Re: can't pack app on pythonanywhere

2015-03-18 Thread Niphlod
sessions too, it came up in another thread. On Wednesday, March 18, 2015 at 6:07:16 PM UTC+1, Leonel Câmara wrote: The bug is that the cache directory shouldn't be packed at all. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: No module named objects / 2.9.12-stable+timestamp.2015.03.17.18.03.34 / Windows

2015-03-18 Thread Niphlod
is it the source or the binary version ? On Wednesday, March 18, 2015 at 6:25:22 PM UTC+1, Kiran Subbaraman wrote: Bumping this thread: https://groups.google.com/d/msg/web2py/6lWIcIAYoHY/lRPDjXHl2_wJ Does anyone else face this issue? -- Resources: - http://web2py.com -

[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread Niphlod
an ON INSERT trigger usually happens at the moment you're about to insert a new record. This will make inserting the same row over and over just an update to the row, instead of an insertion of the new one. With that in place, you can skip your own validation and just insert the whole file, the

[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread Niphlod
I'm saying it often lacks standard features you'd expect from a relational backend. I'm more biased towards postgresql. On Tuesday, March 17, 2015 at 10:02:37 PM UTC+1, LoveWeb2py wrote: Please forgive me if I'm interpreting your message incorrectly, but are you saying MySQL is not a serious

[web2py] Re: max size table that DAL can handle?

2015-03-16 Thread Niphlod
I have 300m+ records too, but I don't need to fetch all of those in a single query. It's not a matter of indexes or anything else: the system hang you're incurring to is not the one that the database takes from the moment you send the query to the first row returned, but the time you take to

[web2py] Re: max size table that DAL can handle?

2015-03-16 Thread Niphlod
I still don't see the need of a dict-like something holding 10m hashes to discern in some 10k lines which one to insert... solutions: 1) if the files you're going to insert have less rows than the number of rows in the table, revert the logic: fetch only table rows that could be matching

Re: [web2py] Select categories that are in use

2015-03-16 Thread Niphlod
On Monday, March 16, 2015 at 10:24:28 AM UTC+1, Johann Spies wrote: On 10 March 2015 at 13:44, Niphlod nip...@gmail.com javascript: wrote: 2 queries ? no subselect - way, 1 query. And you think using a subselect makes it one query? I had a mistake in my query: orderby should

[web2py] Re: max size table that DAL can handle?

2015-03-16 Thread Niphlod
you should listen to Anthony and everybody else ... 1m rows in a single request is not going to be speedy no matter what. we - developers - are aware that pyDAL isn't convenient for such demands, and already have on the TODO-list an iterator that will alleviate the problem. However, a

[web2py] Re: Migrating Passwords

2015-03-16 Thread Niphlod
uhm. web2py's format means 1000 iterations and 20 chars length, with sha512 as hash function. the missing variable here is 20 char length... iterations are the same (1000) and so the hash function (sha512). from werzeug docs, it seems that the key length is the digest size...which for

Re: [web2py] Select categories that are in use

2015-03-16 Thread Niphlod
As I'm a relentless DBA after all, and I enjoy facts over estimates, and I live for these kind of thingsI concocted a script that benches different methods. pyDAL interaction has been left out of the picture, as it'll probably affect estimates. Raw T-SQL under the hood, psycopg2 driver.

Re: [web2py] Re: autocomplete basic confusion

2015-03-15 Thread Niphlod
uhmthen you completely skipped the docs about the autocomplete widget... model db.define_table('stuff', Field('nombre', 'string', requires=IS_NOT_EMPTY()), format='%(nombre)s' ) db.define_table('reel', Field('whatever',

[web2py] Re: autocomplete basic confusion

2015-03-15 Thread Niphlod
on top of that, the autocomplete was set to autocomplete based on the values presented on the reel table instead of the - wanted - stuff table On Sunday, March 15, 2015 at 2:44:26 PM UTC+1, Leonel Câmara wrote: Notice that the important difference is in the order. Niplhod set the widget

[web2py] Re: autocomplete basic confusion

2015-03-15 Thread Niphlod
uhm. just one sec let's get back to the beginning ..reference fields support is for storing the primary key of the referenced table if you define things as you did, you'll get db.reel.sid with an id pointing out to the 'stuff' record whose id is that one. this seems to clash with

[web2py] Re: backup web2py application from controller (not from appadmin)

2015-03-14 Thread Niphlod
the error speaks pretty much by itself while in a controller action, the session file is locked, hence you can't pack in into an app. Remains to be seen if it's ok to pack an app with its sessions on it: shouldn't be that way but, alas, nobody ever tried to do it before. On Saturday, March

[web2py] Re: web2py new version

2015-03-14 Thread Niphlod
prettydate availability throughout your app comes from this line in a model from gluon.tools import prettydate if you upgraded web2py but your app's code remained the same, you should not suffer from it. If instead you overwrote some files on your app with ones coming from the new scaffolding

Re: [web2py] Re: two (or more) applications using the same database

2015-03-13 Thread Niphlod
Why would you need a commit()? If everything is happening within a web2py request, any open transactions will be rolled back should either database throw an error, or if the app code itself results in an exception. So, if a record in one database is deleted, but then an exception occurs

Re: [web2py] Re: two (or more) applications using the same database

2015-03-13 Thread Niphlod
Is the concern that the commit operation of the second transaction will itself raise an exception (at which point, the first transaction has already been commited)? Aside from that possibility, wouldn't any error (within the databases or otherwise) simply result in both transactions

Re: [web2py] Re: PKI Authentication? How to grab users certificates httpd wsgi

2015-03-12 Thread Niphlod
not everyone needs client certificates, so of course the default config needs tuning. AFAIK (@michele can chime in any time, he's the original author) what is needed are a few environmental variables passed along, such as SSL_CLIENT_CERT SSL_CLIENT_RAW_CERT SSL_CLIENT_VERIFY SSL_CLIENT_SERIAL

[web2py] Re: DAL: INSERT-query's devilry

2015-03-12 Thread Niphlod
IMHO inserting to a view shouldn't be supported at all. On Thursday, March 12, 2015 at 12:18:10 AM UTC+1, Val K wrote: OK guys! My concrete suggestion: - Add attrubute _insert_with_returning to Table class - Fix adapter Postgres.py : def _insert(self, table, fields):

Re: [web2py] Re: two (or more) applications using the same database

2015-03-12 Thread Niphlod
you can use IS_IN_DB() but that would be an application constraint, not a db one (which 'reference othertable' creates instead). On Thursday, March 12, 2015 at 3:46:05 PM UTC+1, lucas wrote: yes, wouldn't DAL need to if it allows for connection(s) to multiple databases in the first place?

[web2py] Re: Integrating with Google App Engine

2015-03-12 Thread Niphlod
if you plan to deploy on GAE, develop on GAE. On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Omar Sanseviero wrote: I have a question about web2py. Should I be implementing all the database in web2py or in GAE? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: two (or more) applications using the same database

2015-03-12 Thread Niphlod
, as Niphlod pointed out, you can still use the IS_IN_DB validator to maintain the referential constraint from the app side. You won't get automatic cascading, but I suppose you could handle that with an _after_delete callback. Perhaps some of this could be automated by the DAL. I don't think it'll

[web2py] Re: accessing current.variable from a module

2015-03-12 Thread Niphlod
are you staying in the same thread while calling BOTH initialize and parse_command() ? On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Gray Kanarek wrote: I'm defining a variable in one of my modules: from gluon import * def initialize(): current.output_buffer = deque(maxlen=100)

Re: [web2py] Re: two (or more) applications using the same database

2015-03-12 Thread Niphlod
Within the context of a web2py request, wouldn't there be two transactions open (one for each database)? In that case, at least if the request results in an error, both transactions would be rolled back. Anthony well, pydal isn't used only in web2py's context but even if it was, you'd

[web2py] Re: Compute insert-only

2015-03-12 Thread Niphlod
code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row)) that builds the paths based on other fields. I was thinking of using compute=make_url, but it seems that

Re: [web2py] Select categories that are in use

2015-03-10 Thread Niphlod
2 queries ? no subselect - way, 1 query. db(db.news_categories.id.belongs(db(db.news.id0)._select(db.news.category, distinct=True))).select() technically, there is also another one, more useful in case you'd like to select, e.g., only categories with at least x news, but that's another

Re: [web2py] Select categories that are in use

2015-03-10 Thread Niphlod
(db.news.category, distinct=True))).select(orderby=db.news_categories .name) On Tuesday, March 10, 2015 at 9:42:31 PM UTC+1, Gael Princivalle wrote: Thanks all. Niphlod what a great query. I'm just disappointed about the orderby, it don't have any effect: categories=db(db.news_categories.id.belongs

[web2py] Re: Running multiple lines of SQL in executesql

2015-03-10 Thread Niphlod
executesql doesn't allow more than one statement per invocation. You'll get the same issues running execute() with the underlying driver. What are you really trying to execute isn't a query: it's more of a stored procedure that returns a set of results. On Tuesday, March 10, 2015 at 8:36:28 PM

[web2py] Re: how to insert dynamic record id into field in form

2015-03-10 Thread Niphlod
there's something wrong with the code something = db.table.insert(**mapping) returns the db.table.id that has been inserted. in this piece of code, using messageID.id doesn't really make much sense... On Tuesday, March 10, 2015 at 8:49:05 PM UTC+1, Alex Glaros wrote: I want to insert the

[web2py] Re: how to insert dynamic record id into field in form

2015-03-10 Thread Niphlod
uhm. there's a hiccup in the process (or at least in what you think should be the process). You're using factory(), so you need to handle your own db i/o. If you want to insert a new record, how can you know in advance its id if you didn't actually insert it into the table ? There is no way

Re: [web2py] Re: PKI Authentication? How to grab users certificates httpd wsgi

2015-03-10 Thread Niphlod
what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems(): if k.lower().startswith('ssl'): debug_values[k] = v . return dict(.,

Re: [web2py] Re: PKI Authentication? How to grab users certificates httpd wsgi

2015-03-10 Thread Niphlod
Niphlod. I hope this helps others in the future! On Tuesday, March 10, 2015 at 6:40:29 PM UTC-4, Niphlod wrote: what if you return somewhere this dict (takes the SSL* env variables and prints it) def yourcode(): . debug_values = {} for k, v in request.env.iteritems

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Niphlod
for the same exact reason. NOT field = True in t-sql means just FALSE, not FALSE and NULL On Monday, March 9, 2015 at 2:37:46 PM UTC+1, Dmitry Ermolaev wrote: I use negate - why this not worked? воскресенье, 8 марта 2015 г., 23:15:49 UTC+3 пользователь Niphlod написал: booleans in T

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Niphlod
: for pr in db(db.progs).select(): if pr.promo or pr.closed: continue понедельник, 9 марта 2015 г., 16:58:26 UTC+3 пользователь Niphlod написал: for the same exact reason. NOT field = True in t-sql means just FALSE, not FALSE and NULL On Monday, March 9, 2015 at 2:37:46 PM

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-09 Thread Niphlod
still don't see any reference in the docs.. On Monday, March 9, 2015 at 8:01:13 AM UTC+1, da...@mail.hebrew.edu wrote: the work around is to set truncate(0). On Sunday, March 8, 2015 at 5:14:14 PM UTC+2, da...@mail.hebrew.edu wrote: hi, after python 2.7.2, seek(0) on an opened file

[web2py] Re: DAL negate a query - error

2015-03-08 Thread Niphlod
booleans in T-SQL are not treated the same way as python. in T-SQL, NULL values are neither True or False, they are just NULL. So, if you want closed either None or False, you should do ((db.progs.closed == None) | (db.progs.closed == False)) one shortcut to it would be

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-08 Thread Niphlod
can you provide pointers to the docs ? On Sunday, March 8, 2015 at 4:14:14 PM UTC+1, da...@mail.hebrew.edu wrote: hi, after python 2.7.2, seek(0) on an opened file for append does not seek to the begining - read the manual. so LockedFile(...) used by languages, is screwing up the language

[web2py] Re: Weird problems with scheduler on OSX

2015-03-08 Thread Niphlod
try this script and see if it fails. it's the boiled down version of what happens with -X https://www.dropbox.com/s/5dpddioc4u8z6bg/web2py_trial.py?dl=0 PS: put it next to web2py.py and run it with python web2py_trial.py -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Can we disable moderation in the group?

2015-03-08 Thread Niphlod
except who post spam regularly... On Saturday, March 7, 2015 at 3:12:30 AM UTC+1, Jack Kuan wrote: I don't see the need and think it can be off putting for new comers. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: IMPORTANT - DROPPING SUPPORT FOR PYTHON 2.5?

2015-03-07 Thread Niphlod
well, binaries ship their own python interpreter so they're out of the picture. Dropping 2.5 support means that if anyone is running web2py source with a python 2.5 interpreter would not work. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: OT: I'm stunned how bad MySql is after using Postgres

2015-03-06 Thread Niphlod
BTW, you just joined two groups I'm in : postgresql lovers and mysql haters. I'm a taddle biased too (mainly for hiccups seen here and there, also while working on web2py), but mysql doesn't really cut the deal of behaving like a serious database should. I'm happier with SQLite, and that's

[web2py] Re: OT: I'm stunned how bad MySql is after using Postgres

2015-03-06 Thread Niphlod
On Friday, March 6, 2015 at 11:58:49 PM UTC+1, Joe Barnhart wrote: Niphlod -- I guess I was expecting more parity between the two since MySql has such a dominant position (at least here in the US). I am shocked at how different they are performance-wise. But my requirement of being able

[web2py] Re: Weird problems with scheduler on OSX

2015-03-06 Thread Niphlod
I'm entering in weekend-status, but really need to go to bed first. Stay tuned in the next days: I'll try to create a very small script that does what web2py does when started with -X (nothing special) : spawning a subprocess from a thread. If that small bit doesn't work, then it's Mac's fault

[web2py] Re: fastest way to count - check for mere existence of any record

2015-03-06 Thread Niphlod
yep. db(query).isempty() returns True if no records are found, in the uttermost simplicistic and speed-aware method I know, that is basically db(query).select(limitby=(0,1), orderby_on_limitby=False) On Friday, March 6, 2015 at 10:17:38 PM UTC+1, Alex Glaros wrote: does this look okay? if

[web2py] Re: Weird problems with scheduler on OSX

2015-03-06 Thread Niphlod
add yourself to the bandwagon and help us see what's going wrong https://github.com/web2py/web2py/issues/711 BTW: asked several times for someone with a mac to test it. I haven't one so unfortunately I can't help that much if nobody replies. On Friday, March 6, 2015 at 6:16:28 PM UTC+1,

[web2py] Re: fastest way to count - check for mere existence of any record

2015-03-06 Thread Niphlod
by any chance, is isempty() being totally forgotten ? it just does return not self.select(limitby=(0,1), orderby_on_limitby=False) On Friday, March 6, 2015 at 8:19:54 PM UTC+1, Alex Glaros wrote: oops, meant this if (db((db.VerifiedConnection.personID == personID.id) (db.

Re: [web2py] dbio=False proper way to update every fields not only the one that had changed

2015-03-06 Thread Niphlod
IMHO the hiccup comes from the fact that fields that are writable = False are not rendered as an input/select/whatever, but they're just a TD cell filled with data. Of course the form isn't submitting it. On Friday, March 6, 2015 at 4:19:35 PM UTC+1, Anthony wrote: No, the compute field

Re: [web2py] dbio=False proper way to update every fields not only the one that had changed

2015-03-05 Thread Niphlod
web2py doesn't know if a field has been edited or not. form.vars (for a standard web2py form) holds EVERY value, irregardless of the ones touched or not by the user... On Thursday, March 5, 2015 at 4:17:26 PM UTC+1, Richard wrote: Futher check make me confirm which I thought : **{f: v for

[web2py] Re: if I use the one step production deployment will it overwrite these existing settings?

2015-03-05 Thread Niphlod
yes On Friday, March 6, 2015 at 12:30:36 AM UTC+1, Simon Redmond wrote: quick install question, I have postfix,dovecot apache and an ssl cert already installed and configured on my server, if I use the one step production deployment will it overwrite these existing settings? --

[web2py] Re: nssm and web2py as a windows service

2015-03-04 Thread Niphlod
^_^ . Glad it worked out fine. @tim: maybe a PR on the book with this cmdline instead of the one posted there c:\web2py.py -p 8041 -i 0.0.0.0 --password=112233 --folder= d:\web2py_internet --socket-timeout=10 --timeout=120 -c d:\web2py_internet\applications\example.com.au.crt -k

[web2py] Re: Bootstrap is really killing web2py

2015-03-04 Thread Niphlod
On Wednesday, March 4, 2015 at 8:59:28 PM UTC+1, Guilherme Rosa wrote: I am running the latest version of web2py and for some reason it will not let me load the w2p file in the admin interface under upload and instal packed application. Anyone having this same issue? does it say

[web2py] Re: admin pointing to wrong static css in rendered page.

2015-03-04 Thread Niphlod
please point to the script used: it probably comes from an old setup. You'll find numerous occurrences of the same problem here and there on the forum. What needs to be changed is the thing that serves static files, taking into consideration static asset management

[web2py] Re: auth.wiki() - accessing the tables created (wiki_media, wiki_page, wiki_tag)

2015-03-03 Thread Niphlod
read here http://web2py.com/books/default/chapter/29/03/overview?search=wiki#Extending-the-auth-wiki-feature about it On Tuesday, March 3, 2015 at 6:06:21 PM UTC+1, Andres Orjuela wrote: Hi! I just found web2py 2 weeks ago and am now working through the book, the video tutorials and even

[web2py] Re: nssm and web2py as a windows service

2015-03-03 Thread Niphlod
nssm isn't rocket science, from the web2py perspective. The point usually is being able to run web2py passing arguments as you need them ? If you can do it by cmdline, nssm isn't an issue: just use the same commandline web2py.py -a recycle --interfaces

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Niphlod
then, it's exactly as I said: the improper use of response.json. On Tuesday, March 3, 2015 at 8:59:59 PM UTC+1, naveed wrote: Sorry, I should have been more clear. It’s caused by adding the line {{=(response.json(['foo', {'bar': ('baz', None, 1.0, 2)}])) }} in to the existing

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Niphlod
it should be done in the controller, the view is where you present the data, not where you transform it. anyway, if you want to hurt yourself, you can do {{import json as myjson}} {{=myjson.dumps(['a', 'b', 'c', {1: 'x'}])}} -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Niphlod
uhm. isn't there https://github.com/web2py/web2py/blob/master/applications/welcome/views/default/index.html On Tuesday, March 3, 2015 at 12:09:47 AM UTC+1, naveed wrote: Looks like it’s caused by this line of code in index.html in the welcome app: {{=(response.json(['foo', {'bar':

Re: [web2py] Re: Please help us test the 2.9.12 binaries

2015-03-02 Thread Niphlod
note for anyone: stable doesn't mean that nothing changes. It means that documented API's as explained in the book are stable. web2py doesn't send your application's code back to web2py.com for further analysis :-P If you don't test yourself (or add tests to the default test suite)...well, we

[web2py] Re: belongs statement for grid

2015-03-02 Thread Niphlod
On Monday, March 2, 2015 at 5:57:30 AM UTC+1, Alex Glaros wrote: works perfect Niphlod, 1. is underscore var name preferable to camel case in w2py? nope. the way you named it though revealed a lot on the shortcircuits 2. is there any difference between .select and ._select? (in my

[web2py] Re: Ajax call issues.

2015-03-02 Thread Niphlod
you can't expect something in ..//static/python/the_mailer.py to be magically executed just POSTing to that path... use a proper function in a proper controller... On Monday, March 2, 2015 at 7:24:30 AM UTC+1, John Costantino wrote: Hey so I have a mail script written in python which works

[web2py] Re: Problems after upgrading to 2.9.12

2015-03-02 Thread Niphlod
it's a bug that got fixed. You used to rely on response.json() to return a string, while it had to return a javascript object. Now response.json() sets the content-type header to application/json as it is supposed to. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: Can anyone help how to Delete title of Confirm Popup in javascript?

2015-03-02 Thread Niphlod
the code comes from an asp page, not a web2py one. are you sure you're asking in the right forum ? On Monday, March 2, 2015 at 6:56:35 PM UTC+1, Nipun Bhardwaj wrote: asp:Button ID=btnID runat=server Text=ID Width=100px meta:resourcekey=btnIDResourceKey OnClientClick =return confirm

[web2py] Re: SQL.grid - cvs=true

2015-03-02 Thread Niphlod
csv=False should disable exports alltogether: how can you reach that url ? On Monday, March 2, 2015 at 7:21:12 PM UTC+1, Dmitry Ermolaev wrote: make table view: t = t and SQLFORM.smartgrid(db[t], maxtextlengths = { 'fonds.name': 60, 'fonds.info': 200 },

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-02 Thread Niphlod
that's definitely not related to the upgrade. that being said, if you can show some code with an app that reproduces the issue, I'll be glad to pinpoint the cause -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: belongs statement for grid

2015-03-01 Thread Niphlod
there's a bit of short-circuit in this. small recap: - SQLFORM.grid() takes a query, i.e. db(set), i.e. just what you'd like to display without the .select() part - belongs() is a method to build up a condition, that takes either a list of values, or a subselect, i.e. a full

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-03-01 Thread Niphlod
://github.com/web2py/web2py/blob/master/gluon/rewrite.py#L1073 On Saturday, 28 February 2015 10:44:35 UTC-6, Niphlod wrote: On Saturday, February 28, 2015 at 5:08:38 PM UTC+1, Massimo Di Pierro wrote: it is supposed to be request.env.query_string or request.env.get('query_string'). It is supposed

[web2py] Re: How to get host and scheme from a scheduled task?

2015-03-01 Thread Niphlod
uhm... the host is different from the hostname and from the domain. Usually, the pretty thing about the request environment is that there is a Host header sent by client that indicates which domain it has been accessed. This makes your application unaware that is running on a particular

[web2py] Re: How to hide app name and how to prevent name leakage if hosting multiple apps on one server?

2015-03-01 Thread Niphlod
On Sunday, March 1, 2015 at 1:33:09 PM UTC+1, Dragan Matic wrote: Let's say that I have application named app1 and I am hosting it on www.app1.com domain. I would like application name not to be shown. If for instance I have two controllers, ctr1 and ctr2, URL helper will always generate

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-28 Thread Niphlod
On Saturday, February 28, 2015 at 5:08:38 PM UTC+1, Massimo Di Pierro wrote: it is supposed to be request.env.query_string or request.env.get('query_string'). It is supposed to be lower case and not upper case. If nginx has it upper case than there is a bug. In retrospect it was a

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-26 Thread Niphlod
+1 for switching to nginx. actually, what I meant to write is request.env.get('QUERY_STRING') On Friday, February 27, 2015 at 5:53:57 AM UTC+1, Mike wrote: On Wednesday, February 25, 2015 at 12:18:29 PM UTC-8, Niphlod wrote: reaally strange, although I don't use lighttpd since nginx came

[web2py] Re: DAL for Insert Into with Select

2015-02-26 Thread Niphlod
why don't you just use db.table.insert()? anyway, db.executesql() has a placeholders parameter that can pass quoted variables just fine! On Friday, February 27, 2015 at 12:39:50 AM UTC+1, Mat Miles wrote: Is it possible to use the DAL to run an INSERT INTO with a select list? I haven't

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
), 1000 IOPS. Would be pretty surprised if that were the problem. Running 5 scheduler workers with the default heartbeat (3s). On Thursday, February 26, 2015 at 3:35:41 PM UTC-8, Niphlod wrote: it seems to me that there is database contention although the exception **should** be trapped

[web2py] Re: not web2py question - test timezone detection

2015-02-26 Thread Niphlod
On Wednesday, February 25, 2015 at 10:25:26 PM UTC+1, Dave S wrote: On Wednesday, February 25, 2015 at 7:45:03 AM UTC-8, Niphlod wrote: if a module is required, it is imported. What names can be be imported? Must a 3rd-party module be renamed to fit the plug-in scheme? My

[web2py] Re: change edit button link in SQLFORM?

2015-02-26 Thread Niphlod
you have two methods: - set editable=False and use your own links= - check for 'edit' in request.args and override accordingly On Thursday, February 26, 2015 at 3:30:07 PM UTC+1, LoveWeb2py wrote: I think this should be pretty easy, but I couldn't find how to edit the SQLFORM buttons in the

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
it seems to me that there is database contention although the exception **should** be trapped (i.e. try to set the status to PICK, if not, well it's not a fatal error), there's something wrong with your setup or your database is too much underpowered to do what you're asking. How

[web2py] Re: importing .csv to create DAL object

2015-02-25 Thread Niphlod
by hand. On Wednesday, February 25, 2015 at 4:29:52 PM UTC+1, Abhijit Chatterjee wrote: I haven't tried to code yet. But if I have .sql file. How to import. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: not web2py question - test timezone detection

2015-02-25 Thread Niphlod
-standard name). Or is here some solution? Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a): I don't see any cons in the actual naming conventions, and frankly, no pros on the one you're suggesting...granted, web2py plugins won't work with django, but the same applies for django

Re: [web2py] Routes pattern and args / query strings

2015-02-25 Thread Niphlod
BTW... just to synchronize ourself, what the book gives as an example is ('/new_name/$anything', '/app/controller/function*/*$anything') mind the */* part . This is the only safe way to do what people usually want to translate, that is the app/c/f part, while leaving args and vars untouched.

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-25 Thread Niphlod
reaally strange, although I don't use lighttpd since nginx came out. request.vars are parsed out of request.QUERY_STRING. could you please doublecheck what request.get('QUERY_STRING') dumps ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: importing .csv to create DAL object

2015-02-25 Thread Niphlod
.sql files are files filled with insert into table(col1, col2, col3) values ('a', 'b', 'c') web2py can't parse them, and frankly, it doesn't need to. it's a job best served by native tools. it'll better to restore the dump using native tools, then read the section on the book

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-24 Thread Niphlod
given that it seems that the layout is not web2py-specific, if you took it as it is, you're missing pretty much everything... the error shown in the forms are handled first thing by web2py widgets, that are coupled with a minimum of css to be displayed. On Tuesday, February 24, 2015 at 2:54:50

[web2py] Re: error: name 'auth' is not defined after upgrading web2py

2015-02-24 Thread Niphlod
2.5.1 to 2.9.12 is a pretty steep upgrade. In theory, compilation could break only if you're switching interpreters (such as, python 2.6 to 2.7). On Tuesday, February 24, 2015 at 1:58:31 PM UTC+1, Ivan wrote: Hi, I have upgraded web2py from 2.5.1 to 2.9.12 but a compiled app stopped to work

[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-24 Thread Niphlod
+1 for handling consistently cache keys, but I'm not an advocate of security by oscurity. File names in the cache folder aren't supposed to be read, and are not visible to anyone if not the administrator of the server. if access is granted to anybody, the password can be retrieved looking at

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-24 Thread Niphlod
how did you setup lighttpd and fastcgi ? On Tuesday, February 24, 2015 at 7:41:11 PM UTC+1, Mike wrote: Hello, I have been modifying an application deployment to use Lighttpd + FastCGI instead of the built-in Rocket web server, and I have noticed that the app controllers now get an empty

<    7   8   9   10   11   12   13   14   15   16   >