[web2py] Re: scheduler gives and error about datetime

2020-06-29 Thread Pierre
. At this time i scheduled manualy the task via the admin interface to do tests, so i can follow the stage, queued, running, etc. thanks Le mercredi 24 juin 2020 23:01:27 UTC-4, Dave S a écrit : > > > > On Wednesday, June 17, 2020 at 6:41:32 AM UTC-7, Pierre wrote: >> >> Goo

Re: [web2py] scheduler gives and error about datetime

2020-06-23 Thread Pierre
n Tue, 23 Jun 2020 at 12:15, Pierre > > wrote: > >> thanks AG I will look into your suggestion. >> Fiddling with the error, found out that it's when reading back from >> sqlite that the error arise. It's like something from web2py doesn't like >&

Re: [web2py] scheduler gives and error about datetime

2020-06-22 Thread Pierre
ons/11875770/how-to-overcome-datetime-datetime-not-json-serializable > > > > > On Wed, 17 Jun 2020 at 23:41, Pierre > > wrote: > >> Gooday, >> In the controler the function works correctly. But as a task, it gives >> an error about Json not beeing able

[web2py] scheduler gives and error about datetime

2020-06-17 Thread Pierre
Gooday, In the controler the function works correctly. But as a task, it gives an error about Json not beeing able to deal with datetime. any suggestion would be appreciated :) here is the error : TypeError: datetime.datetime(2020, 6, 16, 5, 17, 49) is not JSON serializable here is the code:

[web2py] gevent and web2py

2018-03-01 Thread Pierre
Hi, Can I use* gevent* to build a homemade redis task queue and to execute these tasks? Does it make sense ? sorry if this is naiv questions i'm new to async programming... http://web2py.com/books/default/chapter/29/08/emails-and-sms?search=homemade from

[web2py] Re: web2py.scheduler.hpxyz#2791 - ERROR - we received a task that isn't there (15)

2018-02-27 Thread Pierre
I did the change at line 732 and the error continues to show up (immediate=True). Besides there is another problem i forgot to mention earlier : the scheduler_task and scheduler_run tables are not updated properly. what i do is run a python script using the requests and threading module to

[web2py] Re: web2py.scheduler.hpxyz#2791 - ERROR - we received a task that isn't there (15)

2018-02-26 Thread Pierre
yes correct *immediate=False* and errors are gone. setting heartbeat=1 instead of default and errors are back. I would not say lot's of workers since i can hardly run more than 3 workers5 workers == computer crash. i will learn how to walk on eggs, it can be useful... --

[web2py] Re: web2py.scheduler.hpxyz#2791 - ERROR - we received a task that isn't there (15)

2018-02-23 Thread Pierre
it's worst than i thought: i increased tasks volume(100) with 3 up to 5 workers and now i get lot's of : *we received a task that isn't ther*e errors and a couple of *dead tasks *( queued forever ). bad bad bad i'll check if *python-rq* can help with this and if it can't i am done with

[web2py] Re: controller with multiprocessing powers. Howto?

2018-02-22 Thread Pierre
i think the entry point to do multiprocessing in web2py is the web2py-scheduler. Howewer with this tool you can't share objects betweeen processes like you do using the multiprocessing python module so synchronization might be an issue. There are other tools like for instance* huey* but i am

[web2py] web2py.scheduler.hpxyz#2791 - ERROR - we received a task that isn't there (15)

2018-02-20 Thread Pierre
Hi, i get the above error from time to time running 3 redis-scheduler processes while results look consistent. Is this a serious error or some kind of a fake alert ? does it mean something ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] where to issue Redis transactions ?

2018-01-31 Thread Pierre
Hi, my app requires to execute *redis transactions* using redis-py's *pipeline* functionality: http://redis-py.readthedocs.io/en/latest/ with rconn.pipeline() as transaction: transaction.mset. transaction.mget. ... result = transaction.execute() where should i run

[web2py] Re: Rendering rows using represent and joint

2018-01-29 Thread Pierre
"a separate select for *each* record" hum guuulllp that's not very "cool" and i've read joint ops are expensive too... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: DAL with postgresql regexp_matches function

