use the file picker for my form

190 views
Skip to first unread message

Joseph Parker

unread,
Sep 16, 2013, 3:36:19 PM9/16/13
to django...@googlegroups.com
I just started trying to use django-filer - i have searched this question in this group and elsewhere and can't find the answer.

Changed my model to use your filer.filefield instead of model.filefield.

When I am editing the model through admin it works fine.  When I click on that field in the model a pop up opens which let's me select a file (and let's me upload etc) for that field.

However, in my custom form/template for that model the widget does not pop up - it looks like it takes me to the admin application for filer - in particular there doesn't seem to be a way to select one of the files as a value for the field.

What am I missing?

Joseph Parker

unread,
Sep 16, 2013, 3:37:34 PM9/16/13
to django...@googlegroups.com
as an aside - I also have the problem (only in my form not through admin) where the file id shows up in the widget as well.... the javascript is there but for whatever reason not hiding the field.

Stefan Foulis

unread,
Sep 17, 2013, 12:06:52 PM9/17/13
to django...@googlegroups.com
Hi joseph

The widget provided is only intended to be used in admin. Currently we don't provide any support for custom non-admin forms. What you can do, is use a normal file field on your custom form and create a filer file in your own code on form save.

Cheers
Stefan
--
You received this message because you are subscribed to the Google Groups "django-filer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-filer...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Joseph Parker

unread,
Sep 17, 2013, 12:44:37 PM9/17/13
to django...@googlegroups.com
ok thanks for that input.  But I wonder how difficult it would be to adapt that admin widget to use with custom forms - have you ever considered it?  I may take a stab at it.....i prefer the user to pick the file that is already there, if it is there, rather than uploading a new copy...iwould lose that with regular file field....


--
You received this message because you are subscribed to a topic in the Google Groups "django-filer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-filer/ce7DGvWV6Cc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-filer...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Joe Parker
412-897-8032

Stefan Foulis

unread,
Sep 17, 2013, 2:02:07 PM9/17/13
to django...@googlegroups.com
The tricky part is, that the file picker uses admin views. So all users that use it would have to be staff users and have permissions to access the admin. Also there are links that point to other views in the admin, which would confuse users who are not supposed to be confronted with the admin.
But I'd like to have a widget that works outside the admin :-)
Reply all
Reply to author
Forward
0 new messages