If you want to give your admins/managers some way to upload images or docs and
then refer to them in articles etc. what are the built-in approaches?
I have seen a few image/file browsers, one looks really good but it requires
some hacking into Django which I don't want to mess with.
I am thinking: Have an ImageFile model and let people upload from it, via
admin. Then they simply have to remember the filename when they refer to it
someplace -- say in an article (perhaps using tinymce). This does not sound
friendly enough though.
What are your tricks?
\d
\d
I've been wondering about the same thing myself. I don't think it's
good to hard-code URLs to files in the HTML body of an article. I know
that at least FCKeditor has plugin/extension support so it should be
possible to write a plugin that retrieves a list of model objects that
contain files and inserts images/links into the HTML. Additional
special markup should be added to be able to keep the URLs in sync if
for some reason the file that is being referred to is deleted or
moved. I guess you can ask the FCKeditor/tinyMCE/etc. guys about the
plugin support of the corresponding editor.
It'd be real nice if you kept me in sync with any progress you make,
too. :)
Regards,
Erik
\d
\d
Erik
Some people have been following this thread fairly closely, trying to
figure out if there's actually a feature being requested here. Any
time I see "Image/file upload" my antennae perk up, but I really can't
figure out what you're asking for.
On one hand, it sounds like there's a request for including a rich
editor, with a file picker for images. I can almost certainly assume
that'll never happen in Django; that's third-party app territory.
Maybe there's something else.
There also seems to be a request to be able to type a filename and
have it magically transformed into a URL. First, something has to
parse that filename and turn it into a URL, which again sounds like
third-party app territory. Second, in the current trunk (after
changest 8244, that is), there's no longer a simple mapping between
filenames and URLs. Each storage system might give different URLs for
a given filename, and you can have different storage sytems on
different models (or even on different fields in the same model).
There may well be a void here for a third-party application to fill,
but I can't tell what that void really is. If you guys have a need,
maybe you can put your heads together and come up with a solution for
it. Maybe a markdown extension or a new markup syntax entirely, I
don't know. Maybe the solution is to write your articles in templates,
so that you can just use something like {{
article.image_set.1.image.url }}.
There are a number of options, but I think there needs to be a more
solid need before anybody can hope to fill it.
-Gul
Some kind of connection between media and urls from the admin is what I feel
is missing.
> Maybe the solution is to write your articles in templates,
I'm not fluent enough in django to follow that, not being sure what you mean
by articles.
> There are a number of options, but I think there needs to be a more
> solid need before anybody can hope to fill it.
My OP basically said it - I was hoping to hear from people about how they
manage media and allow their users to do so. I imagined that since Django
came from a newspaper/magazine background there must have been this intimate
tie-up between words and text.
Nevertheless, thanks for the input.
\d
That implies some specific markup processor to handle those cases.
Flatpages themselves are just passed to a template. What that template
does with it (running it through markdown, textile or
reStructuredText, for instance) is beyond Django's ability to control.
There's no way to insert images into a flatpage without knowing how
it'll be rendered, so there's not really a way for Django to do this
for you.
It might be possible for an app to do this, but only by forcing you to
use a specific markup library. Django won't do that.
>> Maybe the solution is to write your articles in templates,
> I'm not fluent enough in django to follow that, not being sure what you mean
> by articles.
I don't mean anything about Django here. By "articles" I mean whatever
you meant when you wrote: "If you want to give your admins/managers
some way to upload images or docs and then refer to them in
-->articles<-- etc. what are the built-in approaches?"
>> There are a number of options, but I think there needs to be a more
>> solid need before anybody can hope to fill it.
> My OP basically said it - I was hoping to hear from people about how they
> manage media and allow their users to do so. I imagined that since Django
> came from a newspaper/magazine background there must have been this intimate
> tie-up between words and text.
Okay, I'll grant you that. I'll stand aside and let those people
who've done this in the past explain how they did it (since I don't
know), but I don't think asking for explicit admin integration is
gonna get you anywhere.
-Gul
\d
Hi, what is a 'pass version' form? Perhaps it's something I missed.
\d
> What I meant was to create a form ...
Okay, I think I see what you mean. I guess I have been stuck on the flatpages
concept -- using them as a means to allow the user to create content quickly,
but darned if I know how to allow them to place images and links to media (in
an easy way).
So, I'd create my own 'flatpage' with an inline section of image & "reference"
and then a template to draw it all would place the images in the page based
on some system - perhaps a div id = reference, or a sub-template language of
some kind to be replaced by the view before the html string hits the
template.
My initial impression is still there, however. Look at the date picker that
admin provides. That could also be dismissed as '3rd party' and left at that.
I think a media picker should be built-in so that references to media (<a>
tags) can be generated as quickly as proper dates are. Admittedly I have not
thought deeply upon this and still need to work out the question :)
Anyway, thanks for the clarification.
\d