Hi,
I am working on defining my mapping with SQLAlchemy and I am pretty
much done except one thing. I have a 'resource' object and an
association table 'relation' with several properties and a
relationship between 2 resources. What I have been trying to do almost
successfully so far, is to
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Michael Bayer ha scritto:
I'm pretty much -1 on this since I think migrations need to have absolute
flexibility - the listener system within create_all() is not at all
designed to be used to that degree.
Another solution is to add a completely
Hi All,
I'm looking to create a model with a unicode or string column type that
is case sensitive.
I'm looking to do this in the model in such a way that the code in the
model doesn't know or care about what backend database is used, but that
barfs if it's ever used with a backend that
Hi Michael,
Thanks for this, I thought I asked this separately but I can't find the
mail now...
How would you recommend I work this now in 0.5.8 until I can move to
0.6.0? (which will take some months :-S)
I seem to remember you suggesting a custom type. Where can I find
examples of those
On Thu, Mar 4, 2010 at 11:34 AM, Chris Withers ch...@simplistix.co.uk wrote:
Hi All,
I'm looking to create a model with a unicode or string column type that is
case sensitive.
I'm looking to do this in the model in such a way that the code in the model
doesn't know or care about what
If I use session.refresh(obj) to re-load an obj that has a one-to-many
relational property, the objects in the list are *replaced* instead of
*refreshed* if they already exist.
Suppose department has a list of employees:
suppose dept.employees = [ emp1, emp2 ]
session.refresh(dept)
the
Manlio Perillo wrote:
-BEGIN PGP SIGNED MESSAGE-
But it is a simple metadata.
It can also be stored in the `info` dictionary (and this is what I plan
to do if I have to write the support by myself).
yeah I dont really want any migration aware in core. I don't consider
create_all()
Hey,
I'm trying to create dynamic defaults for columns ala http://
www.sqlalchemy.org/docs/metadata.html#context-sensitive-default-functions.
MySQL has COMPRESS and UNCOMPRESS functions that I'm trying to
leverage. I don't want to compress with python's zlib because I have
legacy tables that
Kent wrote:
If I use session.refresh(obj) to re-load an obj that has a one-to-many
relational property, the objects in the list are *replaced* instead of
*refreshed* if they already exist.
Suppose department has a list of employees:
suppose dept.employees = [ emp1, emp2 ]
Daniel Robbins wrote:
On Thu, Mar 4, 2010 at 11:34 AM, Chris Withers ch...@simplistix.co.uk
wrote:
Hi All,
I'm looking to create a model with a unicode or string column type that
is
case sensitive.
I'm looking to do this in the model in such a way that the code in the
model
doesn't know
Chris Withers wrote:
Hi Michael,
Thanks for this, I thought I asked this separately but I can't find the
mail now...
How would you recommend I work this now in 0.5.8 until I can move to
0.6.0? (which will take some months :-S)
I seem to remember you suggesting a custom type. Where can I
patrick wrote:
Hey,
I'm trying to create dynamic defaults for columns ala http://
www.sqlalchemy.org/docs/metadata.html#context-sensitive-default-functions.
MySQL has COMPRESS and UNCOMPRESS functions that I'm trying to
leverage. I don't want to compress with python's zlib because I have
What's strange is that I can't recreate the problem on more simple
stage. Every time I refresh() on the parent object, the list objects
remain the same. In other words, *sometimes* it behaves as I hope it
to (by apparently refreshing the list's objects) and *sometimes* if
throws them out and
refresh doesn't remove any objects from the session so its a matter of
what is present in the session, not marked as dirty, and strongly
referenced on the outside. if you're using refresh you shouldn't care
about how it gets data back into the collection.
Kent wrote:
What's strange is that I
I agree I shouldn't care, so maybe there is another way to attack my
problem. The reason I care is because I've extended the python object
with some auxiliary information that I need. After the refresh() in
this case, I still need access to that data that is tied to the
object, but not present
Kent wrote:
I agree I shouldn't care, so maybe there is another way to attack my
problem. The reason I care is because I've extended the python object
with some auxiliary information that I need. After the refresh() in
this case, I still need access to that data that is tied to the
object,
Conor wrote:
Kent wrote:
I agree I shouldn't care, so maybe there is another way to attack my
problem. The reason I care is because I've extended the python object
with some auxiliary information that I need. After the refresh() in
this case, I still need access to that data that is
Thanks... that is very helpful. I could keep references to these. If
I choose the apparently lazier route and set weak_identity_map=False,
then does any other action besides explicitly expunging free this
memory, such as when the session goes out of scope, I assume?
Or do I need to carefully
Kent wrote:
Thanks... that is very helpful. I could keep references to these. If
I choose the apparently lazier route and set weak_identity_map=False,
then does any other action besides explicitly expunging free this
memory, such as when the session goes out of scope, I assume?
Or do I need
Hi All,
I have created a base declarative object that has a pre-made primary
key, so I don't have to add it to all my child tables:
class ClassDefaults(DeclarativeMeta):
def __init__(cls,classname, bases, dict_):
dict_['id'] = Column(Integer, Sequence(id_seq,
Ok, I wonder the reasons, but I trust your answer completely, so I
won't disable it. Thanks for your help again.
On Mar 4, 4:26 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Thanks... that is very helpful. I could keep references to these. If
I choose the apparently lazier
Thanks a lot Michael, now it works! this is my final script, maybe it
could help others:
engine = create_engine('oracle://user:passw...@host:1521/dbname',
echo=True)
metadata = MetaData()
pushmail_table = Table('pushmail', metadata,
Column('telefono', String, primary_key=True),
Hi all,
I tried to convert some existing code containing an adjacency list to
mix-ins, and the mix-in version doesn't seem to be liked by SQLAlchemy
0.6_beta1:
Original code that works:
class ClassDefaults(DeclarativeMeta):
def __init__(cls,classname, bases, dict_):
On Thu, Mar 4, 2010 at 2:31 PM, Daniel Robbins drobb...@funtoo.org wrote:
Hi All,
I have created a base declarative object that has a pre-made primary
key, so I don't have to add it to all my child tables:
I figured out how to do this, using the following code:
seqnum=0
def
here's my issue...I have to map to an existing Oracle db table with
33million rows (yeah, I know). This table has no primary key and
worse, nothing, and I mean nothing to uniquely identify a row
(fabulous).
as a backup, I realize that I can manually issue statements to this
thing via SA, but I'd
robneville73 wrote:
here's my issue...I have to map to an existing Oracle db table with
33million rows (yeah, I know). This table has no primary key and
worse, nothing, and I mean nothing to uniquely identify a row
(fabulous).
as a backup, I realize that I can manually issue statements to
Ahhh! Perhaps such a view coupled with an instead of trigger might
work...I'd need to think about that, but that might work. Thanks
Michael.
On Mar 4, 6:12 pm, Michael Bayer mike...@zzzcomputing.com wrote:
robneville73 wrote:
here's my issue...I have to map to an existing Oracle db table with
Manlio Perillo manlio.peri...@gmail.com writes:
Michael Bayer ha scritto:
Similarly, the concept of a version as an integer number is not really
flexible enough -
The idea was to keep it simple.
IMHE, there's no such a beast!
I would like to investigate the creation of migration
Hi,
I have this mapper defined:
mapper(Resource, resource_table,
properties = {'type' : relation(ResourceType,lazy = False),
'groups' : relation(Group, secondary =
model.tables['resource_group'], backref = 'resources'),
'parent' : relation(Relation, uselist=False, primaryjoin
Hello,
On Mar 4, 2010, at 10:50 PM, Richard Lopes wrote:
Hi,
I have this mapper defined:
mapper(Resource, resource_table,
properties = {'type' : relation(ResourceType,lazy = False),
'groups' : relation(Group, secondary =
model.tables['resource_group'], backref = 'resources'),
Hi,
Thanks for the help but I think I got it working.
Look here:
http://stackoverflow.com/questions/2384438/sqlalchemy-can-we-use-date-comparison-in-relation-definition
Cheers,
Richard
2010/3/5 Michael Trier mtr...@gmail.com
Hello,
On Mar 4, 2010, at 10:50 PM, Richard Lopes wrote:
Hi,
31 matches
Mail list logo