[sqlalchemy] need help for left join

2007-06-02 Thread aruna-cgx
Hello: I am new for SQLAlchemy and first time using with Plone. I need some help for left join. I have two tables, roles and roleElements. Structure and sample data for these two tables I am including for easy popup of table/data which will be useful to him\her who will try to help me.

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread Gaetan de Menten
IMHO, this solves my use case nicely. It's slightly longer than what I proposed but doesn't reach my internal this_is_too_long_to_type threshold and it's more explicit... So for me it's a +1 for that solution (along with documenting the joinpoint behavior ;-)). On 6/2/07, Michael Bayer [EMAIL

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread Gaetan de Menten
On 6/2/07, Gaetan de Menten [EMAIL PROTECTED] wrote: IMHO, this solves my use case nicely. It's slightly longer than what I proposed but doesn't reach my internal this_is_too_long_to_type threshold and it's more explicit... So for me it's a +1 for that solution (along with documenting the

[sqlalchemy] Anybody seen--Exception: invalid byte sequence for encoding UTF8?

2007-06-02 Thread Matt Culbreth
Howdy All, I've got some existing code that I'm trying on a new server. The code was formerly running with Python 2.4 and SA 0.36, but this new server is running Python 2.5 and SA 0.37. Anyway, I've got a small program which is loading a PostgreSQL 8.2 db from a CSV file, and I'm getting this

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread Michael Bayer
On Jun 2, 2007, at 6:02 AM, Gaetan de Menten wrote: Hmmm, after some more thoughts there is one little aspect of that which bothers me: once you joined to something, you can't add filtering criteria on the initial table/class. This is actually one of the features I disliked about the

[sqlalchemy] Re: Anybody seen--Exception: invalid byte sequence for encoding UTF8?

2007-06-02 Thread Michael Bayer
On Jun 2, 2007, at 8:22 AM, Matt Culbreth wrote: Howdy All, I've got some existing code that I'm trying on a new server. The code was formerly running with Python 2.4 and SA 0.36, but this new server is running Python 2.5 and SA 0.37. Anyway, I've got a small program which is loading a

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread sdobrev
what about adding a docopy=True (or dont_copy=False) to all methods that could be both copy_generative and modify-in-place? via some generic self=self.copy_if_required() func? Then one can choose at which point to split+copy let me summarize things that im thinking we do: - we want to go

[sqlalchemy] Re: Anybody seen--Exception: invalid byte sequence for encoding UTF8?

2007-06-02 Thread Matt Culbreth
Thanks Michael, I'll do this. When I change the model's column types to Unicode() I still get the same type in the DB--character varying(100). I'm assuming that's correct? The DB is using a UTF8 encoding. On Jun 2, 9:53 am, Michael Bayer [EMAIL PROTECTED] wrote: On Jun 2, 2007, at 8:22 AM,

[sqlalchemy] Re: Anybody seen--Exception: invalid byte sequence for encoding UTF8?

2007-06-02 Thread Michael Bayer
On Jun 2, 2007, at 10:58 AM, Matt Culbreth wrote: Thanks Michael, I'll do this. When I change the model's column types to Unicode() I still get the same type in the DB--character varying(100). I'm assuming that's correct? The DB is using a UTF8 encoding. yes convert_unicode means an

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread sdobrev
what about adding a docopy=True (or dont_copy=False) to all methods that could be both copy_generative and modify-in-place? via some generic self=self.copy_if_required() func? Then one can choose at which point to split+copy well if you have switches that are dynamically modifying the

[sqlalchemy] Re: bug in OrderedDict?

2007-06-02 Thread Michael Bayer
sounds like a bug. add a ticket and/or create a patch ! thanks. On Jun 2, 3:48 pm, Eric Ongerth [EMAIL PROTECTED] wrote: I noticed that if you pop() an item out of an OrderedDict, then ask the OrderedDict for its values(), you get a key error because the OD doesn't trim its ._list when the

[sqlalchemy] SQLAlchemy 0.3.8 released

2007-06-02 Thread Michael Bayer
The 0.3 series is now coming in for a landing, foregoing shiny new bells and whistles which are instead skipping ahead in the 0.4 branch. Release 0.3.8 is primarily a bugfix release, with some new features of an only mildly spectacular nature (unless youre really into every single MySQL

[sqlalchemy] Re: Bug in .query()[11:22]

2007-06-02 Thread Michael Bayer
On Jun 1, 11:57 pm, Mike Orr [EMAIL PROTECTED] wrote: My point is, if the second number is lower than the first, shouldn't SQLAlchemy transform it into a query that returns no records? I.e., LIMIT 0, which MySQL at least allows. Because that's what the Python equivalent would do:

[sqlalchemy] Re: Bug in .query()[11:22]

2007-06-02 Thread Mike Orr
On 6/2/07, Michael Bayer [EMAIL PROTECTED] wrote: On Jun 1, 11:57 pm, Mike Orr [EMAIL PROTECTED] wrote: My point is, if the second number is lower than the first, shouldn't SQLAlchemy transform it into a query that returns no records? I.e., LIMIT 0, which MySQL at least allows.

[sqlalchemy] Re: bug in OrderedDict?

2007-06-02 Thread Eric Ongerth
done and done: Ticket #585. Patch reprinted here for the curious passerby: def pop(self, key=None): if key == None: try: key = self._list[0] except IndexError: raise IndexError('tried to pop() from an empty OrderedDict')