Re: Can't Obtain SQLAlchemy Objects From Cache Until After First Request

2010-06-24 Thread Paweł Stradomski
W liście Paweł Stradomski z dnia czwartek 24 czerwca 2010: > W liście dave z dnia czwartek 24 czerwca 2010: > > (...) > > > > We can make this problem go away one of two ways: 1) flush the cache > > (not desirable.) 2) Issue a request to the server that does not invoke

Re: Can't Obtain SQLAlchemy Objects From Cache Until After First Request

2010-06-24 Thread Paweł Stradomski
ys to force compiling mappers (I assume there is a function to do exactly that described somewhere in the docs). -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-disc..

Re: How do you signal the end of streaming content?

2010-04-21 Thread Paweł Stradomski
his is similar to how Apache/mpm_prefork keeps a pool of processes. So, with a pool of eg 10 threads (default for CherryPy) ten requests that start those long-running tasks would deplete the pool completely. Further requests would be queued until one of the workers finishes. -- Paweł Stradomski -- You r

Re: How do you signal the end of streaming content?

2010-04-21 Thread Paweł Stradomski
st launch another thread (or process, depending on server type) or use some messaging system to pass the job to some background process. -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, sen

Re: Making SecureForm independent of Session/Beaker?

2010-02-09 Thread Paweł Stradomski
W liście Haron Media z dnia środa 10 lutego 2010: > On 02/09/2010 11:26 PM, Paweł Stradomski wrote: > > W liście Haron Media z dnia wtorek 09 lutego 2010: > >> In an ideal world, yeah. But it is the very nature of stateless HTTP > >> that is the reason attacks such C

Re: Making SecureForm independent of Session/Beaker?

2010-02-09 Thread Paweł Stradomski
forms with javascript (wihtout user confirmation) etc. rather than statelessnes of HTTP itself? -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-disc...@googlegroups.com

Re: HEAD requests

2010-02-04 Thread Paweł Stradomski
a/4.0 (compatible; Netcraft Web Server Survey)" This is from a site that does not translate HEAD into GET but does check if request method is acceptable (and forgets to account for HEAD) -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups &q

Re: Caching all but 1 variable.

2010-02-02 Thread Paweł Stradomski
code can be inserted into the template as normal and > not cached. Caching the entire site for each affiliate code is not > really an option as we have 3k+ affiliates. Maybe edge-side includes? -- Paweł Stradomski -- You received this message because you are subscribed to the Google Group

Re: request.is_xhr problem

2010-02-01 Thread Paweł Stradomski
LHTTPRequest - you can use eg. flash, or iframes, as you are doing now). Alas, if you do perform CSRF checks anyway, you can still use hidden field method, as you suggested. -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups "pylons-discus

Re: request.is_xhr problem

2010-02-01 Thread Paweł Stradomski
hod"). Security risk. For is_xhr requests you can disable CSRF checks, as there is no known way of sending a cross-site forged request with this header set. But it's trivial to spoof one more field. -- Paweł Stradomski -- You received this message because you are subscribed t

Re: jQuery and Pylons

2010-01-07 Thread Paweł Stradomski
W liście Paweł Stradomski z dnia czwartek 07 stycznia 2010: > W liście writeson z dnia czwartek 07 stycznia 2010: > > var MyProjectConfiguration = { > 'base_path' : ${h.url('/')} > } > Bah, forgot quotes arount the url (and proper escaping). --

Re: jQuery and Pylons

2010-01-07 Thread Paweł Stradomski
you could put this snippet var MyProjectConfiguration = { 'base_path' : ${h.url('/')} } Then in other scripts you can construct paths with code like MyProjectConfiguration.base_path + 'some/path' (important: no leading slash) -- Paweł Stradomski -- You received

Re: adjacent fields on the same row

2010-01-03 Thread Paweł Stradomski
s? h.field got removed in 0.6.4, wasn't it? Anyway, you can just lay it out yourself - and use CSS instead of tables. You could probably mimic the HTML code as being output by the field helper. Consult the source for details http://hg.splee.co.uk/webhelpers/src/31e6eed7a527/webhelpers/html/form_

Re: combobox in pylons

2010-01-03 Thread Paweł Stradomski
ically does what I want to do, however is there a better way > than this? Why not this way: c.creditcardtypes=[("visa","visa"), ("americanexpress","americanexpress")] Also, why does creaditcardtype derive from BaseController? -- Paweł Stradomski -- Y