2018-01-29 Thread Pierre
pure magic thanks Anthony if i was a dentist i'd use regexp as well... -- 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

[web2py] Rendering rows using represent and joint

2018-01-29 Thread Pierre
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Rendering-rows-using-represent does* rows.render() *involve tables *joint operations* in the background ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] DAL with postgresql regexp_matches function

2018-01-29 Thread Pierre
hello everyone, Is it possible to integrate a postgresql* regexp_matches* to a dal expression query ? raw SQL working example: query = "SELECT tabla.id, tabla.name, regexp_matches(tabla.longstr, '%s', 'g') FROM tabla WHERE (tabla.longstr ~ '%s');" %(regexp,regexp) -- Resources: -

[web2py] scheduler_task.uuid

2017-12-23 Thread Pierre
just curious about the presence of both* scheduler_task.id* and *scheduler_task.uuid* ? what's the latter purpose ? is it a better task reference than id ? is it something related to dealing with more than one database ? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] task time consumption

2017-12-05 Thread Pierre
Hi, the *scheduler_run_table* automatically stores* run_result* (task returned value). I want to do the same with *task duration*(time taken to complete), and store it somewhere possibly in the *run_output* field. is there an easy way to do this ? -- Resources: - http://web2py.com -

[web2py] scheduler processes synchronization

2017-12-01 Thread Pierre
Hi, well, i already pulled off my hairs so i'm late.. here is the situation: i have 3 sched process that can execute the same task function (diffrerent params) in parallel: task function is like that: def task(params): try: call module.functionA call module.functionB

[web2py] Re: How can i use incremental addition to add altogether the values using computing fields method

2017-11-27 Thread Pierre
it's better to leave aggregate values (sum,avg etc) outside the marks table as every record should reflect an atomic information ( a mark). When you need to aggregate the atoms do it in a controlller-function and pass results to a view for display -- Resources: - http://web2py.com -

[web2py] Re: How can i use incremental addition to add altogether the values using computing fields method

2017-11-27 Thread Pierre
here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum--avg--min--max-and-len and don't be too severe with your students... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: threading Lock

2017-11-21 Thread Pierre
well, i am not very religious but i think i'll have to pray anyway or throw everything to the 'fire' as a disaster prevention policy.just kidding let's be optimistic and believe in something..i like matplotlib but i prefer visual python: it is capable to

[web2py] Re: threading Lock

2017-11-20 Thread Pierre
from recent forum threads elements i assume the following 'macro-situation': (0) python libraries selected for a project should be thread-safe (1) user uses python libaries at his own risk (there 's no mean to verify it's thread-safe) (2) in order to minimize risks user should put a lock

[web2py] Re: threading Lock

2017-11-17 Thread Pierre
No this won't work..I don't know how to instantiate a lock that will act as a global variable. this is an enigma. tried to read this: http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html but it's too smart for me.what i want is '*a lock for humans*'like

[web2py] Re: Web2py and machine learning - scikit-learn

2017-11-17 Thread Pierre
found this related to locking : https://redis.io/topics/distlock topic is very hermetic so if someone successfully implemented a lock in the production context of a web application i would really appreciate he shares his esoteric knowledge with us: 'the ignorants' -- Resources: -

[web2py] Re: list:string field length

2017-11-17 Thread Pierre
if this is what you want, you can control | limit the length of a list:string field using a custom validator. this is documented in the book. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Web2py and machine learning - scikit-learn

2017-11-15 Thread Pierre
Is there a reliable way to determine whether or not a library is thread-safe ? what's the web2py method for locking ?(module: thread/threading ? what kind of lock with what option: blocking/non-blocking) ?) thanks -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: digitally signed urls

2017-11-12 Thread Pierre
finally i backtracked to decorate everything along the 'chain'. It looks safer and i am concerned with security thanks again -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: request.ajax

2017-11-12 Thread Pierre
perfect now works !!! :) -- 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] Re: forward auth.user record

