[sqlalchemy] Designing a permission system

2007-04-10 Thread Kaali
Hi, I'm designing a permission system to our messaging platform. The platform has different channels which contains messages. Every different user can have different permissions on a channel. The permissions are create, modify, delete. With these permissions, we can define that some users can

[sqlalchemy] Re: Designing a permission system

2007-04-10 Thread Andrew Stromnov
look at http://code.google.com/p/spiff/ - SpiffGuard On Apr 10, 11:36 am, Kaali [EMAIL PROTECTED] wrote: Hi, I'm designing a permission system to our messaging platform. The platform has different channels which contains messages. Every different user can have different permissions on a

[sqlalchemy] Re: Putting Session.flush in a seperate thread

2007-04-10 Thread Koen Bok
the elegant way would be to not worry about the thread scope of a connection and just use connection pooling normally. pull out a connection when needed, close it when complete (which is really just a return to the connection pool). keep the scope of those two operations local to

[sqlalchemy] Re: SQLite and decimal.Decimal

2007-04-10 Thread [EMAIL PROTECTED]
It would be great. Thank you. André On 7 abr, 12:57, Michael Bayer [EMAIL PROTECTED] wrote: the thing is, we have support for 6 different databases and postgres is the *only* one where its DBAPI implementation decides to use Decimal for numeric types. the rest return just floats. that

[sqlalchemy] Re: (solved) Automatic generation of changelog

2007-04-10 Thread Arnar Birgisson
Hi all, I have this working to my liking and as promised, here's the code: It's not complete since I'm omitting some of my model and just showing you the relevant parts. This is my model: verkefni = Table(verkefni, metadata, Column(verkefni, Integer, primary_key=True), Column(skrad,

[sqlalchemy] Re: Opinion on correct use of Sqlalchemy

2007-04-10 Thread HD Mail
Michael Bayer wrote: On Apr 9, 2007, at 10:06 PM, Huy Do wrote: Michael Bayer wrote: Particularly for your query you are doing an eager load between asset and location yet a lot of your query criterion depends upon location, so in that sense yes you have to use custom SQL, since

[sqlalchemy] Re: About threadlocal strategy

2007-04-10 Thread HD Mail
Koen Bok wrote: I'm trying to wrap my head around the threadlocal plugin to decide if we need it for our app. We are building a GUI point of sale system. Until now I have done everything in sessions, basically in one global shared session. I have read all of the documentation about the

[sqlalchemy] Re: Putting Session.flush in a seperate thread

2007-04-10 Thread Michael Bayer
just deal with the session, and bind it to an engine. saying engine.connect() does nothing down there since you arent holding onto anything. the engine itself is stateless with regards to connections (unless you use the threadlocal strategywhich you shouldnt). On Apr 10, 2007, at

[sqlalchemy] Re: About threadlocal strategy

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 5:33 AM, Koen Bok wrote: I'm trying to wrap my head around the threadlocal plugin to decide if we need it for our app. you dont. dont use it. if it requires any kind of head wrapping, then thats why i ripped it out of the core...youre better off designing your own

[sqlalchemy] Re: problems with threadlocal strategy and ResultProxy

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 7:44 AM, Manlio Perillo wrote: Yes. From the documentation it is not clear if this is allowed. the word threadlocal means that a resource is tied to the current thread. therefore, if you take resources which expect this behavior and then send them off to three

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Gaetan de Menten
On 3/31/07, Michael Bayer [EMAIL PROTECTED] wrote: On Mar 31, 2007, at 1:17 PM, Gaetan de Menten wrote: That's approximately what I did in my patch with the new params keyword argument, except I only implemented the set operation, not the add operation on the params. Anyway, what

[sqlalchemy] Aliasing within functions for eager loads

2007-04-10 Thread Rick Morrison
I've noticed that if you specify a primaryjoin criteria for a mapper relationship, SA automatically aliases the table/column names when doing an eager load of that relationship. But this doesn't seem to work if within that primary join, a column is referenced inside of a .func; SA leaves the

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread svilen
can u give some exampe, how this is supposed to be used (finaly)? as relation and/or directly as Query() On Tuesday 10 April 2007 17:22:45 Gaetan de Menten wrote: On 3/31/07, Michael Bayer [EMAIL PROTECTED] wrote: On Mar 31, 2007, at 1:17 PM, Gaetan de Menten wrote: That's approximately

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Gaetan de Menten
On 4/10/07, svilen [EMAIL PROTECTED] wrote: can u give some exampe, how this is supposed to be used (finaly)? as relation and/or directly as Query() Attached is a simple example. The setup is done using Elixir but the actual Query.from_attr usage would be the same with plain SA. If you really

[sqlalchemy] just what does 'delete-orphan' bring us ?

2007-04-10 Thread Frederic Vander Elst
Hello List, I have two (related) questions hiding below: The enclosed code makes mappers with (edit + re-run please) . default cascade rules . cascade='all' . cascade='all, delete-orphan' It tries to test u = User(); e = Email(); u.append(e) ; sess.fluhs() # works always

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 10:22 AM, Gaetan de Menten wrote: In case anybody is interested, here is my patch slightly modified with what you suggest above. Now it works wonders for both lazy and eager relationships. There is something ugly about it though: imports. I have to import the LazyLoader

[sqlalchemy] Re: Aliasing within functions for eager loads

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 11:36 AM, Rick Morrison wrote: I've noticed that if you specify a primaryjoin criteria for a mapper relationship, SA automatically aliases the table/column names when doing an eager load of that relationship. But this doesn't seem to work if within that primary

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Michael Bayer
hm, why is from_attr a classmethod ? not very consistent with all the other generative methods ? can we have a regular generative method as well ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread [EMAIL PROTECTED]
Hello all - Unfortunately, we have a ms sql server at work. When I get tuples from the server they look like this: .. (55, 26, 'Small Business and Individual Chapter 11s - The NewCode \x92s Effect on Strategies', 'AUDIO'... with \x92 for apostrophe etc. I've tried putting every encoding in

[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread Rick Morrison
You've got hi-bit characters in your data. MSSQL with pymssql will store this, but not understand it. You most likely are looking for a normal ASCII apostrophe (i.e. ord(39)) instead of the hi-bit version you've got. to get it, try ${str}.replace(ord(146), ')-- that last bit is a single

[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread Rick Morrison
Arghh, that last bit should be chr(146), not ord(146) On 4/10/07, Rick Morrison [EMAIL PROTECTED] wrote: You've got hi-bit characters in your data. MSSQL with pymssql will store this, but not understand it. You most likely are looking for a normal ASCII apostrophe (i.e. ord(39)) instead

[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'

2007-04-10 Thread Roger Demetrescu
Some details I forgot to mention: I'm using: * SQLAlchemy 0.3.6 * Postgresql 7.3.4 * Linux RedHat kernel 2.4.20-8 Other important detail: looking at my log files, I noticed that the message: global name 'anxnews_urllocal' is not defined appears several hours after the message: