Error with File object

32 views
Skip to first unread message

Stefan Tunsch

unread,
Feb 12, 2009, 9:23:29 AM2/12/09
to django...@googlegroups.com
Hi!

I had a working code that downloaded via FTP a file and then stored a
record in the DB referencing it.

I had to rewrite it because it was not handling well filenames with
unicode characters in it.

The problem is that now when trying to save the object to the DB I get
the following error:

TypeError: Cannot create a consistent method resolutionorder (MRO) for
bases File, FieldFile


The code I am using:

f = open(myfile_name, 'wb')
ftp.retrbinary('RETR %s' % myfile_name,f.write)
f.close()
tic = Ticket.objects.get(tic_id__exact=myfile_name.split('_')[0]) #My
file has the ID of the ticket in the files name
t = TicketDocument(doc=File(f), company=company, ticket=tic)
t.save() # This step throws the TypeError


I'm using trunk at 9826 (just updated)

Any ideas would be appreciated.


Regards, Stefan

Reply all
Reply to author
Forward
0 new messages