2017-11-03 Thread Pierre
goodthanks Massimo I'll try that soon and if the server doesn't respond i'll beat it... -- 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

[web2py] Re: updating to 2.15.4 from 2.9.11, is it possible ?

2017-11-02 Thread Pierre
Le lundi 30 octobre 2017 11:14:32 UTC-4, Pierre a écrit : > > Good day, > > current environment : python 2.7.6.1 and web2py 2.9.11 > updating to : python 2.7.6.1 and web2py 2.15.4 > > Does the older version of python could be creatin

[web2py] Re: updating to 2.15.4 from 2.9.11, is it possible ?

2017-11-02 Thread Pierre
Problem not realy identified, but the source is in the "auth" requirement starting reference in line 51 of db. It seems to inhibit the migration process, and i'm always getting a pickle ticket. My solution for the moment: - emptied the folder "database" - run the application and let all

[web2py] forward auth.user record

2017-11-01 Thread Pierre
hello everyone, I have a decorated action | controller (@auth.requires_login()) making an ajax call to perform another action. Some time ago I realized that user session might expire while the ajax is being processed so if ajax secondary action does something like : *user = auth.user_id* and

[web2py] updating to 2.15.4 from 2.9.11, is it possible ?

2017-10-30 Thread Pierre
Good day, current environment : python 2.7.6.1 and web2py 2.9.11 updating to : python 2.7.6.1 and web2py 2.15.4 Does the older version of python could be creating the following error : "Value error : insecure string pickle" Here is the traceback. Traceback

[web2py] cache.redis differs from cache.ram

2017-10-27 Thread Pierre
here book description from http://web2py.com/books/default/chapter/29/04/the-core#cache : Note, time_expire is used to compare the current time with the time the requested object was last saved in the cache. It does not affect future requests. This enables time_expire to be set dynamically when

[web2py] Re: component rebuild via anchor helper

2017-10-07 Thread Pierre
Yes there are a couple of options to solve this (indeed a minor problem) (1) jquery POST (2) jquery LOAD (3) axios.post for the purists i am not storing anything into the session. I picked up (2) and after some 'gymnastics' I got a solid result. -- Resources: - http://web2py.com -

[web2py] component rebuild via anchor helper

2017-10-02 Thread Pierre
hello all, I am using the A helper as described in the book to reconstruct a page component when user presses a button: {{=A('linked page', _href=URL('func', vars={'a':a, 'b':b}), cid='myid')}} query string I pass can be quite long so I'd like a POST request instead of a GET. Is this

Re: [web2py] form replacing elements

2017-09-29 Thread Pierre
well,don't think for too long.that's very unproductive -- 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

Re: [web2py] form replacing elements

2017-09-29 Thread Pierre
well,don't think for too long.that's very unproductive -- 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

Re: [web2py] form replacing elements

2017-09-28 Thread Pierre
worked !! thanks Dave. what's next we should try ? Le mercredi 27 septembre 2017 03:26:56 UTC+2, Dave S a écrit : > > > > On Tuesday, September 26, 2017 at 2:58:02 PM UTC-7, Pierre wrote: >> >> I tried to tame a raccoon and it didn't work. :( >> &g

[web2py] form replacing elements

2017-09-22 Thread Pierre
Hi everyone, trying to replace a list:string form data attribute (data-fuu) value am doing the following: form = SQLFORM(db.listfoo, record=rec, fields=['foo'], showid=False) for i,fe in enumerate(form.elements('input.string')): fe['_data-fuu'] = form.record.fuu[i]

[web2py] Re: caching variable data sample

2017-09-19 Thread Pierre
thanks Anthony... looks like the cache select puzzle is now complete. : ) however we still have a 'serious productivity lag here in Bangladesh'... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: caching variable data sample

2017-09-18 Thread Pierre
I'd prefer the module option but I need to pass *time_expire* as a variable (*db.table.__variableName*), I don't think I can do that in a module can I ? On Friday, September 15, 2017 at 6:15:44 AM UTC-4, Pierre wrote: >> >> actually the real function is a little more complex sinc

[web2py] Re: caching variable data sample

