[web2py] Re: How to update app keeping the database intact

2016-01-04 Thread Niphlod
where is the db ? On Monday, January 4, 2016 at 7:17:07 AM UTC+1, Ron Chatterjee wrote: > > > Happy New Year Everyone, > > I want to understand what everyone think about this problem. Let's say I > have an app installed in python anywhere. I have few users. There are some > changes to my app or

[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-03 Thread Niphlod
glad to have fixed a solvable issue : waiting for the unsolvable :P On Sunday, January 3, 2016 at 3:29:54 AM UTC+1, Tom Campbell wrote: > > Argh, I should have updated this. Thank you for answering! Adding the > import to dev_appserver.py did not work. But I had to learn about pip > (ahem) and i

[web2py] Re: Visualizzazione di PDF e JPG in una pagina

2016-01-02 Thread Niphlod
uhm. A('download the file', _href=URL('default', 'download', args=download_file.Allegato)) will create a link :-P On Sunday, January 3, 2016 at 12:39:41 AM UTC+1, Alessandro Leonetti wrote: > > Hi Niphlod and thanks for your answer, > > I tried y

[web2py] new redis_tools, new redis-backed scheduler

2016-01-02 Thread Niphlod
(and your app) can use a single RConn instance without issues. Was this only a refactor ? Nope! There is also a new (not so shiny, 'cause - guilty as charged - I'm using it for 10 months in production now) redis-backed scheduler. Of course it's experimental (as everything in contr

[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-02 Thread Niphlod
uhm. I don't have a mac and either app engine sdk, but it seems it can't find the package python-mysqldb . If I recall correctly, it was an issue (on GAE's SDK side) a few releases ago. What does happen if you add "import MySQLdb" in dev_appserver.py ? On Saturday, January 2, 2016 at 1:39:47 PM

[web2py] Re: Selecting whole record with MIN query

2016-01-02 Thread Niphlod
I second this BUT I still want to point out that .first() is a great tool but it works at python level. In a "people" table holding 8M results, you'll wait a lot. Use - WHENEVER and WHEREVER possible - orderby. db(db.people.city == 'London').select(orderby=db.people.age, limitby=(0,1)).first()

[web2py] Re: Visualizzazione di PDF e JPG in una pagina

2016-01-02 Thread Niphlod
I very much welcome more italians to the fold of web2py-users, but this group is in English Translation: Apprezzo l'entrata di altri italiani nel gruppo, ma questo (web2py-users) è in inglese ! @AleLeonetti: to keep images at 50% scale, it'd be better to have them resized properly. If you kno

[web2py] Re: what's wrong in this code? please help

2016-01-02 Thread Niphlod
hi @RAGHIB B. I saw a LOT of basic questions coming from you that are ALL addressed in the web2py book (that is available at http://web2py.com/book) . All the examples you asked are probably there. @Anthony feeding you every answer and you copy/pasting is not going to move you faster than readi

[web2py] Re: How do I change the look of a forms without using bootstrap? I am not getting any source to study it

2016-01-01 Thread Niphlod
strange question. If you know what html and css are, you know what to do already. If you don't, I strongly suggest you keep using a css framework, as bootstrap is, to make things easy for you That being said, there's plenty of guides on css, html and js. You can start http://www.w3schools.com/

[web2py] Re: Place different response.meta.description on each page

2015-12-31 Thread Niphlod
t 3:27:07 AM UTC+1, Joe wrote: > > Hello Niphlod, > > Thanks for your reply. > > I tried to do that several different ways but I am sure I did it wrong. > Can you please let me know how to set this exactly? > > Thanks > > > On Wednesday, December 30, 2015 at

[web2py] Re: Upgrade to Web2py 2.10.4 breaks date field search in sqlform.grid

2015-12-30 Thread Niphlod
its fixed for some months now. On Wednesday, December 30, 2015 at 4:39:31 PM UTC+1, Laurent Lc wrote: > > Did you find a solution ? > Thanks > > Le vendredi 5 juin 2015 06:26:00 UTC+2, Mat Miles a écrit : >> >> I upgraded Web2py to version 2.10.4 on Pythonanywhere which has created a >> problem w

[web2py] Re: Place different response.meta.description on each page

2015-12-30 Thread Niphlod
set response.meta.description in the controller that generates the page On Wednesday, December 30, 2015 at 6:21:40 AM UTC+1, Joe wrote: > > Hello, > > By default meta tags are in menu.py > > response.meta.author = '' > response.meta.description = '' > response.meta.keywords = '' > response.me

[web2py] Re: multiple file uploads

2015-12-29 Thread Niphlod
multiple in what sense ? that you'd like to initiate several files in a single http request ? On Tuesday, December 29, 2015 at 8:42:02 PM UTC+1, Ron Chatterjee wrote: > > Does anyone can point me to an example of multiple file uploads (not just > image files) > -- Resources: - http://web2py.co

[web2py] Re: HTML5 Local storage and web2py

2015-12-29 Thread Niphlod
being something that lives in your browser, the only way is to use javascript. On Tuesday, December 29, 2015 at 3:09:18 AM UTC+1, luis.va...@metamaxzone.com wrote: > > Hello! > > I want to use the HTML5 Local Storage ( > http://diveintohtml5.info/storage.html) to store session and other > persi

[web2py] Re: Oracle drivers.

2015-12-29 Thread Niphlod
if it fixes all issues, open a bug on pydal and it'll get merged. On Monday, December 28, 2015 at 9:57:52 PM UTC+1, Michael Messmer wrote: > > @Niphlod @Massimo > > Is what i did a correct fix and is this something that needs to be > corrected here > https://github.com/w

[web2py] Re: web2py_session already exist

2015-12-29 Thread Niphlod
is the new db already filled or not ? if so, delete all .table files, set migrate=True and fake_migrate_all=True, hit appadmin one time, then set migrate=False and remove fake_migrate_all. On Tuesday, December 29, 2015 at 11:14:27 AM UTC+1, javit...@gmail.com wrote: > > Hi. > > web2py-2.6.3-sta

[web2py] Re: 'Table' object has no attribute '_notnulls'

2015-12-21 Thread Niphlod
guess it's experimental for a reason and funny, too :D raise an issue on pydal, so it gets tracked. On Monday, December 21, 2015 at 9:48:52 PM UTC+1, Francisco Costa wrote: > > > After upgrading to web2py 2.13.2 (previously on 2.12.3) I got the > following error: > > Traceback (most rece

[web2py] Re: Scheduler worker name

2015-12-21 Thread Niphlod
heduler tables in db > Set db string conection with fake_migrate_false=True > Run admin (create table files) > Remove fake_migrate_all and set migrate=True > Create again the scheduler > Run admin, tables are created in the db > > AND! Now scheduler works. > > Il giorno lu

[web2py] Re: SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Niphlod
:58 PM UTC+1, Tim Richardson wrote: > > > > On Tuesday, 22 December 2015 00:19:34 UTC+11, Niphlod wrote: >> >> this is more of a python installation issue rather than a web2py one >> > > yes, but here be very helpful people. Which you have just proved a

[web2py] Re: SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Niphlod
and probably due to https cert verification turned on https://www.python.org/dev/peps/pep-0476/ . Are you using a valid cert ? On Monday, December 21, 2015 at 2:19:34 PM UTC+1, Niphlod wrote: > > this is more of a python installation issue rather than a web2py one > &g

[web2py] Re: SSL error with CAS after upgrade to 32 bit python 2.7.10 on Windows (ActiveState python)

2015-12-21 Thread Niphlod
this is more of a python installation issue rather than a web2py one On Monday, December 21, 2015 at 12:57:00 PM UTC+1, Tim Richardson wrote: > > Upgrading from python 2.7.8 to 2.7.10 causes me these errors with using > CAS. This is with web2py 2.12.3 and 2.13.1 > On Windows Server 2008 R2.

[web2py] Re: Scheduler worker name

2015-12-21 Thread Niphlod
xport/import linux commands, pg_dump, psql. > > And for new applications scheduler runs. > > How can I make the debug of it? > > Thanks. > > > Il giorno domenica 20 dicembre 2015 13:51:45 UTC+1, Niphlod ha scritto: >> >> you just had to delete corresponding .tab

[web2py] Re: Scheduler worker name

2015-12-20 Thread Niphlod
... > > table files are created but not for scheduler tables > scheduler tables in postgress db are not created. > > Do you know why? > > Il giorno venerdì 18 dicembre 2015 15:48:06 UTC+1, Niphlod ha scritto: >> >> when you dropped tables, did you remember to delete the

[web2py] Re: Scheduler worker name

2015-12-18 Thread Niphlod
et = self.cursor.execute(command, *a[1:], **b) > ProgrammingError: relation "scheduler_task" does not exist > LINE 1: SELECT count(*) FROM "scheduler_task" WHERE ("scheduler_task... > > > > > Il giorno venerdì 18 dicembre 2015 11:58:15 UTC+1, Niphlod ha

[web2py] Re: Scheduler worker name

2015-12-18 Thread Niphlod
ete the scheduler.py file from models and all scheduler tables. > How can I do it? > > Il giorno venerdì 18 dicembre 2015 10:48:23 UTC+1, Niphlod ha scritto: >> >> >> >> On Friday, December 18, 2015 at 10:45:22 AM UTC+1, Gael Princivalle wrote: >>> >>

[web2py] Re: Scheduler worker name

2015-12-18 Thread Niphlod
I delete the scheduler? > delete what ? the istantiation ? > > Thanks, regards. > > Il giorno giovedì 17 dicembre 2015 21:40:36 UTC+1, Gael Princivalle ha > scritto: >> >> Thanks Niphlod. >> >> >So, here it is the breakdown of the possible issues: >&g

[web2py] Re: Can you have multiple plugins use Web2py Scheduler in the same App?

2015-12-17 Thread Niphlod
instantiate the scheduler in the App using : > > from gluon.scheduler import Scheduler > Scheduler(db,dict(A=taskA,B=taskB)) > > I get an error in the App Model 'TaskA is not defined' > > Thanks for your help. > > On Wednesday, December 16, 2015 at 3:00:15 PM UT

[web2py] Re: Scheduler worker name

2015-12-17 Thread Niphlod
I thought more people liked to see the code : I find myself explaining scheduler internals more often than I'd like to :P soo. worker names worker names are used to identify a worker process (it's enforced as unique in the model)... I'll reply to some ideal "FAQ" questions - Why

[web2py] Re: Can you have multiple plugins use Web2py Scheduler in the same App?

2015-12-16 Thread Niphlod
This is definitely weird. Unless you're plugins that carry themselves the instantiation of the Scheduler AND the definition of tasks: there should be only ONE scheduler instance (because it's thought as a singleton) and tasks definitions should be available on models so they'd be available

[web2py] Re: "Uploading and install packed application" works, but running database administration fails

2015-12-16 Thread Niphlod
not every model can be safely applied to an empty database. What - probably - happened is that you had at some point in development - state a - state b --> migrations were triggered - state c Now, with an empty database, you're trying to recreate state c, but the model doesn't know about the "st

[web2py] Re: The Almighty Form

2015-12-16 Thread Niphlod
you're doing it wrong. "fields" is a tuple containing - usually - id, label, controls and help. On Wednesday, December 16, 2015 at 3:14:02 PM UTC+1, Alfonso Serra wrote: > > Ive found a workaround but the question still remains. Why cant we define > formstyles like the example above? > > the

[web2py] Re: Ordering a dropdown in SQLFORM alphabetically

2015-12-16 Thread Niphlod
a proper IS_IN_DB with the correct orderby in models should be the easiest way to go. On Wednesday, December 16, 2015 at 8:33:06 PM UTC+1, Evan Caldwell wrote: > > > I am having a hard time ordering a dropdown in a SQLFORM alphabetically. > > In my model: > db.define_table('departments', > Fi

[web2py] Re: new feature - fabfile - please check it

2015-12-15 Thread Niphlod
erived from some work done by > niphlod some time ago. > Do you can setup a new server follows (requires pip install fabric): > > cd web2py > > fab -H root@host create_user:newuser # create a new user, setup ssh > keys, give sudo permissions > > fab -H newuser@host

[web2py] Re: SSL certificates for three different domains/apps

2015-12-15 Thread Niphlod
or one stanza with a cert covering all 3 domains. On Tuesday, December 15, 2015 at 3:15:42 PM UTC+1, Niphlod wrote: > > you'd have to have 3 stanzas each one with its own cert. > > On Monday, December 14, 2015 at 1:19:28 PM UTC+1, dirman wrote: >> >> I have three a

[web2py] Re: SSL certificates for three different domains/apps

2015-12-15 Thread Niphlod
you'd have to have 3 stanzas each one with its own cert. On Monday, December 14, 2015 at 1:19:28 PM UTC+1, dirman wrote: > > I have three apps with their own domain. Am running web2py-nginx on ubuntu > 12.04.how and where do i configure SSL for the three different domains -- Resources: - http:

[web2py] Re: tag parsing problem

2015-12-15 Thread Niphlod
seems related to https://github.com/web2py/web2py/issues/1074 On Tuesday, December 15, 2015 at 12:23:26 PM UTC+1, Manuele wrote: > > Hi *, > just try this easy example I found in code comments of html.py: > > In [3]: a=TAG('helloworld') > In [4]: a.elements("#1") > Out[4]: [] > > now just define a

[web2py] Re: Accessing / connecting to web2py database with GUI

2015-12-10 Thread Niphlod
if you're using sqlite, by default the file is stored under the databases/ directory of your app. On Thursday, December 10, 2015 at 11:41:27 AM UTC+1, Sam Heather wrote: > > Hi there, > Is it possible to access the Web2Py database remotely using a GUI tool? > Web2Py doesn't seem to use the norm

[web2py] Re: Many connections to one db

2015-12-03 Thread Niphlod
no, you can't . every DAL connection needs to have defined the tables you need to interact with. On Thursday, December 3, 2015 at 11:24:07 PM UTC+1, Piotr Róż wrote: > > Hello everyone, > > I'm developing an application where I need to separate rest api functions > from other standard www appli

[web2py] Re: FEATURE REQUEST: Case Insensitive Field types

2015-12-02 Thread Niphlod
There's no such thing in several backends. That being said, I don't see the issue using requires=IS_UPPER() or requires=IS_LOWER() On Wednesday, December 2, 2015 at 8:59:49 AM UTC+1, Encompass solutions wrote: > > I am not sure this exists yet, but it would be nice to take a string field > (or

[web2py] Re: Install wkhtmltopdf in pythonanywhere

2015-12-01 Thread Niphlod
this is much more a question for pythonanywhere techs than web2py users . isn't it ? On Tuesday, December 1, 2015 at 10:24:08 AM UTC+1, Alessio Varalta wrote: > > Hi, I use pythonanywhere and have an application on it. This application > use wkhtmltopdf, but how can I install wkhtmltopdf. o

[web2py] Re: Query by date not date + time?

2015-11-28 Thread Niphlod
pydal has year, month, day, hour minutes. Anyway, for relational databases, doing a compare like that is asking them to calculate the date part for each "created_on" cell (everything on the "left side" shouldn't be a result of a function, that's database tuning 101) This because the database wou

[web2py] Re: view question

2015-11-26 Thread Niphlod
to make that, you should - row class md-6 (column on the left) - row class md 12 (1st box) - row class md 12 (2nd box) - row class md 12 (3rd box) - row class md-6 (column on the right) - row class md 12 (4th box) - row class md 12 (5th box) - row class md 12 (6th box) On

[web2py] Re: general error handling

2015-11-26 Thread Niphlod
please see the "Routes on error" section of the book On Thursday, November 26, 2015 at 8:28:03 AM UTC+1, Alex Glaros wrote: > > I'm not sure what potential users would see on PythonAnywhere. I think > when they click on the error link, a

[web2py] Re: managing project source

2015-11-25 Thread Niphlod
You're right, web2py **should** at some point provide pypi packages. Bonus points to niphlod being the first one who asked years ago :P For the time being, I really don't see the issue: either you want to help with web2py development OR you want to develop your app. In the former cas

[web2py] Re: database is locked

2015-11-24 Thread Niphlod
uhm. it stays locked no matter what ? sqlite locks the entire db when writing, so make sure your app is the only one accessing the db... On Tuesday, November 24, 2015 at 5:54:32 PM UTC+1, Pierre wrote: > > Hi everyone, > I tried to unlock with db.executesql('PRAGMA journal_mode=WAL')

[web2py] Re: Scheduler timing out even though the task completes

2015-11-24 Thread Niphlod
Myrtil wrote: > > We are looking good. THANKS!!! > > Had a lot of stuff printing to the console. Removed those print statements > and the task appears to be completing successfully now with no timeout > issues so far. Thanks a lot!!! > > > On Monday, November 23, 2015

Re: [web2py] RBAC and group of role management

2015-11-24 Thread Niphlod
t X" which could have also access to tool A and another set of > function at the same time... > > Thanks again > > Richard > > On Mon, Nov 23, 2015 at 5:06 PM, Niphlod > > wrote: > >> This has been reported before but it just triggers for the next level u

[web2py] Re: Scheduler error: Exception in thread Thread-1 and connection is closed

2015-11-24 Thread Niphlod
g = row.g, > h = row.h, > img_link = img_link, > upvote = random.randint(10, 1000), > downvote = random.randint(1, 5), > title = row.title, > title_detail

[web2py] Re: Scheduler error: Exception in thread Thread-1 and connection is closed

2015-11-23 Thread Niphlod
not to point fingers around, but can you try installing psycopg2 ? it'll override pg8000 that showed here and there some obscure bugs: pscopg2 is certainly more solid. If the same happens with psycopg2, can we see the actual function queued (or a function that replicates this behaviour) ? BTW:

[web2py] Re: How to add an hour to datetime field

2015-11-23 Thread Niphlod
ok, let's elaborate. db(db.person.id > 3).update(name='Ken') and db(db.person.id > 3).update(name=db.person.name+'Ken') are actually REALLY different (from the database perspective). The first passes a FIXED value to the database, which discards any value contained in the "name" column and repla

[web2py] Re: Scheduler, run code first of each month

2015-11-23 Thread Niphlod
On Monday, November 23, 2015 at 2:44:33 AM UTC+1, Jason Solack wrote: > > So i realized i could have the scheduler run once a day and have my code > verify it's the day i need the actual code to run. > Yep, it's probably the best idea given the current feature-set. I manage it with a "master t

[web2py] Re: Nginx Gateway Timeout

2015-11-23 Thread Niphlod
If the problem is on nginx side, you can raise the timeout value using uwsgi_read_timeout. That should be tuned accordingly to the "harakiri" parameter of uwsgi, which is by default 60 seconds. That being said, letting a request to occupy a "web resource" for MORE than 60 seconds, IMHO SCREAMS

Re: [web2py] RBAC and group of role management

2015-11-23 Thread Niphlod
This has been reported before but it just triggers for the next level up in the hierarchy (Group C that manages access to Group B that manages access to Group A). RBAC as is is a complete and finite tool to manage permission: it enforces (as many other things in web2py) sane defaults, levelling

[web2py] Re: how do debug my error if not using web browser?

2015-11-23 Thread Niphlod
if the error gets somehow logged by web2py, web2py.exe -D 0 is the way to go. But it doesn't suffice if you don't configure logging properly (see logging.conf ). If the error is instead trapped by web2py's execution environment (wh

[web2py] Re: Scheduler timing out even though the task completes

2015-11-23 Thread Niphlod
If you're really returning at the end (not near, the actual end) how many records were added, the very "returned" data would cause your task to be COMPLETED. If you're printing near the end, and then returning something, then the task TIMEOUTing is probably stuck trying to flush stdout/stderr b

[web2py] Re: Scheduler erroring when threading and trying to do database update.

2015-11-23 Thread Niphlod
without the complete code is hard to see where the exception may raise, but a serious question arises: why should you manage threads inside a scheduler-executed task ? At that level of abstraction, if you NEED to fine-tune code execution at that level, just use a normal web2py shell. Did you t

[web2py] Re: How to add an hour to datetime field

2015-11-20 Thread Niphlod
you're trying to tell the database to execute a piece of python code. What you should do is either craft a backend-specific query, OR fetch the "start" value, compute + timedelta(hours=1), update "start". On Friday, November 20, 2015 at 7:52:05 AM UTC+1, mfarees...@gmail.com wrote: > > I have a

[web2py] Re: Opportunities for deadlock in scheduler.py send_heartbeat?

2015-11-20 Thread Niphlod
.commit()* > *db.executesql("LOCK TABLE scheduler_worker;")* > # delete dead workers > > and haven't seen a recurrence yet. If this is the problem, maybe if the > first update touched *all* of the rows it would achieve the same thing, > in a more compatible way.

[web2py] Re: Small issue in DAL using ``

2015-11-19 Thread Niphlod
gt; Yes, I'm sure! > > I'm using a Master and Sub-table, the master table is created first, and > after the sub-table > > Em quarta-feira, 18 de novembro de 2015 18:12:46 UTC-2, Niphlod escreveu: >> >> are you sure that the referencED table exists before the

[web2py] Re: How to make a simpleLDAPObject accessible in an app ?

2015-11-18 Thread Niphlod
b2py's one) and append your queries to it. On Wednesday, November 18, 2015 at 9:20:34 PM UTC+1, Jonathan R wrote: > > Hi Niphlod, > I used your method but the downside is that I have a plain text password > stored in my application then, I'm not really aware how secure it

[web2py] Re: Small issue in DAL using ``

2015-11-18 Thread Niphlod
are you sure that the referencED table exists before the referencING one ? On Wednesday, November 18, 2015 at 5:01:03 PM UTC+1, Maxwell Morais wrote: > > Any suggestion? > > Em segunda-feira, 16 de novembro de 2015 18:31:07 UTC-2, Maxwell Morais > escreveu: >> >> Hi all! >> >> I'm trying to imple

[web2py] Re: How to make a simpleLDAPObject accessible in an app ?

2015-11-18 Thread Niphlod
you can't really serialize a connection. you can serialize the plain password and then create a new one, using the credentials the user gave you. On Wednesday, November 18, 2015 at 7:54:56 PM UTC+1, Jonathan R wrote: > > Hi, > I'm still working on an app connecting on a ldap server using the >

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Niphlod
BTW for uber-technical: every backend EXCEPT postgresql commits automatically when asked to alter the structure of the db (being it table creation or whatever else) implicitely. Also, web2py's commits "explicitely" for every "structure modification". On Tuesday, November 17, 2015 at 8:35:02 PM

[web2py] Re: Opportunities for deadlock in scheduler.py send_heartbeat?

2015-11-17 Thread Niphlod
how many workers you have and what heartbeat are you using ? it's no news that the scheduler_worker table is the most "congested" because it's where most of the IPC happens. That's why I should release a version that does IPC on redis, but alas, I didn't find the time yet to polish the code. B

[web2py] Re: How to cope with schema changes on Prod

2015-11-17 Thread Niphlod
there are actually two branches of the deal: - when dal migrations work out of the box - when they don't Assuming the usual "work on dev, push to QA, test QA, if everything is ok push to PROD" workflow, you'd catch "when they don't" on QA. when they work out of the box, is pretty damn easy: push

[web2py] Re: hello all and a minor typo

2015-11-16 Thread Niphlod
there is no facility to queue a task (or any a piece of code) only at the first request consistently. This doesn't mean that it isn't possible, just that there's not any easy machinery to do so. on top of my head: - queue the task just before launching web2py - queue the task every once in a whi

[web2py] Re: hello all and a minor typo

2015-11-15 Thread Niphlod
yes, it's a typo. Regarding the latter, the excerpt is To enable the scheduler you must instantiate the Scheduler class in a model. The recommended way to enable the scheduler to your app is to create a model file named scheduler.py and define your function there. After the functions, you can

[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-13 Thread Niphlod
n. Would you opposed to a scripts/azure/ subfolder? > > On Thursday, 12 November 2015 15:49:52 UTC-6, Niphlod wrote: >> >> +1 +1 +1 +1 >> this should go in web2pyslices.com (although the venv machinery is not >> strictly necessary, it's a "nice to have")

[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Niphlod
+1 +1 +1 +1 this should go in web2pyslices.com (although the venv machinery is not strictly necessary, it's a "nice to have") On Thursday, November 12, 2015 at 10:09:36 PM UTC+1, Nbush wrote: > > Hi all, > > just want to share web2py setup Azure Web Apps. > > Based on > https://azure.microsoft.

[web2py] Re: Indexes

2015-11-12 Thread Niphlod
It's backend's job to know if it's "better" to use the index or to proceed as normal. It's normally referred as "query optimizer stage". In SOME backends you can issue rather specific sql "hints" to "optimize yourself" (if you think you're smarter than your backend) the query, but being that sp

[web2py] Re: securing download function

2015-11-12 Thread Niphlod
what are you afraid of ? On Thursday, November 12, 2015 at 8:25:13 PM UTC+1, Mark Billion wrote: > > Im not sure if this is necessary/redundant, but here is my question: > > Is there any way to check permission for the download -- i.e., the client > associated with the file is checked and confir

[web2py] Re: scheduler problem: stressed worker stops working

2015-11-12 Thread Niphlod
scheduler is NOT meant for realtime operations (yep, I said it). You'd better off configuring a little script (bottle?!) ran with root and listening to another port. On Thursday, November 12, 2015 at 9:05:03 AM UTC+1, Manuele wrote: > > Hi! > I have developed a web application using web2py wit

[web2py] Re: Scheduler not reassigning task after restart

2015-11-11 Thread Niphlod
this is handled automatically by each and every worker every 5 cycles (with default heartbeat of 3 seconds, it's 15 seconds). You can "force" the job that is done every 5 cycles setting "PICK" as a status on the workers. That being said, if it doesn't add up in your environment you'd better tri

[web2py] Re: blocking all access but america

2015-11-11 Thread Niphlod
what you want to do is technically called geofencing. At the moment, there are no other ways to "locate" a user if not inspecting the remote ip address, so all "methods" you want to implement share the common "requirement" of a ip-->country mapping On Wednesday, November 11, 2015 at 7:02:07 AM

[web2py] Re: Field set the default value +1 on insert

2015-11-10 Thread Niphlod
if you want to have a number that strictly: - is incremental (no gaps, always sequential, etc) - the first two digits are the year I'd suggest to have a "last_tickets" table (year(int) , ticket_no(int)) holding the current ticket. then, you can use _before_insert callback on the "tickets"

Re: [web2py] Get Date and Time from db

2015-11-06 Thread Niphlod
BTW: a DATE field could accept a datetime passed to it but it will be always retrieved as DATE. a DATETIME field, on the other end, will be always retrieved as a DATETIME On Friday, November 6, 2015 at 4:24:39 PM UTC+1, Richard wrote: > > Can you show us you model definition? > > I guess you have

[web2py] Re: Scheduler - Worker node heartbeats stop randomly

2015-11-06 Thread Niphlod
workers "check in" every heartbeat seconds. You can enable all sorts of logs to trace the exact second they died. That being said, there's no way for a died process to check if it's alive. That's why EVERY "daemon" should be handled by each platform's "daemon" system (or a process specifically

[web2py] Re: Why won't web2py serve my .vcf file?

2015-11-05 Thread Niphlod
just tried, everything works fine. are you using the default webserver ? On Wednesday, November 4, 2015 at 9:58:14 PM UTC+1, tim spear wrote: > > I'm trying to let users download a .vcf file (vCard). > > I copied myfile.vcf to the static folder. When I try going to > www.myapp.com/static/myfile.v

[web2py] Re: test for integer in form

2015-11-02 Thread Niphlod
maybe try: theint = int(form.vars.role) except ValueError: ...not an int BTW: what does it mean "is_int_in_range may allow out of range integers" ? if it's an integer, it's an integer. if you need min and max values for some application/business logic, pass minimum and maximum parameters t

[web2py] Re: Should this work in Web2py

2015-11-02 Thread Niphlod
tetime.timedelta(days + pdays) >> ndate_row = >> db(db.stock_task.withhold_until_date>0).select().first() >> ndate = ndate_row.withhold_until_date >> db(db.stock_task.id == task).update(ndate=fdate) >> session.flash="New Task Added"

Re: [web2py] Re: Re-use user's login and password to bind with LDAP server

2015-10-30 Thread Niphlod
I'll try to explain in layman words web2py configured to use ldap authentication does a search (or multiple searches, but only for group-related things that can be disabled) and it uses python-ldap under the hood. You can pretty much copy the code from contrib to code your own search. The t

[web2py] Re: Scheduler Tasks show TICKER: error assigningt task (0) and task never start

2015-10-30 Thread Niphlod
what backend are you using ? On Friday, October 30, 2015 at 4:36:09 PM UTC+1, Boris Aramis Aguilar Rodríguez wrote: > > Hi > > I've just re-started my scheduler and suddenly it didn't worked, so i ran > it on a shell with debug and the following errors appeared: > > http://pastebin.com/M7sQE3sR

[web2py] Re: Re-use user's login and password to bind with LDAP server

2015-10-30 Thread Niphlod
On Friday, October 30, 2015 at 12:51:22 AM UTC+1, Jonathan Renon wrote: > > > It seems like the db_user table only stores the login but not the > password, How can I access those credentials ? > > uhm, let me think.. it's probably because you can't get the password out of LDAP :-P Ther

[web2py] Re: How to make a copy of db for unittest

2015-10-30 Thread Niphlod
do a backup of your one, then restore it with a different name (e.g., "test_database"), then BEFORE running the unittest check that your DAL connection string points to "test_database". On Friday, October 30, 2015 at 12:51:26 AM UTC+1, Maelle Taurand wrote: > > Hi, > thanks for response. > > I

[web2py] Re: web2py : Attribute Error with MySQL

2015-10-30 Thread Niphlod
setting migrate=False DISABLES all migration logic. It's working exactly as expected! On Friday, October 30, 2015 at 12:51:26 AM UTC+1, Maelle Taurand wrote: > > > Hi, > > I'm creating an application with web2py. The data storage is MySQL. > > In the db.py, I define a table : > > db.define_table(

Re: [web2py] Re: SQLform grid custom function for delete

2015-10-30 Thread Niphlod
is your "id" in the grid ? id it's not in the fields then it's not accessible On Friday, October 30, 2015 at 2:41:41 AM UTC+1, Yebach wrote: > > why am I getting an error AttributeError: 'Row' object has no attribute > 'id' > > when I try to set links = [lambda row: A('',_class='glyphicon

Re: [web2py] UWSGI - nginx and web2py - special chars bugged, not showing any data on requests.vars/post_vars

2015-10-30 Thread Niphlod
I seem to recall the exact same "problem" with a different title the question stays the same, though: you need to pack a minimal app PLUS a client to reproduce the issue -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sourc

[web2py] Re: sqlform.grid

2015-10-29 Thread Niphlod
Field('timestamp', 'datetime', default=request.now, update=request.now) is all you need to define to get what you're asking... On Thursday, October 29, 2015 at 4:58:21 PM UTC+1, Laurent Lc wrote: > > Hi, > > i'd like a very simple example please (i begin) : > could you tell me how to do for upda

[web2py] Re: Session problem

2015-10-29 Thread Niphlod
tent%3DHTMLemail%26utm_campaign%3DNewsletter%2Bdell%2527Azienda%2BAgricola%2BMompal%25C3%25A0%2B-%2B01%2B-%2BOfferta%2Bdel%2BMese%2B-%2BComposta%2Bdi%2BPesche&sa=D&sntz=1&usg=AFQjCNGg8taisMY185vGQHWqDMgBm00_mA> > > A crazy thing is that adding the same string to another applica

[web2py] Re: Session problem

2015-10-28 Thread Niphlod
halt. Given you "receiver controller" being def index(): session.testmycart = 1 return dict(s=session) Only two things can happen if no login is required: a) either a user is coming back to the site (and the session isn't yet expired) and he gets s = {'testmycart' : 1, 'previous_ses

[web2py] Re: Session problem

2015-10-28 Thread Niphlod
are you aware that recent version of web2py by default renew session every time a user logs in / logs out for security reasons ? On Wednesday, October 28, 2015 at 5:10:57 PM UTC+1, Gael Princivalle wrote: > > Hello all. > > I've got a strange problem with session. > I use PHPlist for mailing. > W

[web2py] Re: parse_as_rest - filter GET request with parameters rather than patterns

2015-10-27 Thread Niphlod
parse_as_rest works exclusively with args, not vars. On Tuesday, October 27, 2015 at 1:20:03 AM UTC+1, Mamisoa Andriantafika wrote: > > > Hi, > > Is it possible to GET an answer with a setup restfull service with > parse_as_rest with: > > /rest/table_name?id=1 > > > > that is equivalent to the w

[web2py] Re: SQLFORM.grid: trigger edit when clicking anywhere on the row itself

2015-10-27 Thread Niphlod
ave a user logged in the lack of _signature in the > querystring doesn't trigger an error even if you don't specify > 'user_signature=False' in the SQLFORM.grid() call. Learned something new :) > > Cheers, > Julian > > On Monday, October 26, 2015 at 4:02:4

[web2py] Re: web2py crashes when fetching url from the same server

2015-10-26 Thread Niphlod
posting the exception may help. On Monday, October 26, 2015 at 5:10:31 PM UTC+1, sa wrote: > > 2.12.3-stable+timestamp.2015.08.19.00.18.03 > (Running on Apache/2.4.7 (Ubuntu), Python 2.7.6) > > --- > > from gluon.tools imp

Re: [web2py] Fwd: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP

2015-10-26 Thread Niphlod
@ron: these are questions that rise kinda for nothing. first, it's a project for python 3.x , leveraging asyncio, that is not there in python 2.x (which web2py leverages). second, it's a SMTP server: running it inside a webserver (web2py) is silly. On Monday, October 26, 2015 at 2:09:07 PM UTC+1

[web2py] Re: Really can't use database reserved words?

2015-10-26 Thread Niphlod
BTW: Anthony's answer is the right one because with that you get the best of both worlds. Mind that you can also disable completely reserved words (check_reserved argument on the DAL connection) and be prepared to fireworks when you'll choose something your backend can't distinguish. Being a sa

[web2py] Re: string indices must be integers, not str

2015-10-26 Thread Niphlod
imho your "x" is a string rather than a dict. you need to parse that string to a dict if you want your code to run. On Monday, October 26, 2015 at 5:31:53 AM UTC+1, Alex Glaros wrote: > > feel dumb asking about this subject again but what is correct way to get > the individual value? > > here is

[web2py] Re: Should this work in Web2py

2015-10-26 Thread Niphlod
an update operation NEEDS an update() call. given the records you want to update are defined by a condition, namely db.table.column_1 == somevalue and the update on column_2 resulting in all those records equal to "somevalue_2", you need to write db(db.table.column_1 == somevalue).update(colum

[web2py] Re: Clean Bootstrap layout

2015-10-26 Thread Niphlod
wait. all I can read from this post is "can I have a clean bs3 layout *without web2py cruft* but *with web2py cruft* ?" What's the cruft and what's the bare essential ? On Saturday, October 24, 2015 at 8:27:17 AM UTC+2, pbreit wrote: > > I'm not sure what exactly I need in my template for Web2py

[web2py] Re: SQLFORM.grid: trigger edit when clicking anywhere on the row itself

2015-10-26 Thread Niphlod
the edit link isn't that hard to rebuild ... /edit/tablename/record_id On Saturday, October 24, 2015 at 1:02:31 PM UTC+2, Julian Sanchez wrote: > > Is there an easy way to trigger the same URL you get when pressing the > built-in 'edit' button of the SQLFORM.grid without having to show tha

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