In case the point wasn't clear, I'd like merge() to be able to figure
out which items to add, update and, esp, delete without needing to do
that programatically myself.


On Feb 19, 7:26 am, Kent <k...@retailarchitects.com> wrote:
> Suppose I have a database table, as an example, "employee" that has a
> column "dept", but the "dept" is not represented by any other table in
> the database, it is just an attribute of employee.
>
> I would like to be able to create a "standalone" relation on a class
> that has no table so that I can assign lists to it and perform
> session.merge() and other useful sqla operations as needed.
>
> So, in that example, I would like to have a "department" object with a
> relation of "employees" so that I could say:
>
> empa = ...
> empb = ...
> empc = ...
>
> department.dept = 'PAYROLL'
> department.employees = [ empa, empb, empc ]
>
> session.merge(department)
>
> I don't really want a self-referential relation, I don't think,
> because I don't want the table joined with itself; in fact, I don't
> even want the table joined with anything at all.
>
> Does sqla support this?  How could I accomplish this with no joins?
>
> Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to