Re: [web2py] Installation of an editor plugin in web2py app

2014-12-15 Thread Ramashish Gaurav
Thanks all the way Andrew. This was the perfect solution to my problem, for which I wasted a day. One more thing, if you wish to, please give me some info about XSS attack, how can we ignorantly get caught in it and measures taken to prevent XSS attacks. On Tuesday, December 16, 2014 1:20:20

[web2py] Re: removing items from cache not working

2014-12-15 Thread Anthony
How about: cache.ram.clear(regex=r'admin\.setting.*') Anthony On Monday, December 15, 2014 6:22:38 PM UTC-5, Alex wrote: > > I've got a function which returns a dict with some values. the function > has this decorator: > > @cache('admin.setting.limits', 3600, cache.ram) > > def get_limits(): >

[web2py] Re: removing items from cache not working

2014-12-15 Thread Alex
the regex should be fine (I tested it with a regex online tool). Doesn't make a difference if I use your regex. Thanks for your help, I can fix the problem by clearing the exact values. But I'd like to understand what's wrong with clearing the cache by regex. On Tuesday, December 16, 2014 1:3

[web2py] Re: removing items from cache not working

2014-12-15 Thread Derek
Your regex is wrong then. try this? admin\.setting\.[A-z]* On Monday, December 15, 2014 5:22:40 PM UTC-7, Alex wrote: > > tested with clearing values with exact key and this seems to work. Do you > know why using the regex doesn't work? > > > Alex > -- Resources: - http://web2py.com - http:/

[web2py] Re: Hyphen in application name

2014-12-15 Thread Derek
well, according to the documentation it should work, so perhaps you encountered a bug. Just a question, where did you put your routes.py? if in the application, then you can only route controllers and functions. On Monday, December 15, 2014 3:42:53 AM UTC-7, tim.n...@conted.ox.ac.uk wrote: >

[web2py] Re: removing items from cache not working

2014-12-15 Thread Alex
tested with clearing values with exact key and this seems to work. Do you know why using the regex doesn't work? Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Rep

[web2py] Re: removing items from cache not working

2014-12-15 Thread Alex
because I have multiple values cached in different functions and all can be edited on the same page. I'll test to delete it with the exact key. Anything wrong with the regex? On Tuesday, December 16, 2014 12:58:38 AM UTC+1, Derek wrote: > > Why are you not just clearing the exact key? > > cache.

Re: [web2py] Re: Domain model and web2py DAL

2014-12-15 Thread Derek
I suppose it depends on what you mean by this " application logic completely independent from persistent data storage" So you certainly can have that completely independent, though you wouldn't persist anything. Is the idea that you'd update a memory representation of objects only, and somehow y

[web2py] Re: removing items from cache not working

2014-12-15 Thread Derek
Why are you not just clearing the exact key? cache.ram('admin.setting.limits',None) On Monday, December 15, 2014 4:22:38 PM UTC-7, Alex wrote: > > I've got a function which returns a dict with some values. the function > has this decorator: > > @cache('admin.setting.limits', 3600, cache.ram) > >

Re: [web2py] Re: Component with argument example

2014-12-15 Thread clara
Anthony, I think I found the problem. In page 405 of the book's 5th edition it says: "*Because of the way grid works one can only have one grid per* *controller function, unless they are embedded as components via* *LOAD. To make the default search grid work in more than one* *LOADed grid, please

[web2py] removing items from cache not working

2014-12-15 Thread Alex
I've got a function which returns a dict with some values. the function has this decorator: @cache('admin.setting.limits', 3600, cache.ram) def get_limits(): .. This works fine and the values are used from cache. When I change those settings I want to clear the cache so I'm doing this: cac

[web2py] Re: Domain model and web2py DAL

2014-12-15 Thread Leonel Câmara
Well the DAL already implements the data mapper pattern. The memory representation are the tables defined in the models, the persistent representation can be anything really, you could make your own adapter. As for the "Domain Model Pattern " an easy approximation is using methods and virtual

