django-admin

django admin permissions - can edit user but can't edit his permissons - how to do it?

I gave the editors such permissions: auth | user | can add/change user - ON auth | permissions | can add/change permissions - OFF Still, when editing, they can change their permissions (and allow themselves actions they shouldn't do). I've found a ticket from 2yrs ago: http://code.djangoproject.com/ticket/6519 and it still works this...

Using an RPC like Protocol Buffers as a backend to Django, instead of MySQL or SQLite

The clever folks behind the app-engine-patch project have essentially enabled all the fun stuff of Django, including the admin, but without using Django's ORM. From their website: The most important change is that you have to use Google's Model class because the development model is too different from Django (at least with Django's ...

Django: ManyToMany Inline Admin view error

Here are the model definitions: class ItemBrand(models.Model): name = models.CharField(max_length = 30, unique = True) def __unicode__(self): return self.name class WantedItem(models.Model): name = models.CharField(max_length = 120) description = models.TextField() created = models.DateTimeField(auto_now = False, auto_now_add = Tr...

How to add django-db-log models to admin panel?

Just installed django-db-log module and trying to make it work properly. 'python manage.py syncdb' command created databases, it seems like logging works, but there is nothing about it in admin panel. As I found in documentation, it should add itself in admin panel without any additional configuration, but then I added 'djangodblog.middl...

Change field in Django Flatpages Admin

Using Flatpages with the default admin, I need to change the template field from a text input with to select or radio with predefined choices. It's easy to do this with one of my own apps - just use the choices attribute in the model. I have tried a few things - I will add details about those attempts later if necessary - but does anyon...

Django admin has no style

Hi there, I have just moved my django site on my staging server, and the admin side of the site has no styling with it, when previously in local development it was fine, I read somewhere that I need to create a symbolic link, I did that by doing this sudo ln -s /var/www/sico/htdocs /usr/lib/python2.5/site-packages/django/contrib/admin...

Django admin: Format fields in list, but keep sortable?

Hi, I keep numeric fields like "size", "width", "height" in my database. Now I would attach units like "KiB" or "pixels" to them when showing them in the change list. This could easily be achieved by adding callables such as "size_formatted" etc to list_display. However, these are no longer sortable. Is there a way around this limitati...

Registered models do not show up in admin

I added a model to admin via admin.site.register, and it does not show up in admin. Sice admin is so "It just works", I have no idea of how to debug this. POinters? ...

Django admin search functionality

I have a simple database in django with SQLite and now I want to improve it with a better search capability (I will create a new project with new models). I would like to ask about how to plan and go about this project. The existing database has these fields first, initial, last, school, yearGraduated I am using django admin to sor...

Django: Filtering or displaying a model method in Django Admin

I have a model with an expiration DateField. I want to set up an Admin filter that will allow the user to toggle between "Not Expired" and "Any". The model method is quite a simple Date comparison, no problem. However assigning this as a field or filter parameter in the AdminForm is not automatic. Is such a thing possible, and if not...

Assigning a group while adding user in django-admin

In my application, I have models that have the Users model as a Foreign key, eg: class Doctor(models.Model): username=models.ForeignKey(User, unique=True) ... In the admin site, when adding a new Doctor, I have the option of adding a new User next to the username field. This is exactly what I want, but in the dialog that opens, it...

Django Admin doesn't show entries.

If I create a new entry for one particular model it doesn't show up in the django admin. The Agency Model is causing the trouble. # catalog.models class Content(models.Model): class Meta: abstract = True BUNDESLAND_CHOICES = ( ('bw', 'Baden-Württemberg'), ('by', 'Bayern'), ('be', 'Berlin'), ...

How to implement objects modification trace

Hi there, With django admin, we have an history of who altered an object and when. I would like to add an "old value", "new value" to this to be able to roll back if needed. Plus I would like every modification made to my objects (also outside of admin) to be recorded as well. The final objective is to be able to trace every modificat...

How to restrict models foreign keys to foreign objects having the same property

Here is my example : We have printers. We can define page formats that are linked to a specific printer then we define workflows that select a starting format (first page added to the printing job), a body format and an end format (last page added to the printing job). Start and End are not required (null and blank = True) I want to b...

django admin TinyMCE integration

This is weird: I have installed and configured django-tinymce, but it doesn't seem to work with django admin. this works fine with Safari: class ArticleAdmin(admin.ModelAdmin): formfield_overrides = { models.TextField: {'widget': TinyMCE(attrs={'cols': 80, 'rows': 20}, )}, } but i does not work within firefox. Just ...

Prepopulating inlines based on the parent model in the Django Admin

I have two models, Event and Series, where each Event belongs to a Series. Most of the time, an Event's start_time is the same as its Series' default_time. Here's a stripped down version of the models. #models.py class Series(models.Model): name = models.CharField(max_length=50) default_time = models.TimeField() class Event(...

Skipping delete confirmation in Django Admin

What is the best way to skip the delete confirmation page in the Django admin and go straight to deleting the objects? Thank you! ...

Validate that atleast one modelfield has value in Django admin

Given the following model, how do I require that atleast one of the two fields has been given a value? class ZipUpload(models.Model): zip_file = models.FileField(upload_to="/tmp", blank=True, help_text='Select a file to upload.') zip_file_path = models.FilePathField(path="/tmp", blank=True, ...

Django: Is there any way use a multiple select for many-to-many field with an intermediary model?

The docs say: When you specify an intermediary model using the through argument to a ManyToManyField, the admin will not display a widget by default. OK, but how about if I want a multiple select widget? I have a model: class Quotation(models.Model): source = models.CharField() sourceLink = models.URLField( blank=Tru...

Django admin: Can't add app to admin

I have installed Django on my host (I use their install version 1.1.1), all is working fine. I have created some apps and they are registered in my settings.py (I can verify this works when i visit the site, the app shows up). In the folder of this app i have created admin.py with the following content: from progmaticnet.page.models imp...