django-admin

Override of ModelAdmin.save_model not being called

Hi All I'm using the GenerickStackedInline which is a subclass of InlineModelAdmin which goes to ModelAdmin. When I override save_model method... it's not being called. class LocatedItemStackedInline(generic.GenericStackedInline): template = "admin/location_app/located_items/stacked.html" model = LocatedItem extra = 1 f...

Working with extra fields in an Inline form - save_model, save_formset, can't make sense of the difference..

Suppose I am in the usual situation where there're extra fields in the many2many relationship: class Person(models.Model): name = models.CharField(max_length=128) class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person, through='Membership') class Membership(models.Model):...

Django: Admin, adding some new filters to a multiple choise field

Hi! I am building an article site using django. I've added many to many relation between my articles this way: class Article (models.Model): # Tiny url url = models.CharField(max_length = 30, unique=True) is_published = models.BooleanField() author = models.CharField(max_length = 150) title = models.CharField(max_le...

Custom Django-admin command issue

Hello, trying to understand how custom admin commands work, I have my project named "mailing" and app inside named "msystem", I have written this retrieve.py to the mailing/msystem/management/commands/ folder and I have pasted an empty init.py both to the management and cpmmands folders. from django.core.management.base import BaseComma...

Specific use case for Django admin

I have a couple special use cases for Django admin, and I'm curious about other peoples' opinions: I'd like to use a customized version the admin to allow users to edit certain objects on the site (customized to look more like the rest of the site). At this point users can only edit objects they own, but I'll eventually open this up to...

Django custom command and cron

I want my custom made Django command to be executed every minute. However it seems like python /path/to/project/myapp/manage.py mycommand doesn't seem to work while at the directory python manage.py mycommand works perfectly. How can I achieve this ? I use /etc/crontab with: ****** root python /path/to/project/myapp/manage.py mycommand...

Django raw id field lookup has the wrong link

I have a django app, and on the backend I've got a many to many field that I've set in the 'raw_id_fields' property in the ModelAdmin class. When running it locally, everything is fine, but when I test on the live site, the link to the lookup popout window doesnt work. The django app resides at example.com/djangoapp/ and the admin is e...

Filter a User list using a UserProfile field in Django Admin

I'm trying to filter the User list in Django using a UserProfile Field... I need to implement a queue system where new users are put in a queue until an Admin approves them. I simply added a is_in_queue boolean field to my UserProfile model... However, when displaying the user list in my Admin area, I realized that you can't filter the ...

Is there a way to customize how a field looks in the results list?

Is there a way to customize the way a field is displayed in the django admin results list? For example, I'd like to display an image based on the field value, just like boolean fields are displayed using an image rather than text value. ...

Disable link to edit object in django's admin (display list only)?

In Django's admin, I want disable the links provided on the "select item to change" page so that users cannot go anywhere to edit the item. (I am going to limit what the users can do with this list to a set of drop down actions - no actual editing of fields). I see that Django has the ability to choose which fields display the link, ho...

How to check if a FileField has been modified in the Admin of Django ?

Hello, I am trying to do a model with a file that shouldn't be modified. But the comment of the file can be. Here is what I did, but we cannot modify the comment. How can I test if a new file (using the browse button) as been sent and in this case only, create a new instance of the model ? If no upload of a new file, update the comment...

Is there any open source project similar to the django admin, but in .NET?

I would like to know if there exists some reusable/pluggable modules which implement CRUD operations on users, groups, roles and permissions available to be integrated in .NET web applications. ...

How do I customize Django's Flatpage to display a new field on the change list page of the admin?

In my flatpage admin change list page, mysite.com/admin/flatpages/flatpage/, I can see the fields: URL Title Is there a way to also show the field Site? I associate my flatpages to specific sites. The bad way to do it is by going to the actual Flatpage admin source django/contrib/flatpages/admin.py and create a method which will dis...

[Django] Custom authentication backend functions in some cases, not always

I am using a custom authentication backend built on CAS and LDAP in a Django project. I intend to have it set up such that it can get permissions based on the what LDAP groups a user is part of. However, I have had problems with it and took a step back, so that both has_perm and has_module_perms in my backend return True always. What I ...

Django/IE8 Admin Interface Weirdness

Esteemed Django experts and users: I have been using Django's admin interface for some data editing needs. I am using it on Windows Server 2008, and using django-mssql to connect to a SQL Server backend. Python 2.6.2 Django 1.1.0 final 0 As per usual w/ Django, this was fairly easy to set up, and works beautifully on Firefox, but using...

Is there a way to filter a queryset in the django admin?

I'm trying to define an action for a model Bar -- but I only want the list of Bar objects related to a user Foo. Before I start mucking around in the admin code and passing in a custom queryset (or writing a custom view that hijacks the admin's multi-checkbox support), I figured I'd check to see if there were a way I could slice up the ...

Is there an easy way to provide a custom django admin action without allowing changes to models?

I have a custom action on a model Foo all set up and ready to go, complete with a new permission I've made. Problem is, my administrators need the can_change_foo permission to view a change list and perform that custom action (which I don't want to award). Is there an easier way to set this up without rewriting the model list admin vie...

how should i store and retrieve images with django on appengine?

I'm using appengine patch with django 1.1 (came with appengine patch). I have a page with multiple columns and multiple files. In the admin I want to be able to upload an image and write text in a column like so: This is the sory of bugs bunny ... <img src="/pages/file/agphZXAtc2FtcGxlchALEgpwYWdlc19maWxlGAUM/" alt="didnt work" /> some ...

Filtering by custom date range in Django admin

Can Django admin site select entries by a custom date range, i.e. using two DateFields with AdminDateWidget? I know that there are date_hierarchy and list_filter properties, but they don't seem very useful when there are a lot of DB entries and you just need to filter items by exact date__gte and date__lte query. ...

Edit Django User admin template

I need to edit the template shown for editing a specific user. I need to display some additional data that doesn't fit in with an include-style. I apologise for the short question... but that's pretty much all there is at the moment. ...