[web2py] MySQL cache issues

2020-04-15 Thread Joel Samuelsson
Got help earlier with keeping my database connections alive between requests: https://groups.google.com/forum/#!topic/web2py/QraWtFvlqf8 I put my databases in a module like this: class Databases(): _td_db = None @staticmethod def getTDDB(): dbCreated = False if Databases._td_db

[web2py] Re: Keeping objects between requests

2020-04-07 Thread Joel Samuelsson
Thanks, this works. Is that how people usually do to keep db connections alive? Den tisdag 7 april 2020 kl. 12:30:54 UTC+2 skrev Val K: > > Ups, sorry current is thread local and renew per request, use regular > mudule -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: Keeping objects between requests

2020-04-07 Thread Joel Samuelsson
Did this in the top of a controller: from gluon import current try: if current.ts_db is not None: Databases.setTSDB(current.ts_db) except AttributeError: current.ts_db = Databases.setTSDB() Databases is a model and setTSDB looks liks this: @staticmethod def setTSDB(db = None): if db is N

[web2py] Keeping objects between requests

2020-04-05 Thread Joel Samuelsson
I'm using cassandra as a database with web2py and would like to keep the cassandra session between requests to reduce session recreation and lower latencies. Is this a bad idea? And how would I do it? Any tips appriciated! -- Resources: - http://web2py.com - http://web2py.com/book (Documentatio

[web2py] Re: SQL warning

2019-05-17 Thread Joel Samuelsson
gt; > On Thursday, May 16, 2019 at 2:26:21 AM UTC-7, Joel Samuelsson wrote: >> >> It is not my table but something builtin I'm guessing. I have no column >> with name registration_id. >> > > That name sounds like it is from Auth (auth_user, probably). Please

[web2py] Re: SQL warning

2019-05-16 Thread Joel Samuelsson
It is not my table but something builtin I'm guessing. I have no column with name registration_id. Den onsdag 15 maj 2019 kl. 18:31:10 UTC+2 skrev Dave S: > > > > On Wednesday, May 15, 2019 at 5:59:06 AM UTC-7, Joel Samuelsson wrote: >> >> Hi, >> >> I&

[web2py] SQL warning

