On Mon, Mar 26, 2012 at 11:29 PM, Michael Bayer
wrote:
>
> On Mar 26, 2012, at 1:53 PM, Daniel Nouri wrote:
>
>> I'm trying to do a few (maybe too) clever things to make SQLA
>> declarative relations less verbose for the most common cases,
>> especially for when two relations to the same type exis
On Mar 26, 2012, at 1:53 PM, Daniel Nouri wrote:
> I'm trying to do a few (maybe too) clever things to make SQLA
> declarative relations less verbose for the most common cases,
> especially for when two relations to the same type exist, and
> therefore a 'primaryjoin' on the relationship is norma
On Mar 26, 2012, at 12:46 PM, John Anderson wrote:
> I have some models stored in a library that have their own declarative base
> and then my apps models that use their own.
>
> So instead of defining a single Metadata target for the migration I need to
> send a list of them for it to check o
On Mar 26, 2012, at 5:14 PM, Michael Bayer wrote:
> To avoid loading in the rows, another way is to do what you're doing but just
> use an event, see a similar recipe here:
>
> http://stackoverflow.com/questions/9234082/setting-delete-orphan-on-sqlalchemy-relationship-causes-assertionerror-this
When you use "secondary" with relationship, SQLAlchemy maintains the rows in
this table for you automatically, that is, when you remove a SkillTag from
UserProfile.learn:
UserProfile.learn.remove(some_skill_tag)
the row in learn_tags is deleted automatically.
if you want to delete some
I have 2 tables that are referenced via a relationship() flag, I need to
figure out how to cascade delete them or delete them when their parent is
deleted.
My DB Structure:
learn_tags = Table('learn_tags', Entity.metadata,
Column('profile_pk', Integer, ForeignKey('user_profile.pk')),
Col
I'm trying to do a few (maybe too) clever things to make SQLA
declarative relations less verbose for the most common cases,
especially for when two relations to the same type exist, and
therefore a 'primaryjoin' on the relationship is normally required.
So with kemi's DeclarativeMeta, you can write
Ohhh, so I've just been using association_proxy improperly. Darn
interesting features! You just want to implement them, even when
they're not appropriate. ;)
Anyway, thanks for the namespacing idea. That's exactly the kind of
functionality I wanted to achieve, and I never would have thought of
d
I have some models stored in a library that have their own declarative base
and then my apps models that use their own.
So instead of defining a single Metadata target for the migration I need to
send a list of them for it to check on.
Is this possible?
As an example of what I need, here is the
>
> So it must be detecting that my base class doesn't have any models defined
> yet? So I just have to figure out why the metadata isn't setup just yet?
>
Inside env.py I did an import of my models and now everything works
perfectly.
--
You received this message because you are subscribed to th
On Monday, March 26, 2012 9:00:26 AM UTC-5, Michael Bayer wrote:
>
>
> On Mar 26, 2012, at 9:58 AM, Michael Bayer wrote:
>
> >
> > On Mar 25, 2012, at 7:21 PM, John Anderson wrote:
> >
> >> I have an existing app that I want to add some features to, so I
> created the new models and then ran -
On Mar 26, 2012, at 11:13 AM, Torsten Irländer wrote:
> Hm... this approach does not seem to work:
>
> AttributeError: 'ColumnProperty' object has no attribute 'mapper'
>
> class_mapper(PersonItem).get_property('fkInstID') gives me the
> ColumnProperty which does not have any mapper:
try ".par
Hm... this approach does not seem to work:
AttributeError: 'ColumnProperty' object has no attribute 'mapper'
class_mapper(PersonItem).get_property('fkInstID') gives me the
ColumnProperty which does not have any mapper:
{'key': u'fkInstID', '_strategies': {:
},
'group': None, '_is_polymorphic_dis
On Mar 26, 2012, at 9:58 AM, Michael Bayer wrote:
>
> On Mar 25, 2012, at 7:21 PM, John Anderson wrote:
>
>> I have an existing app that I want to add some features to, so I created the
>> new models and then ran --autogenerate and it created me a revision file
>> where in downgrade it was cr
On Mar 25, 2012, at 7:21 PM, John Anderson wrote:
> I have an existing app that I want to add some features to, so I created the
> new models and then ran --autogenerate and it created me a revision file
> where in downgrade it was creating all my files and in upgrade it was
> dropping the tab
Column has a collection "foreign_keys", a collection since a column in a
relational database can have any number of foreign key constraints applied to
it. If this collection is non-empty, then that Column is associated with a
ForeignKey and thus a ForeignKeyConstraint (note that a ForeignKey is
Using some of your example, together with code i wrote to XMLify
simple python classes (like pickle, but xml out.input) I have got
something working that handles circular references and updates the
database after XML has been changed(e.g. in a client) and parsed
back.
It creates a reference dict w
I must be missing something simple:
i have looked in:
- orm.properties.ColumnProperty (which i iterate by name using
mapper.iterate_properties); couldn't find anything about foreign keys
or the originating Column
- Column (iterate via class.__table__.c); can see whether it is a
Foreign key, but
On 03/23/2012 10:37, lars van gemerden wrote:
Hi Julian,
Thanks, I am looking into it and it looks interesting. Have you done
much testing yet? How do you (plan to; haven't looked at too much
detail yet) check for circular references (like backrefs)?
circular references aren't handled yet
19 matches
Mail list logo