How to override the admin save method?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to override the admin save method?

iain duncan

I got some previous advice on overriding how the admin does delete which
was pretty straightforward as it does just uses a url. The Save button
doesn't seem to work that way.

I would like to save a file name not as it is given, but in an altered
format based on another field, so before the file gets uploaded I need
to save it's name. Any tips on how to approach that?

Thanks
Iain


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: How to override the admin save method?

Julio Nobrega

  Override the "save" method.

  http://www.djangoproject.com/documentation/model_api/#overriding-default-model-methods

  I use nesh's ImageWithThumbnailField() which does this file rename
on save, you might want to check its source code for tips.

  http://trac.studioquattro.biz/djangoutils/wiki/Thumbnail


On 10/14/06, iain duncan <[hidden email]> wrote:

>
> I got some previous advice on overriding how the admin does delete which
> was pretty straightforward as it does just uses a url. The Save button
> doesn't seem to work that way.
>
> I would like to save a file name not as it is given, but in an altered
> format based on another field, so before the file gets uploaded I need
> to save it's name. Any tips on how to approach that?
>
> Thanks
> Iain
>
>
> >
>


--
Julio Nobrega - http://www.inerciasensorial.com.br

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---