2019-05-15 Thread Joel Samuelsson
Hi, I'm running web2py in a docker container to run some tests against a fresh database. I get this warning that I'd like to get rid of: /var/www/DataCollectionManager/web2py/gluon/dal.py:1961: Warning: Incorrect integer value: '' for column 'registration_id' at row 1 ret = self.cursor.execute(

Re: [web2py] Re: [web2py:38056] Re: How the 'auth.settings.allow_basic_login = True' works like?

2016-07-05 Thread Joel Couelier
Thanks Massimo for your update. Kr, Joel On 05/07/2016 15:37, Massimo Di Pierro wrote: Your code works for me when using curl "http://jcouelier <http://jcouelier/>%40gmail.com <http://40gmail.com/>:@domain:port/URL" but now when using the browser. So I think the b

[web2py] Re: [web2py:38056] Re: How the 'auth.settings.allow_basic_login = True' works like?

2016-07-04 Thread Joel Couelier
Hello Massimo, Just a quick question, have you got the confirmation if sending user + password directly in the URL is working on basic auth mode? I have added the following on my controller : if request.function == 'ping': auth.settings.allow_basic_login = True @auth.requires_login() def

[web2py] Re: JSON / XML / other as response when raising HTTP error to restful request

2016-06-28 Thread Joel Samuelsson
4 PM UTC+2, Marlysson Silva wrote: >> >> The web2py would use generic views depending of extension of url. >> Is it? >> >> Em terça-feira, 28 de junho de 2016 11:31:48 UTC-3, Joel Samuelsson >> escreveu: >>> >>> Hi, >>> >>> I&#

[web2py] JSON / XML / other as response when raising HTTP error to restful request

2016-06-28 Thread Joel Samuelsson
Hi, I'd like to respond with a complex data structure when raising a HTTP 409 Conflict as response to a restful request but I can't seem to figure out how. If possible, I'd like to reuse as much as possible from built-in functions in web2py. The best idea I've gotten so far is something like t

[web2py] Insert ignored when using time

2016-03-19 Thread Joel Samuelsson
Hi, I have a table like this: db.define_table('speed', Field('speed', 'integer'), Field('startTime', 'time'), Field('stopTime', 'time'), migrate=False, fake_migrate=True ) The database is a MySQL db. speed is of type int, startTime is of type time, stopTime is of type time, The table was created

[web2py] Migration of java/tomcat backend

2015-09-30 Thread Joel McGraw
grating to web2py (other platforms are on the list, but I'm most productive with Python and like what I've seen of web2py). My question: I will probably have to migrate the API in pieces. Does anyone have experience running a Tomcat/Java application and web2py side-by-side? Any caveats?

[web2py] SQLFORM.factory fails to save to database, id is null

2014-09-24 Thread Andy Joel
I have a very simple form processing page in my controller: def new(): form = SQLFORM.factory( Field('f_name', label='Your name', requires=IS_NOT_EMPTY()), ) if form.process().accepted: db.table.insert(**form.vars) response.flash = 'form accepted' elif f

[web2py] Update with a string as the key

2014-09-24 Thread Andy Joel
I want a method to update the database record behind a model, and I thought something like this might work. class MyModel: def db_update(self, field_name, value): self.db(self.db.t_empire.id==self.record.id).update(field_name=value) Apparently not. The field_name cannot be a string.

[web2py] Problem to run Java applet on web2py server

2014-02-28 Thread Joel Couelier
" My concern is that the aplug.jar is not a jar file i have created but a dlink jar file. So, is there any possibility to web2py to use "external" jar file not located on /static folder but located on codeBase location? Any answer or advice will be greatly appreciated. T

Re: [web2py] Re: beginner questions about REST

2013-11-22 Thread Joel Samuelsson
Is this in the stable version yet? I am having the same issue and updating to the latest stable doesn't help. If not, is there a small fix I can use in the meantime? Best regards, Joel Samuelsson Den onsdagen den 18:e september 2013 kl. 14:56:50 UTC+2 skrev Dimid Korovev: > > Ti

[web2py] Re: serious memdb issue

2013-11-15 Thread Joel Rathgaber
We do use MEMDB with the memcache client for sessions. Do you know when this bug was introduced? We are still running 2.5.1 in production, but were looking to upgrade soon. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: serious memdb issue

2013-11-14 Thread Joel Rathgaber
Does this only apply to GAE use? We use memcache for sessions but not GAE. Thanks, --Joel. On Wednesday, November 13, 2013 6:19:14 PM UTC-6, Massimo Di Pierro wrote: > > A serious issue has been reported on web2y-developers. The issue has to do > with the memdb module. You are using

[web2py] Re: Using MEMDB with Scheduler

2013-11-14 Thread Joel Rathgaber
That's too bad. Is there a reason for it, or just haven't found any use for it yet? On Wednesday, November 13, 2013 10:49:43 AM UTC-6, Niphlod wrote: > > nice shot, but scheduler isn't supported in MEMDB. > > On Wednesday, November 13, 2013 6:25:40 AM UTC+1, Joel

[web2py] Using MEMDB with Scheduler

2013-11-13 Thread Joel Rathgaber
che.memcache = gluon.contrib.memcache.MemcacheClient( request,memcache_servers ) current.cache = cache db = MEMDB(cache.memcache) from gluon.scheduler import Scheduler scheduler = Scheduler(db) Thanks in advance. Cheers, --Joel. -- Resources: - http://web2py.com - http://web2py.com

[web2py] Re: response cookie handling in 2.6

2013-09-19 Thread Joel Rathgaber
Submitted as #1685 On Thursday, September 19, 2013 12:47:09 PM UTC-6, Massimo Di Pierro wrote: > > Please open a ticket about this. > > > On Thursday, 19 September 2013 13:07:38 UTC-5, Joel Rathgaber wrote: >> >> We are putting things in the session, so it shouldn'

[web2py] Re: response cookie handling in 2.6

2013-09-19 Thread Joel Rathgaber
n the globals.py and could not see any place that the cookies were assigned in the response object (as there was in the 2.5 version of globals.py). Thanks! --Joel. On Thursday, September 19, 2013 10:39:56 AM UTC-6, Massimo Di Pierro wrote: > > If the session is empty it is not saved. I

[web2py] response cookie handling in 2.6

2013-09-19 Thread Joel Rathgaber
Hey all, I've noticed that in the 2.5 and prior releases that the session id cookie was sent back to the client in every response, and it seems like in 2.6 it doesn't do this anymore. Is this by design? If so, what's the reasoning? Thanks! --Joel. -- Resources: - http://we

[web2py] Re: Subfolders in models

2013-09-17 Thread Joel Samuelsson
In version 2.6.3, sort=False is still there. Unsure if the way it's supposed to be used has changed. Got the same bug as before when I updated. Den fredagen den 14:e december 2012 kl. 09:39:24 UTC+1 skrev Joel Samuelsson: > > Glad to help! You do excellent work. Thanks! > > De

[web2py] MemoryError using sqlite

2013-07-10 Thread Joel Samuelsson
the blob into memory shouldn't be a problem. Are there any other limits on memory usage I need to be aware of? Best regards, Joel Samuelsson -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and sto

[web2py] Update view from Scheduler?

2013-06-02 Thread Joel McGraw
Web2py noob here: I have a long-running Scheduler task that is updating a record-count. The record count is displayed in a view. How would one update the view when the Scheduler updates the record count? -- --- You received this message because you are subscribed to the Google Groups "web2py-

[web2py] How can I use options.py with tornado anyserver?

2013-05-14 Thread Joel Kim
Hi, How can I use options.py with tornado anyserver? My options.py configuration uses both of http:80 and https:443 at the same time. options.py ip = '0.0.0.0' port = 80 interfaces = [('0.0.0.0', 80), ('0.0.0.0', 443, 'server.key', 'server.crt')]

[web2py] Pickling web2py object

2013-01-11 Thread Joel Samuelsson
Hi, I am using one of my web2py models outside of web2py, in a script intended to be run from command line. I am importing the models of web2py (to get access to my database definitions and other models) using this code-snippet: def _importWeb2py(): rundir = os.getcwd() WEB2PY_PATH = rund

[web2py] Re: hide_password seems to hide only the username

2013-01-11 Thread Joel Samuelsson
Using version 2.3.2 (stable) by the way. Den fredagen den 11:e januari 2013 kl. 10:59:24 UTC+1 skrev Joel Samuelsson: > > Not sure if this is the right place to submit a "bug report" but here it > goes: > > If you print a DAL object (using a MySQL adapter, at least) the

[web2py] hide_password seems to hide only the username

2013-01-11 Thread Joel Samuelsson
Not sure if this is the right place to submit a "bug report" but here it goes: If you print a DAL object (using a MySQL adapter, at least) the username is hidden but the password is still visible. To me it looks like the regexp is at fault (gluon/dal.py): REGEX_PASSWORD = re.compile('\://([^:@]

[web2py] Re: Subfolders in models

2012-12-14 Thread Joel Samuelsson
Glad to help! You do excellent work. Thanks! Den tisdagen den 11:e december 2012 kl. 15:25:21 UTC+1 skrev Massimo Di Pierro: > > How did that get in there? Fixed in trunk. Thanks Joel for reporting this. > > On Tuesday, 11 December 2012 02:51:15 UTC-6, Joel Samuelsson wrote: >&g

[web2py] Re: Subfolders in models

2012-12-11 Thread Joel Samuelsson
you describe is true. With sort=False though, sort order is not alphabetical and what you describe does not work since you can't know in what order models are run. /Joel Den måndagen den 10:e december 2012 kl. 17:10:43 UTC+1 skrev Anthony: > > I've been testing the way you desc

[web2py] Re: Subfolders in models

2012-12-10 Thread Joel Samuelsson
ging web2py? I am aware that just setting sort to true in the listdir-call will fix my issue but I would like to be able to update web2py without having to make that change each time, if possible. Best regards, Joel Den fredagen den 23:e november 2012 kl. 05:28:22 UTC+1 skrev Anthony: > &

[web2py] Re: Multiple like clauses

2012-12-06 Thread Joel Samuelsson
uld use the SQL "in" syntax (web2py calls it "belongs") which does take a > list or even a subquery as its argument. > > -- Joe B. > > On Monday, November 26, 2012 3:58:29 AM UTC-8, Joel Samuelsson wrote: >> >> I have a function which takes a list of

[web2py] Multiple like clauses

2012-11-26 Thread Joel Samuelsson
startswith function ( db.mytable.myfield.contains('value')) I get an error. Is there any way I can get similar behaviour to contains but with startswith without moding web2py? Best regards, Joel --

[web2py] Subfolders in models

2012-11-22 Thread Joel Samuelsson
that, I haven't been able to find any mention if the fix (mentioned in last message in above thread) was ever implemented. Can I somehow get subfolders in my models catalogue to be executed without moding compileapp myself? Best regards, Joel --

[web2py] Re: modified_by and modified_on not updating

2012-09-12 Thread Joel Carrier
I was calling auth.define_tables() after defining auth_user manually. My mistake. On Saturday, September 8, 2012 1:56:37 PM UTC-4, Joel Carrier wrote: > > Hmmm... i never call auth.define_tables I guess because I wanted to > customize the auth_user table. > And yet the following ta

[web2py] Re: modified_by and modified_on not updating

2012-09-08 Thread Joel Carrier
Good eye Niphlod! On Saturday, September 8, 2012 1:59:11 PM UTC-4, Joel Carrier wrote: > > > Ha, as soon as I pasted this snippet I realized that and was looking to > modify. > When developing I was working off the trunk and having this problem. > For some reason I thought may

[web2py] Re: modified_by and modified_on not updating

2012-09-08 Thread Joel Carrier
ompatible. > Someone here is: > - posting the wrong code > - use the wrong web2py version > - telling lies :P > > @Joel: jokes apart, can you please verify ? > > On Saturday, September 8, 2012 7:48:14 PM UTC+2, Massimo Di Pierro wrote: >> >> Supposed to work any upd

[web2py] Re: modified_by and modified_on not updating

2012-09-08 Thread Joel Carrier
+'xxx')) > >>> auth.enable_record_versioning(db) > >>> print db.thing(2).modified_on > 2012-09-08 09:22:28 > >>> db.thing(2).update_record(name='test4') > >>> print db.thing(2).modified_on > 2012-09-08 12:49:01 > > Massimo >