Re: searching for some jsonify example or tutorial

2009-12-20 Thread Paweł Stradomski
n they received, just with additional attributes. So no wrapping occurs. -- Paweł Stradomski -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this

Re: Unit tests fail after sqlalchemy mapping

2009-11-18 Thread Paweł Stradomski
can set up mappers in setUp function in test suites that need them, and remove them in tearDown (sqlalchemy has remove_mappers or some similarily named function). Personally, I don't have mappers setup as top-level functions in any module, but have a specific function just to define mappers

Re: Unicode exception in 'paster shell' (repr versus __repr__)

2009-08-04 Thread Paweł Stradomski
ectly. When called by repr() some ipython magic happens, which expects __repr__ to return a string. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to t

Re: How to set a path while building egg so that I can install the egg in my own directorty

2009-07-26 Thread Paweł Stradomski
You'd probably also want to adjust PYTHONPATH environment variable (see: http://docs.python.org/tutorial/modules.html) -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss&qu

Re: how to use amcharts in pylons

2009-07-08 Thread Paweł Stradomski
8/12/08/what-have-you-tried -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe f

Re: how to create drop-down list using pylons

2009-07-07 Thread Paweł Stradomski
W liście Mike Orr z dnia wtorek 07 lipca 2009: > Other country lists would also be welcome. (In latin-1 charset. Doesn't it limit the list to only countries of Western Europe? -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because

Re: plz help me...............how to create two drop-down lists code in pylons

2009-07-06 Thread Paweł Stradomski
ore the warning, > or return a text file containing one state per line (with the first > word in the line being the ID). The attack is only possible if the list (array in JavaScript) is top-level object. So it is just enough to wrap the list in some object, eg: {

Re: OSError: [Errno 13] Permission denied: './HelloWorld' - Pls help

2009-06-23 Thread Paweł Stradomski
Seems you're trying to execute that command in directory where you have no access. Try it in your home directory Also: > Enter template_engine (mako/genshi/jinja2/etc: Template language) > ['mako']: y Shouldn't you type &

Re: preventing multiple users from sharing logins

2009-06-16 Thread Paweł Stradomski
ssion is now dead. User 1 is asked > to log in again. > But you need to hit the database to check the last login timestamp for each request anyway, right? -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: preventing multiple users from sharing logins

2009-06-15 Thread Paweł Stradomski
#x27;s problem? -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from t

Re: preventing multiple users from sharing logins

2009-06-13 Thread Paweł Stradomski
ary. I haven't checked if beaker provides API to terminate session by id, but this should be pretty simple to implement. Fourth solution would be to use tagging of sessions, but this is even more work (I guess). > One other thing: I would like, if possible, to not have to hit t

Re: Access to "root" WSGI application

2009-06-04 Thread Paweł Stradomski
rver - instead it is just a simple function call to the WSGI appliaction - and as function calls usually do, it will run in the same thread. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

Re: request.GET error

2009-06-04 Thread Paweł Stradomski
icodeMultiDict instance has no __call__ method request.GET[], not request.GET(). Brackets, as in array access, not as in function call -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pyl

Re: Access to "root" WSGI application

2009-06-04 Thread Paweł Stradomski
d know if this is a problem in pylons). Anyway, I don't think there is a need for subrequest here -- can't you just get the data you need by simply calling some function? Move the code from controller to some common module if needed. -- Paweł Stradomski --~--~-~--~~

Re: Routes.url_for(... protocol='http') configuration

2009-04-16 Thread Paweł Stradomski
won't work, while https://somesite:8080/ will. One could even run http (not https) on port 443, byt this is a bad idea. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discus

Re: after a week or so of working fine, my app starts experiencing sqlalchemy recursion issues

2009-04-14 Thread Paweł Stradomski
lalchemy session upon finishing each request? Are you using contextual sessions? I'd guess the problem is due to more and more objects existing in the session (though I might be wrong). -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because yo

Re: AuthKit for Static Files

2009-04-08 Thread Paweł Stradomski
x would pick up the file and stream it to client. The header has sligthly different name and meaning in one of those servers, I don't recall which one. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Deployment in a hosted environment

2009-04-06 Thread Paweł Stradomski
t; > In order to run a Pylons application, is it necessary to manage the > box ourselves? > If so, I wish I had known that beforehand. > Maybe take a look at this post: http://m.andric.us/post/43754517/django-python-mod-wsgi-with-cp

Re: Deployment in a hosted environment

2009-04-06 Thread Paweł Stradomski
eg. mod_wsgi). Some braindead GUIs can't do this. But let somebody who does use cPanel speak up, I haven't (just plesk). -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons

Re: Deployment in a hosted environment

2009-04-06 Thread Paweł Stradomski
ig files generated by it? At least plesk has such a feature. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@go

Re: options h.select in webhelpers

2009-04-04 Thread Paweł Stradomski
W liście menshikoval...@gmail.com z dnia sobota, 4 kwietnia 2009: > Hello > How to make dynamicly range of 01..99 in options > > ${h.select("val", "01", options=[("01", "01"), ("02", "02").("99", > &

Re: Response hangs when using SQLAlchemy

2009-03-04 Thread Paweł Stradomski
cases, though you can check that too. What exactly is the difference between "with db" and "without db" versions, code-wise? Could you try to remove functionality by small chunks to see what lines cause the slowdown? -- Paweł Stradomski --~--~-~--~~~-

Re: Response hangs when using SQLAlchemy

2009-03-03 Thread Paweł Stradomski
ngs for about a minute when generating the response. > The client hangs there waiting for a response while pylons does > *something*. > Maybe try to profile your application to check where it spends that time? Try repoze.profile. -- Paweł Stradomski --~--~-~--~~---

Re: Newbie Question: For loops in controllers broken/requires a hack?

2009-02-17 Thread Paweł Stradomski
> for i in range(10) > log.debug(i) > ... I'm 99.% sure it has nothing to do with the for loop. It should also happen if you do i=0 log.debug(i) The trace is confusing nonetheless (and either invalid or truncated). -- Paweł Stradomski --~--~-~--~~~

Re: Sqlalchemy: querying table in different functions gives different results

2009-02-17 Thread Paweł Stradomski
gt; the row Is anotherFunction called in another session, which has started its own transaction earlier with SERIALIZABLE isolation? If so, then the row might not be visible as it would be a phantom. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message

Re: different between filter(id).first() and get(id)?

2009-01-29 Thread Paweł Stradomski
W liście John Brennan z dnia czwartek, 29 stycznia 2009: > but this does NOT work (it returns None): > meta.Session.query(self).filter(self.stuff==True).filter(id).first() Shouldn't this be .filter_by(id=id).first()? -- Paweł

Re: moving logic from controller to model

2009-01-28 Thread Paweł Stradomski
a controller, I can put dummy implementations of services in the registry, so controller will get those stubs when calling dependency()). I could have achieved the same with using some mock library. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message

Re: moving logic from controller to model

2009-01-28 Thread Paweł Stradomski
n of model and controller can be seen here: http://pastebin.com/m6fac67f0 It's sqlalchemy, but not pylons (so disregard calls to dependency() etc). Also you probably won't need Serivice objects, you would do well with plain module methods (I need them to be able to look up SA sess

Re: SQLAlchemy models isn't abstract layer / data model

2009-01-21 Thread Paweł Stradomski
W liście Michael Bayer z dnia środa 21 stycznia 2009: > On Jan 21, 11:48 am, Paweł Stradomski wrote: > > What exactly are you trying to achieve? > > one of the tenets of activerecord is that constructing an object with > a primary key returns the existing object implicitly. R

Re: SQLAlchemy models isn't abstract layer / data model

2009-01-21 Thread Paweł Stradomski
nformations).get(uid) > else: > return object.__new__(cls, *args, **kwargs) > What exactly are you trying to achieve? -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: SQLAlchemy models isn't abstract layer / data model

2009-01-21 Thread Paweł Stradomski
n the network which determines the pool is 90% full and sends an e-mail to network operators etc... Fun starts at 100 tables in the system. Cluttering domain logic code with persistence aspects is not nice. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received th

Re: SQLAlchemy models isn't abstract layer / data model

2009-01-21 Thread Paweł Stradomski
ct at all - you could wrap all the high-level processes (eg. user creation, posting an article etc.) in functions (maybe classmethods) or classes in the model layer. Just out of curiosity... which University of Technology? The Kraków one (AGH)? -- P

Re: session auto-save

2009-01-07 Thread Paweł Stradomski
y" > properties: > Just note, that in case the dict is not modified directly, but an object inside is modified, you won't get notified of the change. Eg. suppose the restored session has: session['messages'] = [] Now i do: session['messages'].append(u'Ne

Re: Ten reasons why couchdb is better than (off topic)

2009-01-04 Thread Paweł Stradomski
an mysql. Do let me know what you think > MySQL is a relational DBMS (not the best one out there), while CouchDB is document-oriented. So basically you're comparing two very different approaches to data storage. -- Paweł Stradomski --~--~-~--~~~---~--~~ Y

Re: unknown database

2008-11-01 Thread Paweł Stradomski
ol_recycle = 3600 > cache_dir = %(here)s/data > beaker.session.key = im > beaker.session.secret = somesecret > > Anyone have an idea what's going on? > You need to create 'mytest' database and grant 'myuser' access rights to it. -- Paweł Stradomski --~--~-

Re: Putting DELETE's params into request.POST

2008-10-18 Thread Paweł Stradomski
er.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com > >.ibm.cics.ts31.doc/dfhtl/topics/dfhtl_outmaking_reqwrite.htm > > > > > > -- > > Paweł Stradomski > > If it's not even part of the specs, perhaps we shall threat that as a > common misunderstanding instead? Well,

Re: Putting DELETE's params into request.POST

2008-10-17 Thread Paweł Stradomski
t really make much sense to me. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe f

Re: Pylons: pros and cons

2008-10-15 Thread Paweł Stradomski
Why not just use eager loading (well documented in sqlalchemy docs)? This uses joins and loads the related objects automatically while still returning object graph, not tuples. Also, when an object was already loaded, then future requests for this object

Re: updating user and current controller state to template

2008-08-24 Thread Paweł Stradomski
2008/8/24 <[EMAIL PROTECTED]>: > > class ShoppingController(BaseController): >def __init__(self): >BaseController.main_panel = "Shopping" >. >. You're setting the property on the controller instance,

Re: how can I ensure that several statements occur on the same connection?

2008-08-19 Thread Paweł Stradomski
object is an engine, then you can fetch a connection out of it: conn = model.metadata.bind.connect() conn.execute("first query") conn.execute("second query") ... conn.close() # returns the connection to the pool See here: http://www.sqlalchemy.org/docs/05/dbengine.html#dbeng

Re: advice with configuration/scaling a live Pylons app.

2008-05-28 Thread Paweł Stradomski
#x27;t know if starting multiple processes would give much. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@g

Re: Getting an absolute URL with routes

2008-05-06 Thread Paweł Stradomski
quot;HTTP/1.0://...". Ben Bangert asked me to post this here with > additional details. > I think the issue is related to the line "config.protocol = > environ['SERVER_PROTOCOL']". Am I passing the wrong environment > va

Re: Form filling with Genshi

2008-02-06 Thread Paweł Stradomski
wrapping them with Markup() in the template itself? -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups

Re: Routes user survey

2007-11-23 Thread Paweł Stradomski
W liście Mike Orr z dnia piątek 23 listopada 2007: > On Nov 23, 2007 6:19 AM, Paweł Stradomski <[EMAIL PROTECTED]> wrote: > > Well, I think the current solution (function being passed by the > > framework to routes) is better, as it gives more flexibility. Throwin an >

Re: Routes user survey

2007-11-23 Thread Paweł Stradomski
W liście Mike Orr z dnia piątek 23 listopada 2007: > On Nov 23, 2007 5:46 AM, Paweł Stradomski <[EMAIL PROTECTED]> wrote: > > W liście Marcin Kasperski z dnia piątek 23 listopada 2007: > > > redirect routes need some detailed design. > If we had a separate redirect l

Re: Routes user survey

2007-11-23 Thread Paweł Stradomski
could just be defined in some layer using routes - and that function would accept parameters describing type of redirect (internal, moved permanently, moved temporarily, see other...) -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because y

Re: Modifications in templates

2007-10-05 Thread Paweł Stradomski
; force the refresh. Just an idea, perhaps the server/your application does refresh, but the browser does not reload javascript files? I think this happened to me with Firefox. Just use ctrl+f5 instead of f5 when refreshing pages if you modified javascript/cs

Re: Routes and thread-safety

2007-08-22 Thread Paweł Stradomski
l) > > So setting environ actually is setting req_data, which is a thread > local. Thanks. -- Paweł Stradomski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this