Question

I'm currently developing a Blog project using Post model, which will be used by multiple authors.

I want to make an admin/control-panel interface where each author of the Post can view the Post list the author created (so he won't see the Post created by the other authors), edit, and multiple-delete them.

Valid use case for django admin? said that:

the Django admin is not suited for individual user profiles, each user would be able to see, and edit, all other user profiles. This is suited more to an administrator who has to manage all the users at once.

That means a new CRUD system should be created -- outside the contrib.admin interface. So the question is, is there any existing technique/way to implement the CRUD outside the contrib.admin system? or, what do I need to study/use? how can I implement it nicely (the minimum effort)?

Thanks in advance :)

Was it helpful?

Solution

This is quite easy to do by tweaking the Django admin. If this is the only reason for abandoning contrib.admin then you might want to google for some recent articles on customizing the admin before you go ahead and throw the baby out with the bathwater.

I found a few likely candidates:

and in general: http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html

(note that there was an old technique that used a threads local hack. This isn't necessary anymore as there are better ways to do this. A mention of this is a sure sign the article is out of date.)

OTHER TIPS

You'll want to look at the Django generic create/update forms. It's not the admin, but it's fairly easy to implement.

Check this application: https://github.com/05bit/django-smarter.

It's not well documented yet, but I've already used it in a couple of projects.

In Django 1.3, the "generic views" (CRUD forms) have changed to be class-based. See here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top