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

2009-01-21 Thread Paweł Stradomski
W liście Jan Koprowski z dnia środa 21 stycznia 2009: In MVC *M*odel should be abstract layer of data and hide data representation and real method access giving: universal, good described, readable and simple interface to manage this data: add, remove, get all, get one etc... methods. One

Evoque Templating v0.4 for Python 3.0

2009-01-21 Thread Mario Ruggier
Just to announce the release of evoque 0.4, see posting below. And, dedicated docs for using evoque specifically with various python web frameworks are available, e.g: [qp] http://evoque.gizmojo.org/ext/qp/ [pylons] http://wiki.pylonshq.com/display/pylonscookbook/Templating Cheers, mario

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

2009-01-21 Thread chris mollis
Agreed.. data persistence should never be tied to the domain model. That's precisely the problem with ActiveRecord (sic Django/RoR) style of db development. It's treated as an afterthought when in fact, the database is the most common point of contention within any web application and usually

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

2009-01-21 Thread Mark Hildreth
On Wed, Jan 21, 2009 at 2:00 AM, Jan Koprowski jan.koprow...@gmail.com wrote: What's the problem with SQLAlchemy ? My class (for example User) mapped by SQLAlchemy mapper doesn't have any additional methods. My tool is meta.Session.query and my code use this. So, when I move my data to my

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

2009-01-21 Thread MilesTogoe
chris mollis wrote: Agreed.. data persistence should never be tied to the domain model. That's precisely the problem with ActiveRecord (sic Django/RoR) whoa, first Django and RoR do work for thousands of people / sites. The question is can something else work even better? The goal is

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

2009-01-21 Thread Michael Bayer
On Jan 21, 2:00 am, Jan Koprowski jan.koprow...@gmail.com wrote: In MVC *M*odel should be abstract layer of data and hide data representation and real method access giving: universal, good described, readable and simple interface to manage this data: add, remove, get all, get one etc...

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

2009-01-21 Thread Jan Koprowski
@Paweł Stradomski University of Technology in Gdańsk Ok. I understood this. But - i must wrote this methods. Simple CRUD isn't something bad. SQLAlchemy could support something like this: class User(SQLAlchemy.CRUD): pass and give optionaly something like in django. This will be nice.

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

2009-01-21 Thread Paweł Stradomski
W liście MilesTogoe z dnia środa 21 stycznia 2009: chris mollis wrote: Agreed.. data persistence should never be tied to the domain model. That's precisely the problem with ActiveRecord (sic Django/RoR) whoa, first Django and RoR do work for thousands of people / sites. The question is

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

2009-01-21 Thread Michael Bayer
On Jan 21, 11:33 am, Jan Koprowski jan.koprow...@gmail.com wrote: @Paweł Stradomski University of Technology in Gdańsk Ok. I understood this. But - i must wrote this methods. Simple CRUD isn't something bad. SQLAlchemy could support something like this: class User(SQLAlchemy.CRUD):    

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

2009-01-21 Thread Paweł Stradomski
W liście Jan Koprowski z dnia środa 21 stycznia 2009: def __new__(cls, *args, **kwargs): if 'username' in kwargs.keys(): uid = getpwnam(kwargs.get('username')).pw_uid if 'uid' in kwargs.keys(): uid = kwargs.get('uid') # @todo - poprawic

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

2009-01-21 Thread Michael Bayer
On Jan 21, 11:48 am, Paweł Stradomski pstradom...@gmail.com 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. my example meant to read: def __new__(cls, *args,

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 pstradom...@gmail.com 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.

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

2009-01-21 Thread Mark Hildreth
2009/1/21 Jan Koprowski jan.koprow...@gmail.com: Ok. I understood this. But - i must wrote this methods. Simple CRUD isn't something bad. SQLAlchemy could support something like this: class User(SQLAlchemy.CRUD): pass and give optionaly something like in django. This will be nice...

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

2009-01-21 Thread Ross Vandegrift
On Wed, Jan 21, 2009 at 08:33:03AM -0800, Jan Koprowski wrote: IMHO this could be standard for all classes (why not). I understood this SQLAlchemy forces you to write your own class methods wrap meta.Session - but this isn't cool :P because i waste my time :P Don't wrap meta.Session. That's

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-21 Thread Domhnall Walsh
Personally, I reckon that if a response shouldn't contain any content, then it stands to reason that a content-type header is pointless (why tell the browser what type of data the non-existent content has?). As such, I'd imagine the interpretation is strict but valid. Regards, Domhnall.

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-21 Thread Mike Orr
Well, Pylons and webob.Response are geared for the normal case of sending HTML documents. If you do something different, you have to set all necessary headers yourself. That's what the redirect/redirect_to() and abort() functions do; change the headers to match common scenarios. Perhaps abort

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

2009-01-21 Thread Jan Koprowski
On 21 Sty, 18:53, Ross Vandegrift r...@kallisti.us wrote: It seems like you're putting a square peg in a round hole. I don't think so. My goal is just to made abstraction layer and this forces me to wrap Session. Thats all. Methods line def add() wher i use add and session method one by

On disk data files

2009-01-21 Thread Ross Vandegrift
Hey everyone, Is there a good place in a pylons project to put data files that need to be used by the app at various places? They don't need to be web accessible - strictly internal stuff. In this case I have some XSLT sheets that I need to load on demand. Easy enough to add one if I need to,

Re: On disk data files

2009-01-21 Thread Jonathan Vanasco
If you're authoring them, a good place would probably be a subfolder of config or lib of the distributions app folder. If these are automatically generated / cached, i like to put them in the data folder of the distribution. i also use prefixing/reverse namespace to avoid collisions ie:

best ways to deal with bool values in config ?

2009-01-21 Thread Jonathan Vanasco
i store a lot of stuff in config, much of which is 'framework' related across modules. the current way i deal with bools is this ( by storing things in app_globals during init ) g.enable_feature_x= False if 'org.opensn.pylons.enable_feature_x' in config:

Re: On disk data files

2009-01-21 Thread Jorge Vargas
On Wed, Jan 21, 2009 at 2:55 PM, Ross Vandegrift r...@kallisti.us wrote: Hey everyone, Is there a good place in a pylons project to put data files that need to be used by the app at various places? They don't need to be web accessible - strictly internal stuff. In this case I have some

Re: best ways to deal with bool values in config ?

2009-01-21 Thread Gael Pasgrimaud
If you mean what is the best practise to convert bools, PasteDeploy provide a few helpers: from paste.deploy.converters import asbool I also have this in helpers.py (don't know why I can't find something similar in the paste namespace): class Params(dict): def __getattr__(self, attr):