2017-09-15 Thread Pierre
the more digging the deeper one gets : https://groups.google.com/forum/?fromgroups#!searchin/web2py/cache$20in$20module/web2py/AZa5Boj3y3E/_BPMTdXwSaMJ and here is the *cache_this* module version : from gluon.cache import lazy_cache @lazy_cache('data_sample', time_expire=60,

[web2py] Re: caching variable data sample

2017-09-15 Thread Pierre
very True: productivity rules and I am far below modern standards(more or less the 'Bangladesh level'):) Le jeudi 14 septembre 2017 16:55:29 UTC+2, Anthony a écrit : > > > Maybe you should have asked a week ago. ;-) > > Anthony > -- Resources: - http://web2py.com -

[web2py] Re: caching variable data sample

2017-09-15 Thread Pierre
actually the real function is a little more complex since it returns rows plus other datas that don't require caching. I tried to move the cache_this function to a module (don't know if this is orthodox) but then i get a decorator error: @current.cache('data_sample', time_expire=60,

[web2py] Re: caching variable data sample

2017-09-14 Thread Pierre
the cache select mechanism is full of mystery: given book example code: def cache_db_select(): logs = db().select(db.log.ALL, cache=(cache.ram, 60)) return dict(logs=logs) what happens to next cache_db_select call after the 60 seconds has elapsed ? Does it overwrite the previously

[web2py] caching variable data sample

2017-09-13 Thread Pierre
purpose is to keep a single renewable pseudo-random data sample live the w2p books describes a situation of a constant query : http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=caching+selects#Caching-selects def cache_db_select(): logs =

[web2py] Re: sql tablesample

2017-09-09 Thread Pierre
got it 9.3 == wrong postgreSQL version. Tablesample is available since ver 9.5 now let's have some 'fun' in 'Guantanamo' :)( -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] sql tablesample

2017-09-09 Thread Pierre
hello everyone, I need to cache a data sample extracted from a large table at regular time intervals but due to poor performance I don't want to use : db().select(db.table_name.ALL, orderby='', limit=) and the posgreSQL TABLESAMPLE functionality doesn't seem to work: code: def rowsampl(): q

[web2py] Re: to XML() or to JSON.parse() ?

2017-07-31 Thread Pierre
thanks Anthony I'll use ASSIGNJS. I'd never heard of this helper.too bad it's unpublished in the book -- 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

[web2py] Re: to XML() or to JSON.parse() ?

2017-07-28 Thread Pierre
Yes I want to execute a view here is the example code: Controller: from json import dumps as jdumps def abtest(): alist = ["it's ok","I'm late"] return dict(stra='abcd', obj=jdumps(alist)) View: {{extend 'layout.html'}} Ceci est le modèle test/abtest.html RESULT var o=

[web2py] to XML() or to JSON.parse() ?

2017-07-28 Thread Pierre
Hi everyone, I'd prefer JSON.parse() but in most case i have to fall back on XML() for example given a list alist= ["it's ok","I'm late"] If an AJAX function returns something of the form: return json.dumps(dict(alist=alist, astring='abcd')) then JSON.parse() can cope with it

[web2py] Re: Testing error

2017-07-28 Thread Pierre
looks like the ajax target function is faulty. perhaps it tries to reload web2py.js. Or the ajax call might be wrong (the error message says it wants asynchronous and you give it synchronous call). who's the boss ? :) -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: trigger some js code on successful login

2017-07-07 Thread Pierre
@Leonel : trying to do a *localforage records manager*.it uses 3 js libraries localforage, axios and sjcl ; it's not very complicated, basically a 3 levels promises chain that encrypts, decrypts , checks data integrity and release data if everything ok @Anthony: here is the new

[web2py] trigger some js code on successful login

2017-07-06 Thread Pierre
can't find an easy way out of this so far i have : auth.settings.login_next = URL('controller','dosomething') but this works only with direct login via top navbar button, not when login occurs via decorated controller function : @auth.requires_login() def func(): pass -- Resources:

[web2py] Re: Any ideas on how to prepare web2py apps for GDPR

2017-07-06 Thread Pierre
for cryptographists and "bunker" amateurs : http://bitwiseshiftleft.github.io/sjcl/ -- 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

[web2py] Re: change login page layout

2017-07-06 Thread Pierre
very useful thanks !! *will also use request.env.path_info to conditionally load js files*I had forgotten *user.html*silly me( beating myself. ) *« Le désert croît… malheur à qui protège le désert ! » F.Nietzsche* -- Resources: - http://web2py.com -

[web2py] change login page layout

2017-07-05 Thread Pierre
Hi, how do i tell web2py to use *mylayout.html* instead of *layout.html* for *login* and other auth related pages ? -- 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

[web2py] user logout before ajax returns

2017-06-30 Thread Pierre
hi everyone, in the w2p book we are advised to user-signature ajax urls but what's happen if user logout and the ajax hasn't finished its job. Shall this be a special error case ? Also shall we pass *auth.user_id* in the ajax request params to make sure task is performed eventhough user

[web2py] Re: fluctuating session data storage

2017-06-10 Thread Pierre
Hello Dave, yes the data should also be stored to the db. What i am trying to achieve is load data on successful login so as to keep it available for session duration. Now I load it using the *localForage.js* so it goes somewhere in localStorage | indexDB | WebSQL. it's complicated because

[web2py] fluctuating session data storage

2017-06-09 Thread Pierre
Hi, Is it ok to store a small fluctuating* (lot's of updates while user is logged-in)* chunk of data into the session or assume db storage is best ? what's more efficient in terms of data accessibility, read-write speed, given sessions would use cookie-storage) ? -- Resources: -

Re: [web2py] auth.navbar modification

2017-06-07 Thread Pierre
this expression in layout.html works for me combined with the login_next in db.py {{='auth' in globals() and auth.navbar(mode='dropdown', referrer_actions=['register', 'request_reset_password','retrieve_username']) or ''}} -- Resources: - http://web2py.com

Re: [web2py] auth.navbar modification

2017-06-07 Thread Pierre
sorry I deleted the initial post this was caused by a bogue in my code still what's the* referrer_actions complete list* I should subtract actions from. Actions I am aware of are :login, register ,request_reset_password, retrieve_username. Any other actions I should know ? -- Resources: -

[web2py] auth.navbar modification

2017-06-05 Thread Pierre
Hi I am trying to redirect user after successful login. I do nothing but what the book says but i am unable to change default behaviour here is the code : in db.py : auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = False

[web2py] user data, html5 sessionStorage, session

2017-06-02 Thread Pierre
Hi, I'd like to dump a small set of user specific data on login (to keep this data "alive" during user session) but am not sure about the container ? should it be the session ( i also would like to store sessions in cookies), html5 sessionStorage, cache to disk..or perhaps this is a bad

[web2py] Re: Future of web2py

2017-05-31 Thread Pierre
weppy the web framework for humans sounds good ? frigolux the refrigerator for polar bears -- 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

[web2py] Re: not web2py related but this is free now

2017-05-31 Thread Pierre
nice book Massimo, I'll be studying it during the next holidays. A more severe future might arise quickly so better be cautious. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Pierre
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data what i 'd do is backup the data rewrite a clean relational model with new tablenames and foreign key constraints then restore data.. -- Resources: - http://web2py.com -

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Pierre
> > drop the table in question and save your db.py file again. It should > recreate the table with a new name > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#drop -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] SQLFORM form-horizontal changing default columns width

2017-05-15 Thread Pierre
Hi, i don't use any formstyle. I looked at the *sqlhtml.py* to try to figure out what formstyle function is used by default ? so i can clone it with modifications i need: just replace the *col-sm-3* with *col-sm-2* and the *col-sm-9* with *col-sm-10* i know this can be done 'ex-post' with

[web2py] Re: Any easy way to prevent left_sidebar from scrolling down?

2017-05-15 Thread Pierre
i don't know your css classes maybe switching to bootstrap* col-xs-** classes will prevent overlapping. otherwise you might find a solution using css media-queries -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Any easy way to prevent left_sidebar from scrolling down?

2017-05-15 Thread Pierre
this might help: https://www.w3schools.com/bootstrap/bootstrap_affix.asp howewer i am not sure this is very responsive-design compatible. It might become hazardeous as viewport is shrinked -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: recurring events from one form

2017-05-14 Thread Pierre
apologies as there might be issues with the callback function (recurrent calls...) here a better receipt based on SQLFACTORY: (1) in your controller create a list a fields like this : repeats = Field('repeats', 'integer', ..add your validators here) fields = [repeats , db.evento.titolo,

[web2py] Re: recurring events from one form

2017-05-13 Thread Pierre
here is the "anonymous guru": http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update write a callback function that performs after the first record(event) insert and repeats it as many times as necessary (number of repeats in

[web2py] Re: Web2py Postgresql Groupby issue

2017-05-13 Thread Pierre
here: http://web2py.com/books/default/search/29?search=groupby s = db.table.field_a | db.table.field_b groupby s *always obey the computer.* :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Html helper module?

2017-05-07 Thread Pierre
I just repeated what's written in the web2py book : For example a model could do auth = Auth(db) from gluon import current current.auth = auth current.db = db #not needed in this case but useful and now all modules imported can access current.auth. current and import create a powerful

[web2py] Re: Html helper module?

2017-05-05 Thread Pierre
one way to access T from a module : in db.py: from gluon import current current.T=T in module: T=current.T -- 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

[web2py] Re: dal

2017-04-29 Thread Pierre
you would have to add a new constraint at the database level like this: query="ALTER TABLE %s ADD CONSTRAINT %s UNIQUE (amcno,unitid);" %(tablename,constraintname) result=db.executesql(query) here a postgresql example to set the new constraint in a controller: def

[web2py] Re: btw: great job

2017-04-28 Thread Pierre
welcome aboard !!! this is not your captain speaking.we shall take off in a few minutes. *do not fasten your seat belts and stop smoking* -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: sql COUNT function and DAL

2017-04-28 Thread Pierre
Marlysson : just in case, from now on i keep this one under my pillow :)) https://media.readthedocs.org/pdf/pydal/stable/pydal.pdf -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: sql COUNT function and DAL

2017-04-28 Thread Pierre
wonderful !! and I can even cache it to prevent waste thanks Anthony -- 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

[web2py] sql COUNT function and DAL

2017-04-27 Thread Pierre
Hi, Is there a way to transform this sql into a valid DAL expression ? "SELECT csp, COUNT(csp)AS freq FROM table GROUP BY csp ORDER BY COUNT(csp) DESC LIMIT %s OFFSET %s;" %(limit,offset) I want to avoid executesql as much as i can.. -- Resources: - http://web2py.com -

[web2py] Re: conditional block insert

2017-04-24 Thread Pierre
found the bogue.a nasty supernumerary {{pass}} in the sidebar.html thank you guys for your patience and perseverence... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] conditional block insert

