> function, then use functools.partial [1] to create partial functions
> for each file field with the value set appropriately:
>
> thumbnail_image = FileField(upload_to=partial(get_upload_path,
> 'thumbnail_image'))
Outstanding, thanks. I actually thought to myself "I need a decorator
type thing that I can pass a value with but still have it behave like
a callable" but didn't know about functools.partial.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment