[pylons-discuss] Colander schema node with the same value as another node?

2016-12-09 Thread Petr Blahos
Hi, is it possible to define a schema with a node that will have the same value as another node in the same Schema? Something along these lines: class Schema(colander.Schema): initial_amount = colander.SchemaNode(colander.Float()) current_amount = GetValueFrom(src="initial_amount")

Re: [pylons-discuss] pyramid_rpc, decorate xmlrpc method?

2016-04-06 Thread Petr Blahos
ator=my_decorator) > > In this way you can easily write decorators that only accept context, > request without having to worry about the signature / args of your callable. > > On Fri, Apr 1, 2016 at 6:08 AM, Petr Blahos <petrbla...@gmail.com> wrote: > >&g

[pylons-discuss] pyramid_rpc, decorate xmlrpc method?

2016-04-01 Thread Petr Blahos
Hi, I am using pyramid_rpc to define an xmlrpc api methods like this: @xmlrpc_method(endpoint='napi') def getiteminfo(request, wp, userid, item_type, pn): " the actual function " and I would like to wrap the methods with another decorator, in this case for measuring and debugging purposes.

Re: [pylons-discuss] Traversal and extra round trip to db

2015-08-28 Thread Petr Blahos
Hi Mehdi, traversing your resource tree does not necessarily mean running any queries. In your example, it wouldn't have to run any queries at all. Basically, it is there to bring you to the view and possibly gather some information on the way. For example (simplified and certainly not working):

[pylons-discuss] Re: CheckboxChoiceWidget - all checked by default

2015-06-17 Thread Petr Blahos
Hello, is it possible to make all the checkboxes in a CheckboxChoiceWidget checked by default? Sorry, I meant to say in colander + deform2. Thanks. Petr -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from this group and

[pylons-discuss] Re: CheckboxChoiceWidget - all checked by default

2015-06-17 Thread Petr Blahos
pallet)), ), default=[16, 17], ) On Wed, Jun 17, 2015 at 8:10 AM, Petr Blahos petrbla...@gmail.com wrote: Hello, is it possible to make all the checkboxes in a CheckboxChoiceWidget checked by default? Sorry, I meant to say in colander + deform2

[pylons-discuss] CheckboxChoiceWidget - all checked by default

2015-06-16 Thread Petr Blahos
Hello, is it possible to make all the checkboxes in a CheckboxChoiceWidget checked by default? Thanks, Petr -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from this group and stop receiving emails from it, send an email to

[pylons-discuss] pot-create mako extraction error

2015-04-09 Thread Petr Blahos
Hi everyone, this is the first time I am trying to use lingua's pot-create instead of setup.py extract_messages. First I want to mention, that if I put in the setup.cfg with the extract_messages/update_catalog/compile_catalog sections, the good old setup.py extract_messages works. With

Re: [pylons-discuss] pyramid mssql connection string

2014-10-02 Thread Petr Blahos
thnx pb, made it partially working, after initialize_MyApp_db which successfully created models table I still get error in browser Pyramid is having a problem using your SQL database Is there any exception show in your console where you run your pserve? another question: how to define

Re: [pylons-discuss] pyramid mssql connection string

2014-10-01 Thread Petr Blahos
Hi, I have 32bit python 2.7, 32 bit windows, pyodbc 3.0.6, and sqlalchemy 0.8, and my connection string is something like: mssql://username:password@hostname/dbname?driver=SQL Server Native Client 10.0;unicode_results=True where driver=... is the same text I found in the ODBC data source

Re: Beginner Question: How to use a ${variable} in a Mako File in request.route_url()

2013-07-09 Thread Petr Blahos
So far in my project.py i added the routing: config.add_route('normalView', '/view/{id}') config.add_route('updatedView', '/view/{id}') Hi Michael, this is not going to work, you expect your matching pattern /view/{id} to be mapped to 2 different route names. Pyramid will always

Re: Should ✔ be truthy?

2013-04-17 Thread Petr Blahos
Recently I was setting up configuration for a new project and was trying to do the obvious thing in my .ini: pyramid.reload_templates = ✔ pyramid.debug_authorization = ✖ pyramid.debug_notfound = ✖ pyramid.debug_routematch = ✖ pyramid.debug_templates = ✔ To my surprise, the checkmark did

Re: only running specific unit tests ?

2013-01-23 Thread Petr Blahos
Perhaps you could use nose Attrib plugin? https://nose.readthedocs.org/en/latest/plugins/attrib.html (I haven't got down to it yet, but I want to use it for a similar purpose). -- Petr On Thu, Jan 24, 2013 at 2:00 AM, Jonathan Vanasco jonat...@findmeon.comwrote: i should add... originally

Re: Instaneous compilation of less, coffee, running tests

2012-11-05 Thread Petr Blahos
On 4 November 2012 20:29, Petr Blahos petrbla...@gmail.com wrote: What he does there, he basically has a file watcher and whenever his style changes, it is compiled with stylus, whenever his coffee script changes, it gets translated to js, whenever his js changes, tests are run. You

Instaneous compilation of less, coffee, running tests

2012-11-04 Thread Petr Blahos
Hi all, I have seen a very nice thing in the js framework este ( https://github.com/Steida/este). What he does there, he basically has a file watcher and whenever his style changes, it is compiled with stylus, whenever his coffee script changes, it gets translated to js, whenever his js changes,

Re: How to change paths to static assets in .css files?

2012-01-05 Thread Petr Blahos
I'm working on a pylons project, and we have users trying to host the web-app under a non-root path (i.e. host it at '/myapp/' rather than at '/'). We've been pretty good about using 'h.url_for' to generate links in our jinja2 templates, so most things work as expected. However, our CSS file

Re: are there still pylons eggs available?

2011-08-08 Thread Petr Blahos
I'm trying to install Pylons using easy_install, but the installation egg does not seem to be available. bash-4.2$ ./easy_install Pylons=1.0 Searching for Pylons=1.0 Reading http://pypi.python.org/simple/Pylons/ Reading http://www.pylonshq.com/ Download error: [Errno 110] Connection timed

Setting session.cookie_expires to timedelta?

2010-10-14 Thread Petr Blahos
Hi all, I would like to set session.cookie_expires to timedelta. It seems to me that it cannot be done in the .ini file. Is that so? In that case, what would be the best way to do it? Setting the value in config/environment.py: load_environment? Thanks in advance. -- Petr -- You received this

Re: @validate and request params

2010-06-17 Thread Petr Blahos
So first, why does @validate change the request method? Is it to help the error middleware? It's so that if the other method that displays the form has a REST decorator requiring a GET to show the form, it can still actually be run. Not an ideal solution at all of course. What I did in

Re: @validate and request params

2010-06-04 Thread Petr Blahos
First of all, I would like to know, whether my idea that request.params should be there is correct. You called it with ?par1=xxx, so c.par1 should be xxx and that should be the default value in the text box.; In 'save' decorated with @validate, you'd get the processed variables from