Re: [web2py] Re: Cheap trick to achieve intellisense/autocompletion

2014-12-15 Thread Alex
I'm using PyCharm Community Edition. I'm planning to upgrade to the Professional Edition (which has web2py support) once they got some annoying bugs fixed. At the moment I don't know how good the web2py support is, i.e. if it makes your db autocomplete script obsolete or not. On Monday, Decemb

[web2py] Re: Thread safety and importing db, response, session

2014-12-15 Thread Anthony
Yes, that should do it. Anthony On Monday, December 15, 2014 3:35:01 PM UTC-5, Mark Graves wrote: > > Thanks Anthony, > > I saw your web2py con talk at depaul and really appreciated your > understanding of the inner workings. > > Would best practice be to just import current then define db = cur

Re: [web2py] Re: Cheap trick to achieve intellisense/autocompletion

2014-12-15 Thread Andrew Buchan
Excellent, glad someone is using it. Thanks for the heads up on the typo, it's not the version I'm actually using which is why I'll have missed it. Fixed now. What IDE are you using btw? On Mon, Dec 15, 2014 at 8:41 PM, Alex wrote: > > thanks! seems to work fine so far. You've got a syntax error

[web2py] Re: Cheap trick to achieve intellisense/autocompletion

2014-12-15 Thread Alex
thanks! seems to work fine so far. You've got a syntax error in line 38: ', is missing at the end. Alex -- 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) --

Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-12-15 Thread Cynthia Butler
@Jim, Thank you very much! Just what I needed to learn what I was doing wrong. ( I was deleting the web2py .css and .js files) On Monday, December 15, 2014 6:48:51 AM UTC-7, Jim S wrote: > > Attached is my layout.html... > > -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Re: Thread safety and importing db, response, session

2014-12-15 Thread Mark Graves
Thanks Anthony, I saw your web2py con talk at depaul and really appreciated your understanding of the inner workings. Would best practice be to just import current then define db = current.db? That works correctly as long as it is not a top level variable correct? -Mark On Monday, December 15

Re: [web2py] Installation of an editor plugin in web2py app

