Thank you, i got it working now. For future reference:
Before creating a sa class with something like:
type(typename, (Base,), classdict)
I first create the classdict in which I define columns, __tablename__,
etc, and validators (relationships I add later).
The validators i create(using a
PS: the validate(value) method in typedef[name] is a normal method,
throwing exception on errors and returning the value when OK.
On Apr 16, 2:01 pm, lars van gemerden l...@rational-it.com wrote:
Thank you, i got it working now. For future reference:
Before creating a sa class with something
A little off topic, but who knows.
Looking for a reporting tool for SQL db's, would be even nicer if it
supports SQLAlchemy.
Did quit a bit of googling but haven't really come across anything in
the Python world.
What am I looking for:
- reports to be run from within a Python application
I followed your suggestions, and implemented it in the following way:
- a SessionListener class, responsible for maintaining the
alternate state of the sesssion is instantiated. The class defines a
before_flush, and after_flush methods, which are registered as event
listeners for their respecting
I am attempting to use STI with mixins on the derived/inheriting
classes. If the mixin has a simple Column, everything works great. But
when I have a ForeignKey on the Column, and therefore use the
`declared_attr` decorator, I get an exception when I attempt to query
the child collection.
For the
Hi,
for an association table I specified a ORM mapped class that I wanted
to use as secondary attribute in relationship(). But I discovered,
that a Table or a callable can be used only. Because in my application
I do not use any explicite Table definitions, but ORM only I need to
write:
foo =
OK the one area that I'd check on is how exactly you remove items from
new/deleted. The public API for that is pretty much to expunge() the object
from the Session (I think expiring an object should remove from deleted also
but I'd have to check).The use case of modifying those lists
On Apr 16, 2012, at 4:03 AM, Max S. wrote:
Hi,
for an association table I specified a ORM mapped class that I wanted
to use as secondary attribute in relationship(). But I discovered,
that a Table or a callable can be used only. Because in my application
I do not use any explicite Table
On Apr 16, 4:16 pm, Michael Bayer mike...@zzzcomputing.com wrote:
OK the one area that I'd check on is how exactly you remove items from
new/deleted. The public API for that is pretty much to expunge() the object
from the Session (I think expiring an object should remove from deleted also
what version of SQLA is that ? I cannot reproduce. test case:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base, declared_attr,
has_inherited_table
Base= declarative_base()
class Person(Base):
id = Column(Integer,
so I think the safer options here would be:
1. for obj in session.new, use session.expunge(obj)
2. for obj in session.deleted, use session.add(obj)
so #1, the difference is that it removes from _new and also detaches the state
from the session, which just means it removes the session_id. you
Hi
I'd like to use an associationproxy for a simple many-to-one relationship:
class Child(Base):
__tablename__ = 'child'
id = Column(Integer, primary_key=True)
name = Column(Unicode)
class Parent(Base):
__tablename__ = 'parent'
id = Column(Integer, primary_key=True)
12 matches
Mail list logo