#3297: newforms: Implement FileField and ImageField
---------------------------------------+------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: reopened | Component: django.newforms
Version: SVN | Resolution:
Keywords: newforms | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------+------------------------------------
Comment (by David Danier <[EMAIL PROTECTED]>):
Do you use any other patches? Does 4700-newforms-file-imagefield.2.diff
work?
I don't see a problem, as the code works here (tested with 4722 and HEAD)
and looks currect (see below).
save_$FIELDNAME_file() is defined in contribute_to_class(), line 638
using:
{{{
lambda instance, filename, raw_contents, save=True:
instance._save_FIELD_file(self, filename, raw_contents, save)
}}}
This takes 3 parameters as the error states (the first is "self", so I
didn't count it).
It is called in formfield_save_file() (defined on line 665), using:
{{{
func = getattr(new_object, 'save_%s_file' % self.name)
func(new_data[field_name]["filename"], new_data[field_name]["content"],
save)
}}}
I only see the 3 needed parameters here, so where did the 4th came from?
Could you perhaps look at you code to see if it differs and/or post a
stacktrace?
As I only removed the "[0]" from this method I'm very confused by this,
the previous patch seemed to work fine and I didn't change any API or
logic in this part of the code.
--
Ticket URL: <http://code.djangoproject.com/ticket/3297#comment:33>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---