[web2py] Re: modified_by and modified_on not updating

2012-09-08 Thread Joel Carrier
uth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQ

[web2py] modified_by and modified_on not updating

2012-09-08 Thread Joel Carrier
I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the hist

[web2py] Re: web2py on appfog

2012-07-30 Thread Joel Carrier
L > 6.2, 3.1GHz quad-core Xeon, 8GB RAM, Apache with mod_wsgi) completed 3061 > requests with a mean 0.490 seconds per request. Beefier than what AppFog > gave me? Sure, but not enough to explain handling 22x the requests, with > 1/22nd the response time. > > * The AppFog mean request fulfillment numbers varied by as much as two > seconds over the several times I ran the tests. That sort of > unpredictability worries me. > > > > On Thursday, July 26, 2012 9:50:01 PM UTC-4, Joel Carrier wrote: >> >> Has anyone tried running web2py on appfog ( www.appfog.com ) and cares >> to comment on their experience? > > --

[web2py] web2py on appfog

2012-07-26 Thread Joel Carrier
Has anyone tried running web2py on appfog ( www.appfog.com ) and cares to comment on their experience? --

[web2py] Re: Audit for all tables, independent of CRUD; and transaction rollback.

2012-07-03 Thread Joel Carrier
Hi Nick Name, Did you ever find a solution that met all your requirements? What you've described is exactly what I am facing now. Joel On Friday, May 6, 2011 6:18:49 PM UTC-4, nick name wrote: > > My use of web2py requires an audit trail for (essentially) all database &g

