On Nov 30, 6:21 pm, imgrey <[EMAIL PROTECTED]> wrote:
>
> But how to determine if record is exists and update if it does or
> insert instead without executing select, which would be very slow ?
> I'm using nested begin_nested() here to avoid rollback of whole
> transaction.
you should select()
yes...add type_=DateTime to your coalesce() call -
func.coalesce(date1, date2, type_=DateTime)
when we implement ticket #615, standard functions like "coalesce" will
be available in a generic form and will also know what their
appropriate return type is (in this case it would probably go off the
I have a calculated column that takes the first non-NULL value among
three dates. It should remain a datetime object but instead it's
being converted to a string. Is it possible to tell SQLAlchemy to
treat this value like a DateTime column?
# Table t_incident defined with
sa.Column("last_en
> one immediate flaw I see in your application is that you are using
> implicit execution of SQL constructs without them having any
> connection to the ongoing transaction, such as:
>
> f_table.delete(f_table.c.user_id==theone.id).execute()
> f_table.insert().execute(user_id=theone.id, path='/', l
Yep, it seems that this was just 0.4.0 getting confused about my
redundant relationships. It's working now.
Thanks for actually looking at my code.
On Nov 30, 4:36 pm, Jonathon Anderson <[EMAIL PROTECTED]> wrote:
> I just updated to sqlalchemy 0.4.1, and see the error. I'll remove the
> duplicat
1.2.2 over here produces regular "datetime" objects.
On Nov 30, 5:45 pm, Samuel <[EMAIL PROTECTED]> wrote:
> On Nov 30, 11:21 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> > > Row:
>
> > thats not a sqlalchemy DateTime object. are you on a very old version
> > of MySQLdb ?
>
> Quite possibly
On Nov 30, 11:21 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> > Row:
>
> thats not a sqlalchemy DateTime object. are you on a very old version
> of MySQLdb ?
Quite possibly:
>>> print MySQLdb.__version__
0.9.2
>>>
-Samuel
--~--~-~--~~~---~--~~
You received t
if you're trying to prevent tables in your subqueries from correlating
outwards, issue correlate(None) on the subqueries themselves.
On Nov 30, 5:12 pm, kris <[EMAIL PROTECTED]> wrote:
> I have a filter expression 'e' with subqueries embedded.
>
> I would like issues a query
> such as session.q
I just updated to sqlalchemy 0.4.1, and see the error. I'll remove the
duplicate relations, and see if that clears this up.
On Nov 30, 4:30 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Nov 30, 5:18 pm, Jonathon Anderson <[EMAIL PROTECTED]> wrote:
>
> > I'm on SA 0.4.0
>
> > I was under the i
On Nov 30, 5:18 pm, Jonathon Anderson <[EMAIL PROTECTED]> wrote:
> I'm on SA 0.4.0
>
> I was under the impression that you had to declare the relationship
> from both sides, and that backref was only used to update related
> objects when one side of the relation was changed. Can you point me to
On Nov 30, 4:59 pm, Samuel <[EMAIL PROTECTED]> wrote:
> On Nov 30, 10:15 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> > a DateTime, meaning a sqlalchemy.types.DateTime ?
>
> Yes. (sqlalchemy 0.3)
>
> > thats not a date-
> > holding object, its a TypeEngine object which describes a date-hold
I'm on SA 0.4.0
I was under the impression that you had to declare the relationship
from both sides, and that backref was only used to update related
objects when one side of the relation was changed. Can you point me to
some docs for this?
~jon
On Nov 30, 3:26 pm, Michael Bayer <[EMAIL PROTECT
On Nov 30, 10:15 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> a DateTime, meaning a sqlalchemy.types.DateTime ?
Yes. (sqlalchemy 0.3)
> thats not a date-
> holding object, its a TypeEngine object which describes a date-holding
> database column. from the code sample below I dont see how that
I have a filter expression 'e' with subqueries embedded.
I would like issues a query
such as session.query(Ty).filter (e).correlate (None)
I tried this but it failed as correlate only works directly
on select statements,
Does anybody know how to pass this through
or how to rewrite it?
--~--~
On Nov 30, 2007, at 3:26 PM, Jonathon Anderson wrote:
>
> I'm seeing (seemingly random) instances of sqlalchemy not returning an
> object for a relation. It seems to think that the "_id"
> column is None.
>
> The code in question is available at
> http://trac.mcs.anl.gov/projects/clusterbank/bro
hi Samuel -
a DateTime, meaning a sqlalchemy.types.DateTime ? thats not a date-
holding object, its a TypeEngine object which describes a date-holding
database column. from the code sample below I dont see how that could
be returned since res.fetchone().changed would be the actual contents
On Nov 30, 2007, at 3:06 PM, imgrey wrote:
>
>
> On 30 нояб, 21:07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>> hey there -
>>
>> this is line 179 right now:
>>
>> if bind in conn_dict:
>>
>> similar mismatches in the stacktrace are present for lines 505 and
>> 509
>> (line 505 is
Hi,
I haven't found this in the list archives or the docs: How do you
convert between DateTime and datetime.datetime objects? In particular,
I am trying to do the following:
last_change = res.fetchone().changed # this returns a DateTime object
test = last_change < datetime.datetime.now()
TypeE
I'm seeing (seemingly random) instances of sqlalchemy not returning an
object for a relation. It seems to think that the "_id"
column is None.
The code in question is available at
http://trac.mcs.anl.gov/projects/clusterbank/browser/trunk/source/packages/clusterbank/model
Thanks in advance.
~jo
On 30 нояб, 21:07, Michael Bayer <[EMAIL PROTECTED]> wrote:
> hey there -
>
> this is line 179 right now:
>
> if bind in conn_dict:
>
> similar mismatches in the stacktrace are present for lines 505 and 509
> (line 505 is a blank line now).
>
> the full snip of code is:
>
>
hey there -
this is line 179 right now:
if bind in conn_dict:
similar mismatches in the stacktrace are present for lines 505 and 509
(line 505 is a blank line now).
the full snip of code is:
if bind in conn_dict:
(conn, trans, autoclose) = conn_dic
> i think its impossible for you to be getting the same stacktrace that
> you were, can you post what youre getting now please...
Exception in thread Thread-6:
Traceback (most recent call last):
File "threading.py", line 442, in __bootstrap
self.run()
File "./camper.py", line 104, in run
On Nov 30, 2007, at 9:36 AM, imgrey wrote:
>
>> based on your stacktrace, here's your bug, fixed in r3839:
>
> cannot understand how this is working
i think its impossible for you to be getting the same stacktrace that
you were, can you post what youre getting now please...
--~--~-
> based on your stacktrace, here's your bug, fixed in r3839:
cannot understand how this is working
>
> from sqlalchemy import *
> from sqlalchemy.orm import *
>
> session = scoped_session(sessionmaker(transactional=True,
> autoflush=False))
>
> engine = create_engine('postgres://scott:[EMAIL PRO
24 matches
Mail list logo