e base
entity that keeps a changelog of itself is Verkefni (means "project").
A changelog entry is generated by calling changelog_entry on a dirty
object. This is not done automatically as sometimes one wants to
update an object without generating a log entry.
Arnar
# -*- encodin
On 10/29/07, mmstud <[EMAIL PROTECTED]> wrote:
> Thats handy. Where could i get the utils module you're using for Enum
> datatype?
The Enum datatype is from the ASPN cookbook, with type bindings for
SA. Here's part of my utils module.
cheers,
Arnar
# -*- encod
d in class.c (i.e. any mapped columns).
cheers,
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from
eVersions" refers to it's
parent "Page", but "Page" also keeps the version number of the latest
version.
Arnar
# encoding: utf-8
import os
from datetime import datetime
from sqlalchemy import *
from softproof import utils
from softproof.json import json
;t work either.
> I'll try to use python properties then, I think.
You can probably get að "children" property by using a join condition
that "or"-s together the join on father_id and mother_id, but it will
be read-only at best. I.e. yo
think SA will
help you much since the relationship to the child depends strictly on
if you are to be it's father or mother (which depends on the parent's
gender). SA doesn't do that kind of logic.
Besides, it's quite simple to do by h
ildren_mother'),
'father': relation(Person,
primaryjoin=persons.c.person_id==persons.c.father_id,
backref='children_father')
})
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
E [COLUMNS_1].[TABLE_NAME] = ? AND
> [COLUMNS_1].[TABLE_SCHEMA] = ?' ['test_table', 'dbo']
>
>
> Any hint ?
I don't know the mssql parts of SA, but it looks like somewhere the
statement is being treated as a collection (statment[0] or similar) so
only the &
serialize the
> > ElementTree instances to XML in a text field and vice versa.
>
> Yeah, I thought about that, but I feel it would be harder for me to do
> it this way.
Ok, you should trust your instinct. Just wanted to point this out as an option.
Arnar
--~--~-~--~~---
ot;give me all playlists
with references to xyz.avi" or "find all nodes of type media_list"?
As Michael pointed out, the ElementTree example stores the XML data
en-masse, so if you don't need those kind of queries, you might see
better performance and a simpler way of life
gth of
key)*(length of delimiter). If you have a table of 10 million nodes, a
numeric key is at most 7 characters long. A 256 character field would
give you 32 levels of recursion minimum, but more in praxis since not
all keys will be 7 characters long.
Besides, given the operations you listed above
ply nested trees maybe, but it can
help in answering the types of queries mentioned above efficiently
without requiring you to touch multiple rows upon inserting or
deleting. Also, it would be easy to implement in SA and you could have
all sorts of convenience methods on a Node class, l
; one-minute screencast demonstrating a few of them!
Excellent, thank you - this will be most useful. I have been using
almost identical "table" and "col" snippets myself.
The screencast is excellent.. I wouldn't mind having that color scheme
as well ;)
Arnar
--~--~-~--~
designing a
hierarchical database model.
If you still need help and if you want to, feel free to tell us a bit
more what you want to do. If it's not an SA issue you can mail me
directly if you're more comfortable with that.
Arnar
--~--~-~--~~~---~--~~
You
r/varchar/text field.
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMA
abase to a
> file and import this as a kind of module?
I've had to do this a few times. What I do is I use the autoload once
to create the table objects, and then just print'em on the python
console. That gives a fairly good starting point that can
king if sorted(a) == sorted(b) - see if they're the same
length. If they're not, there's no need to sort them, you know they'll
be different from each other.
b) see if using a set (or a dict if you don't have python 2.4, using
only the keys) is faster than doing the two sorts and
Hi there,
You can include a command in the dburi that is executed upon
connection start. I use it all the time like this:
mysql://user:[EMAIL
PROTECTED]:3306/dbname?init_command=set%20character%20set%20utf8
Arnar
On 5/14/07, Noam <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
, delete the
DayTimesheet too?
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email
ctly to PDF (via the ReportLab Toolkit). I have a fair amount of
experience with LaTeX and generating automatic layouts with PDF.
However I'm going on a holiday next week so I wouldn't be able to do
anything about it until April 24th at the earliest.
Arnar
[1] http://sophos.berkeley.e
gt; %s' % (prettyName, trunc(self.gamalt),
trunc(self.nytt)))
assign_mapper(ctx, AtburdurItem, atburdaskra_items, properties={
'_atburdur': atburdaskra_items.c.atburdur,
'atburdur': relation(Atburdur, backref=backref("items",
cascade="all, dele
Hi again
On 4/4/07, Arnar Birgisson <[EMAIL PROTECTED]> wrote:
> The third option, creating the changelog-information independent of
> the flush - would that mean I can't use a mapper-extension to trigger
> it? Do I have any other ways for triggering things on object upda
"framework
friendly" I guess :o)
Does it hurt in anyway to use passive=False when I get_history? In
some cases I had to in order to get what I want (get_history was
returning None).
thanks,
Arnar
--~--~-~--~~~---~--~~
You received this message because yo
in those and theyll be within the current
> transaction.
Can I use the ORM inside after_update? I.e. can I create new instances
of say HistoryLoggedItem which is a mapped class and expect that to be
inserted in the same transaction, or do I need to insert ex
On 4/4/07, Arnar Birgisson <[EMAIL PROTECTED]> wrote:
> I often use a different technique. Instead of keeping two lines in the
> association table, I only keep one and make a rule that relateditem1
> <= relateditem2.
>
> Here is the thread on graphs where Mike posted a
lution:
http://groups.google.com/group/sqlalchemy/browse_frm/thread/4d81b50fbfd84195/8ea809a9532ad6ca
The pastebin link in the thread doesn't work any more, but the code
can be found here:
http://www.sqlalchemy.org/trac/browser/sqlalchemy/t
Gaetan and Ivo:
Sure thing. I'll implement this one way or another monday or tuesday,
will post what I end up with.
Arnar
On 4/1/07, imbunche <[EMAIL PROTECTED]> wrote:
>
> I'd also apreciate if you post your code later.
>
> thx in advance.
> IvO
>
>
On 3/29/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> rebooting hopefully it comes up
Works for me, thanks.
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
I can't reach www.sqlalchemy.org, anyone else having problems?
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@goog
e database into the current session.
That history is cleared on session.flush() - right?
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlal
what columns of the mapped table have changed?
How do I hook into the update action - I think I need a mapper
extension, but can you point me to some examples?
Has anyone done something similar (the whole changelog thing) with SA?
Arnar
--~--~-~--~~~---~--~~
You r
I like it all!
Arnar
On 3/10/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> Well initial response to this post has been overwhelmingly low, but
> thats fine with me. After trying to tackle this today, I realized
> that I actually didnt want to add a brand new query object
be someday if the DB-API becomes defunct
due to microsoft dropping support for it..
It's good to hear that someone is working on pyodbc support in SA.
Arnar
On 2/17/07, Paul Johnston <[EMAIL PROTECTED]> wrote:
>
> Arnar,
>
> I agree that is an adodbapi problem; I have seen t
Hi all,
I have a small program demonstrating this without SA, so the problem
seems to be adodbapi specific. I'll be posting to their list and I
don't want to crosspost here too, so anyone interested in the problem
can have a look at the adodbapi archives.
Arnar
On 2/15/07, Arnar
nvarchar(1).
Any other ideas?
Arnar
On 2/14/07, Rick Morrison <[EMAIL PROTECTED]> wrote:
> The problem is most likely in the table definition which defines the
> "dataset" column as a Unicode type. A recent patch for adodb makes that an
> NVARCHAR field, vs. a simple VARCHAR
r(1),@P2 int,@P3 int,@P4 int',N'O',0,4,6
Here you can see that the first parameter is givent the type
nvarchar(1) and the value N'O'. I assume this is b/c somewhere the
parameter is handled as a list - and being a string messes things up.
Maybe because I'm using unicod
My vote would be to keep both, but only if you allow them to be mixed.
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups
Hi
On 2/12/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Feb 12, 4:25 am, "Arnar Birgisson" <[EMAIL PROTECTED]> wrote:
> > Hi again,
> >
> > Yes, we thought that might be the case. We tried changing the
> > isolation level on this connec
ct has no attribute 'strategy'
and another error is "object not subscriptable" when doing something
like "eststatus = result.fetchone()[0]"
Any ideas?
Arnar
TypeError: unsubscriptable object
On 2/9/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
>
> before
post so I deducted from your
question that I had a choice :o)
Anyways, freetds has always been a pain in my ... neck, I've moved a
few projects over to windows servers.
Let's say that I do that, should I use pymssql or adodbapi?
Arnar
--~--~-~--~~~---~--~~
You
Ok. Should I rather be using adodbapi then?
Arnar
On 2/8/07, Rick Morrison <[EMAIL PROTECTED]> wrote:
>
> Pymssql runs on top of the ancient library DB-lib, which has real
> issues with not fully reading all query results -- make sure all your
> query results are fully consum
ing at all. DB connections would lock up
until there were no left in the pool and this happend quite fast, in
about 20 minutes. I moved the part of the application that speaks to
mssql over to mod_python/apache and that solved the problem while we
were running on sql server 2000.
I'll tr
ble alias in every query (I'm only doing selects). The problem
is that the queries are built and executed with SA. Can I plug into
some hooks or something to do this?
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
Ok, thanks :o)
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAI
On 1/4/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
Arnar Birgisson wrote:
> On 1/3/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
> > yeah that would be why. SA's ORM has no ability to update primary key
> > columns from their original valueyoull have to upd
t silently flushed the
uow session without making any updates - leaving the model in
inconsistent state with the database. Shouldn't there be some kind of
error?
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
s not update the foreign key of the child.
One contributing factor might be that the foreign key is also a part
of the child's primary key - but I'm not sure.
Any ideas? Should I submit this as a bug?
Arnar
--~--~-~--~~~---~--~~
You received this message
the BSD licensed version.
Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send
r, so that at least the pool doesnt get filled up
> with busted connections.
So in a webserver environment this makes just the request where the
error happens fail, instead of making all subsequent requests on the
same thread fail.. correct? If so, half the b
ances(). I think im going to try to express this in thedocumentation...Nice, thanks. The version you pasted is exactly the "elegant" way I wanted to "find"*
I hope this was a helpful excercise for others besides myself. :)Arnar* on a philosophical note: are programs, like mathe
cted graphs, but makes queries easier and allows you to store directed graphs as well.
Maybe that's useful? Maybe not. It was fun to think about it anyway.
Same here.. I actually have no use for this in any of my projects.. just some recreational programming :)Arnar
--~--~-~--~~--
Hi there,There was a question on IRC yesterday on how to map a graph (as in nodes and edges) with SA. I didn't have much time to dwell on this but this was a start: http://paste.ufsoft.org/90
I was curious if someone has done this successfully? The problem I have with the above is that the "viewonl
; then it worked in SQLite. this had to be tested in postgres, which is
> strict about foreign key enforcement. to test in postgres, the
> composite foreign keys had to be specified properly, using
> ForeignKeyConstraint. after that, the whole program completes.
> attached to this em
53 matches
Mail list logo