django-admin

Django Custom Admin Ordering

Hi there I have a list of images in my admin area. I would like to add a upp/down button to every field. Clicking on the up field will move the image up in the order of images. So lets say its number 3 on the list and i click on it, it should now move to number 2. and also the same for moving down in the order of the list bly clicking o...

readonly_field in django

Possible Duplicate: In a django form, How to make a field readonly (or disabled) so that it cannot be edited? I am making a production server in django admin where I have an integerfield available = models.IntegerField(blank=True, help_text="(updated on save)") I was wondering if I could make this a readonly field that wont...

How to show database in django-admin using filters by default?

I need to filter database by default every time that I see it (when I save changes or when I open database first time). Can anybody tell me how to do it? ...

Changing ForeignKey's defaults in admin site

Hi, I'd like to know how I can change the blank value of ForeignKey in admin site's forms. There blank is showed as "-----". I wanna replace it by a word. Does someone know how to do it? ...

Asserting sum of values in Django-admin

I have a Django model for a sweater and want to be able to enter the composition of materials used in the admin panel (say: "100% wool" or "50% wool, 50% cotton" or "50% wool, 45% cotton, 5% acryl"). I have this model: class Sweater(models.Model): wool = models.IntegerField(max_length=3, default=100, verbose_name="wool (%)"...

Django modelform: is inline adding related model possible?

I really hope this is not a duplicate: I couldn't find anything but that could just mean I'm not good at searching :) I have a Django app, and the staff is already using the admin app for... well, administration purposes. I also created a quick data entry page for a specific model, created substantially by dropping a modelform inside th...

Help with designing models for a Django 'Project' app with 1 or more urls in it (variable), with editing at once in admin interface

Hello, i'm building a simple app for Django and I'm facing some problems with my models design, and the use of 'inlines' in the administration interface. The app is to manage projects. A project consists of a name, a description, other fields (e.g. tags...) and of multiple urls (like project url, source code repository url) but the num...

django-filebrowser not accessible and a 404 is thrown

Page not found (404) Request Method: GET Request URL: http://beta.mysite.com/admin/filebrowser/ The requested admin page does not exist. django-filebrowser requirements: django 1.0+ ( I have 1.1 ) PIL ( I installed python-imaging ) Grappelli ( I installed the latest svn trunk, confirmed it works ) For filebrowser ...

how to implement ckeditor in django.contrib.flatpages

can any one describe how to implement the ckeditor in django.contrib.flatpages... Thanks in advance ...

Custom filterspecs for auth.user

All the techniques I've seen for adding custom filterspecs to the Django admin involve editing models.py (eg link text) I'm customizing auth.user by registering my own ModelAdmin and would like to add some custom filterspecs. I could fake filterspecs in the template but I'd rather use custom filterspecs. Is there any way I can monkey-pa...

Django: What's an awesome plugin to maintain images in the admin?

I have an articles entry model and I have an excerpt and description field. If a user wants to post an image then I have a separate ImageField which has the default standard file browser. I've tried using django-filebrowser but I don't like the fact that it requires django-grappelli nor do I necessarily want a flash upload utility - can...

Multiplue ModelAdmins/views for same model in Django admin

How can I create more than one ModelAdmin for the same model, each customised differently and linked to different URLs? Let's say I have a Django model called Posts. By default, the admin view of this model will list all Post objects. I know I can customise the list of objects displayed on the page in various ways by setting variables ...

How to extend an ImageField in my own django admin template?

Hello, I would like to make a custom admin page for one of my application with django. I've created a change_form.html and fieldset.html in admin/myapp/mymodel of my template folder. I am now able to customize the page. mymodel has an ImageField and I would like to display this image on the page. I guess this is possible because the Im...

Customising Django admin TabularInline default field

I have a TabularInline admin layout, all works fine except I'd like to have it show something other than the Obj.__unicode__ value on the top left of each row. My TabularInline is a photologue ImageModel model, so I'd like it to show me the thumbnail instead of the regular __unicode__ result. I tried to change __unicode__ to output the...

Django admin different inlines for change and add view

Hi, I need separate views for add and change page. In add page I'd like to exclude some fields from inline formset. I've prepared two TabularInline classes, one of them contains property 'exclude'. I tried to use them as follows: class BoxAdmin(admin.ModelAdmin): def change_view(self, request, obj_id): self.inlines=[ItemCha...

Can django_admin_log be monitored through Django's admin?

The table django_admin_log is useful to monitor the actions of users in the admin. Right now, I can achieve that by querying the database directly. Is there a built-in functionality where I can view the table django_admin_log through Django's admin for all users? ...

Django, unique time interval for the admin panel

Greetings, Assume I have such model: class Foo(models.Model): type = models.ForeignKey(Type) start_time = models.DateTimeField() end_time models.DateTimeField() For each Foo object that is having the same type, I need this time interval (end_time - start_time) to be unique so that creation of a second Foo with a clashing ...

Exclusive Or ForeignKey in Django admin interface

In Django is there a way to force admin users to choose to fill one of a few ForeignKeys and not more than one? I have a model something like : class URL(models.Model): ... links = models.URLField(_('Google Links'),verify_exists=True,unique=True) project = models.ForeignKey(Project,blank=True,null=True) category = model...

is there a simple to get group names of a user in django

for django.contrib.auth.User and django.contrib.auth.Group i am doing like this for g in request.user.groups: l.append(g.name) Got an error TypeError at / 'ManyRelatedManager' object is not iterable Request Method: GET Request URL: http://localhost:8000/ Exception Type: TypeError Exception Value: 'ManyRelatedManager'...

Django-Admin: list_filter attribute from UserProfile

Hi, I want to allow the admins of my site to filter users from a specific country on the Admin Site. So the natural thing to do would be something like this: #admin.py class UserAdmin(django.contrib.auth.admin.UserAdmin): list_filter=('userprofile__country__name',) #models.py class UserProfile(models.Model) ... country=mode...