2014-12-15 Thread Maboroshi
Hey there if I understand correctly you want to not display html but the formatted output. If so then use this in your view and add any html you would like to allow. {{=XML(row.textfromeditor, sanitize=True, permitted_tags=['a', 'b', 'blockquote', 'br', 'i', 'li',

Re: [web2py] Re: Web2py Debug Error

2014-12-15 Thread Mariano Reingart
Hi Shaun: There seems to be an issue with the latest changes in DAL (__all__ was removed from gluon.dal). To fix it, in /web2py/applications/admin/controllers/debug.py you should remove the last condition from line 75/76: and \ name not in gluon.dal.__dict__: Anyway, t

Re: [web2py] Re: Component with argument example

2014-12-15 Thread Clara Ferrando
Hello Anthony, Thanks for your patience :) Here is the code: *MODEL* db.define_table('t_owner', Field('f_name', type='string', label=T('Name')), Field('f_lastname', type='string', label=T('Lastname')),auth.signature, format='%(f_name)s', migrate=settings.migrate) db.define_tabl

[web2py] Re: Component with argument example

2014-12-15 Thread Anthony
Probably need to see the code. On Monday, December 15, 2014 12:36:16 PM UTC-5, clara wrote: > > Hello Anthony, > > It did work!!! Thanks ! > > Now, something does not work well when adding records into the grid > component: I restrict the "owner" so that the record should be appended to > the s

[web2py] Re: Component with argument example

2014-12-15 Thread clara
Hello Anthony, It did work!!! Thanks ! Now, something does not work well when adding records into the grid component: I restrict the "owner" so that the record should be appended to the same grid. Now I enter the record, it gets recorded successfully but the grid (in which I added the record)

[web2py] Re: ERR_CACHE_MISS while working with SQLFORM.factory()

2014-12-15 Thread Ramashish Gaurav
Thanks a lot for clarifying my doubts. You were indeed helpful. On Monday, December 15, 2014 9:02:45 PM UTC+5:30, Anthony wrote: > > Given your code, I would expect the browser warning after successful > submission whether or not it was preceded by an earlier form validation > error. > > Also, n

[web2py] SQLFORM.factory with upload field - the operation is insecure

2014-12-15 Thread Jim S
I've got an issue that is really puzzling me. I have a form, SQLFORM.factory with one field, an upload field. When I click on submit to submit the form (adding a new record), I get a javascript error that flashes by quickly in Firebug. All I can get from it is that the text says 'the operation

[web2py] Re: ERR_CACHE_MISS while working with SQLFORM.factory()

2014-12-15 Thread Anthony
Given your code, I would expect the browser warning after successful submission whether or not it was preceded by an earlier form validation error. Also, note that when you hit the back button, it is not a GET request -- rather, it is a repeat of the previous request (which in this case was a

[web2py] Re: Thread safety and importing db, response, session

2014-12-15 Thread Anthony
You can also just import current in the module and then refer to it directly within your function (i.e., no need to pass current as an argument to the function). Anthony On Sunday, December 14, 2014 11:07:48 PM UTC-5, Mark Graves wrote: > > Right, I knew it looked too easy. > > Thanks, Anthony

[web2py] Maximum size session variable

2014-12-15 Thread Richard D
Hi, We have strange behaviour (e.g. message: 'memory error') while using large (>1MB) session variables. Is there a limit to session variables? Thank you Richard -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:

[web2py] Re: Component with argument example

2014-12-15 Thread Anthony
The way you're doing it (with the adjustment I suggested) should work. Are you still having problems? Anthony On Monday, December 15, 2014 9:25:27 AM UTC-5, clara wrote: > > Hello Anthony, > > Thanks for your reply. I am trying to pass *itemid* to the component. How > do I do that? > > Basicall

Re: [web2py] Installation of an editor plugin in web2py app

2014-12-15 Thread Ramashish Gaurav
Dear Andrew, Many thanks for your response and elaborate explanation of installation of ck-editor. However I used another light weight editor nicEdit since the installation was pretty easy as directed at http://nicedit.com/ . However I am in a problem, not related to installation of editors, bu

[web2py] Re: Component with argument example

2014-12-15 Thread clara
Hello Anthony, Thanks for your reply. I am trying to pass *itemid* to the component. How do I do that? Basically imagine a model like> db.define_table('person', Field('firstname'), Field('lastname'), format='%(firstname)s %(lastname)s') db.define_table('dog',

[web2py] Re: ERR_CACHE_MISS while working with SQLFORM.factory()

2014-12-15 Thread Ramashish Gaurav
Dear Anthony, Thanks for your response. I am planning to implement your advice to redirect to the same form submission page, with a link for redirecting to other page after form submission. In case of an issue, I'll let you know. However one thing is still unclear to me. Yeh, you indeed figur

Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-12-15 Thread Jim Steil
Attached is my layout.html... On Sun, Dec 14, 2014 at 5:35 AM, wrote: > > > > > I also had overlay icons, in the auth navbar, as shown. To solve it I had > to edit gluon/to

[web2py] How to deal with legacy data types at Mysql

2014-12-15 Thread mcamel
I mean, you have to access a preexisting database with boolean stored as tinyints, datetime stored as unixtime and so on. You cannot change that. Focusing on booleans, how to make a simple form work? At Mysql Test Instance: CREATE TABLE table1 ( `id` int unsigned NOT NULL AUTO_INCREME

[web2py] Hyphen in application name

2014-12-15 Thread tim . nyborg
Does anyone know how to get map_hyphen to work with an application name? I have a routes.py setup as follows: routers = dict( BASE = dict( default_application = "home", default_controller = "default", default_function = "index", map_hyphen=True, ),