Hi,

Another quite strange problem using SQLAlchemy...
I've created two classes, with matching interfaces build with
zope.interface and zope.schema packages ; a web form is build with
z3c.form package ; everything is fine !

My problem is quite simple to describe : I have a main class which is
a Task, with a many-to-many relation to a Resource class ; nothing
complicated !

  class Task(Base):
    implements(ITask)
    id = Column(Integer, primary_key=True)
    ...

  class Resource(Base):
    implements(IResource)
    id = Column(Integer, primary_key=True)
    ...

  class Affectation(Base):
    task_id = Column(Integer, ForeignKey(Task.id)
    task = relation(Task)
    resource_id = Column(Integer, ForeignKey(Resource.id)
    resource = relation(Resource)

  Task.affectations = relation(Affectation)


Web creation/update forms are generated and working correctly (checked
via debugger on validation), but :
 - when I create a new task, everything is saved correctly in database
on commit ;
 - when I update an existing task and modify resources list,
everything is saved correctly ;
 - when I update an existing task and DON'T MODIFY resources list,
updates are NOT saved !!
 - if I remove resources assignment widget from the form and modify an
existing task, updates ARE saved !!

So it seems that when resources are in the form and NOT modified, the
matching task is not flagged "dirty" and is not saved in database. I
just don't understand why !!!

Any idea would be of great help !!!

Best regards,
Thierry
-- 
http://www.imagesdusport.com -- http://www.ztfy.org

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

Reply via email to