2017-04-24 Thread Pierre
hello everyone, {{block left_sidebar}} {{if auth.has_membership('manager'):}} {{include 'manager_sidebar.html'}} {{else:}} {{include 'sidebar.html'}} {{pass}} {{end}} for some reason this doesn't work. It inserts a mixture of the two sidebars. If i move blocks inside of the if same

[web2py] Re: Making application looks better.

2017-04-14 Thread Pierre
learn the basics of css and the bootstrap grid system and components. As for sidebars, there are powerful tools like -change column ordering- (a sidebar is just a bootstrap column contained in a row) https://www.w3schools.com/bootstrap/bootstrap_grid_examples.asp -- Resources: -

[web2py] cache.redis in module

2017-03-27 Thread Pierre
Hi everyone, I have a *cache.redis* defined in a db.py file like so: from gluon.contrib.redis_utils import RConn from gluon.contrib.redis_cache import RedisCache rconn = RConn('localhost', 6379) cache.redis = RedisCache(redis_conn=rconn, debug=True) now i'd like to perform caching in a

[web2py] Re: text field input control

2017-02-25 Thread Pierre
thanks for confirmation Massimo we shouldn't clean so much as is bad for the ecosystem. -- 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

[web2py] Re: missing field in search tab, using smartgrid

2017-02-23 Thread Pierre
abstraction-layer#Field-types > . > > Anthony > > On Thursday, February 23, 2017 at 8:27:36 AM UTC-5, Pierre wrote: >> >> Any hint on why only one field is missing in the search drop down >> smartgrid ? >> Is there a way to find a "special" attribu