[web2py] Re: web2py book now free in PDF

2012-06-26 Thread Joel Kim
Great! Thank you. On Tuesday, June 12, 2012 10:17:46 PM UTC+9, Massimo Di Pierro wrote: > > The official web2py book is now free for everybody: > > https://dl.dropbox.com/u/18065445/web2py/web2py_manual_4th.1.pdf > > Massimo > --

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thank you so much for your reply. That took care of everything. Thank you very much for the tips. I know the code is very rough. I had just started on it when I ran into this problem, and I'm still fairly new to web2py and python. Thanks again for your help. Joel Robinson On Thu

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
in case no rows are found? Also, you can instead do: > > row = db(db.invent.partnum == request.vars.partnum).select().first() > if row: > etc. > > .first() returns the first row or None if there are no records. > > Anthony > > On Thursday, June 7, 2012 10:49:54 AM UT

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
=LAMP-4 I will get the correct web page, but when I change a value and hit the submit button I just get sent to a page that says "None". If I reload the page the values are unchanged. Nothing was updated. Joel Robinson On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote: > &

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thanks for the reply. I tried your sugestion but am still getting an error, though a different one: Traceback (most recent call last): File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in restricted exec ccode in environment File "/home/joel/Source/web2

[web2py] web2py: crud interface and query strings

