Hi redbaron,

My approach is to subclass ModelAdmin to implement a import command .
It should need to override the __call__() and create a import_view()
function to handle the import form. Example:

class XXXAdmin(admin.ModelAdmin):

        

        def __call__(self, request, url):

                if url == "import":

                        return self.import_view(request)

                else:

                        return admin.ModelAdmin.__call__(self,request,url)


However, I am still studying how to make the import_view function by
reading the source of ModelAdmin.add_view(). It use quite a lot of
undocumented functions..

On Fri, Nov 28, 2008 at 6:08 PM, redbaron <[EMAIL PROTECTED]> wrote:
>
> I try to implement same thing.I need some place where I could upload
> file, django should parse it and populate database with new data. To
> make it more ease I defined new model BatchUpload with only one field
> batch. Now I need to customize upload handler method in admin site.
> Could anyone give advice how to do it best way?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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