On Mon, Sep 15, 2008 at 2:30 PM, Markus <[EMAIL PROTECTED]> wrote:
> Gul said that "... a hybrid between FileField and FilePathField. I
> really can't imagine how we'd be able to get that to work reasonably
> well, especially in a way that makes sense when trying to use it. I'm
> open to ideas, but I doubt that's feasible. "
>
> I have been looking for this hybrid for some time. I do not quite
> understand why this feature should not make sense. Please consider the
> following: I want to allow my users to either select an existing image
> to display on their page, or to upload a new one. Sure I could create
> two model fields for this, but this is far from being smart,
> especially because I would need a "either this or that field is
> required" flag. Which surely would not make sense.

Note that I didn't say the idea makes no sense; I simply said it'd be
very difficult to pull it off in a way that makes sense "when trying
to use it." I was referring more to the interface for it, and how that
would work. As you say, with two separate fields, it would be "either
this or that field is required," but that's also true with just one
field: "either this or that *portion* of the field is required."

> Is there another way of adding this feature, maybe by hand? I'm sure
> there is, but I'm pretty new to Django and would be grateful for
> hints.

Yes, I'm sure it would be possible. For one, you could use two fields
and build your own logic to bring them together. Alternatively, take a
look at the code for both FileField and FilePathField, looking for
ways to bring them together. Like I said, I'm open to ideas, so I
certainly don't want to stop you from working on it, but just be aware
that it'll take more than a simple hack to get the job done.

-Gul

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to