--On 17. Mai 2007 02:17:22 -0700 Glauco <[EMAIL PROTECTED]> wrote:


Try this:


don't use

files = []
files.append(vf)


but use directly parent mapper:

medium.versions[0].files.append( vf )



This won't solve my problem. I rewrote parts of the code in
the following way:


       version = Version(version=0,
                         created=datetime.datetime.now(),
                         creator=self.mediendb.current_user,
                         comment=u'Automatischer Import aus %s' % imgdir)

       medium.versions.append(version)

       for f in files:
           medium.versions[-1].files.append(f)

This code works. I can even pass 'files' directly to the Version constructor
with just performs a setattr() operation for the key-value pairs part of the constructor call.

*However*

When I am interested to have only *one* Version instance using the following code:


       version = Version(version=0,
                         created=datetime.datetime.now(),
                         files=files,
                         creator=self.mediendb.current_user,
                         comment=u'Automatischer Import aus %s' % imgdir)

       medium.versions = [version]


I get the same error again :( This makes no sense to me.

Andreas

Attachment: pgpjew1343FlW.pgp
Description: PGP signature

Reply via email to