[web2py] text field input control

2017-02-23 Thread Pierre
Hi everyone, is it useful to clean a form textarea prior to db.insert ? I am asking this because of *bleach* : https://bleach.readthedocs.io/en/latest/clean.html I have read a recent post which says it's secure enough not to use the XML helper when displaying text content... can't figure

[web2py] missing field in search tab, using smartgrid

2017-02-23 Thread Pierre
Any hint on why only one field is missing in the search drop down smartgrid ? Is there a way to find a "special" attribute about a field that would prevent it to be visible in the drop down list ? ps: I can search on this field (writing the query manualy ) What I've tried so farwithout results

[web2py] Re: reference_field_value = None

2017-02-10 Thread Pierre
thanks guys for sure a minor problem :) i am afraid the most difficult is comingan "iceberg" or something equivalent -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] reference_field_value = None

2017-02-10 Thread Pierre
Hello everyone, I noticed by accident i can insert a record with reference_field_value=None. Is this the desired behavior ? I thought this would trigger an exception especially when NOTNULL=True but None is not considered NULL ? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] validate_and_insert in task

2017-01-18 Thread Pierre
Hi, i am trying to validate_and_insert a record containing a *unique *constraint field in a task( to avoid task failure in case of duplicate). But still when this occurs (duplicate) task continues to fail (a typeERROR exception is raised). When used in a controller validate_and_insert doesn't