2012-06-06 Thread Joel Robinson
ecord = crud.update(db.invent, row.id) return dict(record=record) initialy it would work fine it would run the query and pull up the correct record but if I tried to update the record I would get the folling error: Traceback (most recent call last): File "/home/joel/Source/we

[web2py] Re: web2py 1.99.5 is OUT

2012-03-01 Thread Joel Kim
Same here. Is it a bug? On Friday, March 2, 2012 10:49:57 AM UTC+9, tomt wrote: > > Hi, > > I just installed 1.99.5. Clicking on the database administration > button doesn't bring up the usual database administration form. > Instead it brings up http://127.0.0.1:8000/admin/default/site. (The

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-20 Thread Joel Clay
d--in my opinion. I think this should seriously be considered. All being said, I will continue to use my trashcan icon until a respectable change has been made. On Sat, Nov 20, 2010 at 8:49 AM, Branko Vukelic wrote: > On Sat, Nov 20, 2010 at 1:58 PM, Joel Clay wrote: > > What? R

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-20 Thread Joel Clay
> > > "* The 'redness' of the X icon would fall into the 5th category, but > there is no good solution, so it's a wontfix, again. Proposed solution > all break 6 or are similar to the current solution." > What? Really. I've seen quite a number of good solutions run through this topic. Obviously mo

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-20 Thread Joel Clay
On Sat, Nov 20, 2010 at 3:16 AM, Branko Vukelic wrote: > On Sat, Nov 20, 2010 at 9:45 AM, annet wrote: > > I like the new admin interface, however, I had t re-open an older > > version of web2py to figure out the meaning of the black and yellow > > circle (test, my first association was 'beware

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-19 Thread Joel Clay
, 9:06 pm, Joel Clay wrote: > > How about we turn the red X into a checkbox (think Gmail) You check the > box > > and at the top there are links to perform actions (in this case delete). > In > > my opinion, this kills two birds with one stone -- it increases ease of > &g

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-19 Thread Joel Clay
It's not that there is a problem with the red X suggesting that it is to delete the file, it's just all of those red X's in a line on the page seem to be overwhelming. Most of us associate red with negative. I'd like to suggest another fix: How about we turn the red X into a checkbox (think Gmail

Re: [web2py] Re: New Admin Design: Suggested Improvement

2010-11-19 Thread Joel Clay
Glad you guys liked the idea, for those interested, here is the icon i used. http://drise.servehttp.com/Uploads/images/delete_icon.png Joel. On Fri, Nov 19, 2010 at 1:43 PM, Branko Vukelic wrote: > 2010/11/19 António Ramos : > > Let me say that the admin page is nice but as a L

[web2py:15915] Re: New web2py homepage breaks on wider font

2009-02-05 Thread Joel Merrick
On Thu, Feb 5, 2009 at 4:01 PM, Markus Gritsch wrote: > Hi, > > I have configured my Firefix to use Verdana to render pages. The new > style of the web2py homepage breaks with this wider font. See > attachments. Is that not just breaking the CSS that's already applied? > > > Kind regards,

[web2py:15562] Re: Web2py manual

2009-01-28 Thread Joel Merrick
not resized to a standard size but it still prints out very nicely > for me. > > -tim > > Joel Merrick wrote: > > Yea, I was thinking along those lines, but wondered if it was some > > kind of flag within the PDF itself (for the crop marks) > > > > The r

[web2py:15260] Re: network access to web2py

2009-01-22 Thread Joel Merrick
Presumably web2py is only listening on 127.0.0.1, hence it will only serve pages requested from your localhost I'm certain there's an option to listen on other IP's (can't remember of the top of my head), alternatively you could put a reverse proxy in front of it. On Thu, Jan 22, 2009 at 1:53 PM

[web2py:15009] Re: Web2py manual

2009-01-15 Thread Joel Merrick
nt it > > out. > > > > Unfortunately there's printer crop marks on all the pages.. is there > > any way to remove them do you know and scale the pages to A4? > > > > t.i.a. > > Joel > > > > > > > -- > Timothy Farrell > Computer

[web2py:14889] Re: Call for Volunteers to come help rebuild Sahana

2009-01-13 Thread Joel Merrick
teers, tracking camps effectively between > Government groups, the civil society (NGOs) and the victims > themselves. > http://sahana.lk/overview > What an awesome and worth cause! I'll help out in any way that I can! Joel -- $ echo "kpfmAdpoofdufevq/dp/vl

[web2py:14254] Re: sorting my date

2008-12-29 Thread Joel
itory > > or > > orderby=~db.territory_event.date.month() > > etc. > > Massimo > > On Dec 28, 9:50 pm, Joel wrote: > > > i'm doing something like this: > > > events = db(db.territory_event.territory==territory.id).select > > (db.territory_e

[web2py:14230] sorting my date

2008-12-28 Thread Joel
i'm doing something like this: events = db(db.territory_event.territory==territory.id).select (db.territory_event.ALL,orderby='-date') db.territory_event.date is of type 'date' for some reason, it seems like 2020-01-28 is greater than 2008-12-28 but 2008-12-29 is not greater than 2008-12-28

[web2py:13878] Re: #irc

2008-12-19 Thread Joel Merrick
irc.freenode.net #web2py none of this web based pointy clicky stuff ;) On Fri, Dec 19, 2008 at 11:45 AM, mmstud wrote: > > By the way, have you thought to open / join irc channel for web2py > discussion? #web2py dozens of small questions could be easily and fast > answered there, what do you th

[web2py:12719] Re: web2py book in PDF at $12.50

2008-12-01 Thread Joel Merrick
Really enjoying the book, but I feel the printer crop marks are really annoying. Is there any way to remove them? -- $ echo "kpfmAdpoofdufevq/dp/vl" | perl -pe 's/(.)/chr(ord($1)-1)/ge' --~--~-~--~~~---~--~~ You received this message because you are subscribed t