[web2py] Re: model define_table select

2017-01-12 Thread Pierre Corbeil
Good day Luca/Massimo, Can you show me the final code ..i'am trying to do exactly that. (unsure of what you have done exactly in db.py) Thanks Le lundi 28 mars 2016 05:51:33 UTC-4, lucas a écrit : > > yes massimo, > > that almost worked. as suggested, i first changed it under the db.py

[web2py] Re: Made with web2py

2017-01-06 Thread Pierre
nice design and interesting concept too may I ask where do you host it ? i visited *bback.me* this morning and now access is refused...I'll be back -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] IS_IN_SET or IS_IN_DB to create a sublist based on part of a table

2017-01-05 Thread Pierre Corbeil
Trying to migrate my old access environment to web2py. I have imported all data, can be viewed ok. Trying to get a dropdown list (when using smargrid) that is a subset of a table. been trying for while now, maybe someone can give me a hint. Here is the tables : # db.define_table('famille' ,

[web2py] Re: dynamic form component

2016-12-28 Thread Pierre
this is a view that should allow users to send messages (submit form/messages...and not to reload the actual page) trying this from Anthony: https://groups.google.com/forum/?fromgroups#!searchin/web2py/dynamic$20component/web2py/-_xH0vnfr7I/J05mFfPvW9cJ form component loads well onclicked

[web2py] dynamic form component

2016-12-28 Thread Pierre
Hi, I have a set of buttons displayed in a view. I'd like each button to pass different args to the form component (prepopulate some of the form fields). I can probably achieve this via some tricky js/jquery but is there a better option like loading the component when necessary with the

[web2py] Re: table cells truncation

2016-12-21 Thread Pierre
thanks Anthony my tables look better now. there was a big mistake in my css. almost everything is in order :) -- 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

[web2py] Re: table cells truncation

2016-12-20 Thread Pierre
I mean a HTML whose code lies in a view "as opposed to" a sqltable: my code looks like this: {{def truncstr(s,n,dots):}} .truncate function.. {{pass}} {{extend layout.html}} .header... etc... -- Resources: - http://web2py.com -

  1   2   3   4   >