Hi all,
I have Article model and a Comment model. Comment is created in admin.py as admin.StackedInline, and it has several fields, notably content and lastUpdate. For lastUpdate, i have specified as follows: lastUpdate = models.DateTimeField('last update', auto_now=True). Understandably, lastUpdate is not displayed when i try to add ne...
Hi all,
So i have an Article model, in there, there is a submitter = models.ForeignKey(User). When i do list_display on this submitter in ArticleAdmin, i would like to display the user's first name instead of the default (his username). How would i go about doing this?
Thanks a lot!
Jason
...
Sometimes I need to UNREGISTER some ModelAdmins from the admin site, because I don't want them to be there as they are, eg. if I'm using the Sites framework, and I dont want it to appear in the admin. It's no big deal to e.g. call admin.site.unregister(Site) to do so. In most cases I put it in admin.py of some related app that I have mad...
I have a simple Post model with a m2m field to a Tag model.
The Tag had for some reason to use a non default primary key.
Inside the admin page for a Post, the labels for the multiple selection field for Tags appear, but not the input field itself. I also tried using the filter_horizontal for the tags, but still only the labels appear ...
Hey,
I am using django 1.2 to create a multi site shop. I need multiple admin logins for each shop instance, e.g.
site.com/au/admin
site.com/uk/admin
and so on.
I have a middleware class and a dbrouter that handles database connections based on the URL. This works fine.
I am trying to add some customisation per admin system based on...
Howdy!
In the django admin you can set the search_fields for the ModelAdmin to be able to search over the properties given there. My model class has a property that is not a real model property, means it is not within the database table. The property relates to another database table that is not tied to the current model through relatio...
The changelist_view is great for editing certain fields for many entries, so I thought about adding multiple views to my admin interface, each for different fields but I'm not really sure what would be the best way... did anybody do that before ?
...
Hi all,
I would like to display priority information in a drop down. Currently i am using a integer field to store the priority, but i would like to display high/medium/low instead of letting user type in a priority.
A way to approximate this is to use a Priority database which stores 3 elements, 1:high, 2:medium, 3:low, but it seems ...
Hi all,
I have a database which keeps track of interaction between two different teams (represented in the admin interface by two different groups). For some fields, i have a foreignkey to Users database, and i would like to limit the dropdown people to only the specific groups.
If anyone have any suggestions, it would be much appreci...
Hi all,
Currently if i have a table that refer to another table, and in the admin form of the second table, there is a little button to add new items to the dropdown. The current behavior is to popup a new window, but i would like to popup something like a lighttable on top of current page. Would there be an easy way of modifying the g...
Hi folks,
is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in.
Help wou...
I know I already managed to do this but can't remember how nor I can't find any documentation about this..
How can apply a filter by default on a object list view in the admin ?
I have an app which list quotes and those quotes have a status (ex: accepted, rejected, on hold ..).
I want the filter set on status='accepted' by default tha...
Hello,
I'm trying to store a number in django that looks like this:
000001
My problem is that if I type this inside an IntegerField it gets converted to "1" without the leading zeros. I've tried also with a DecimalField with the same result. How can I store the leading zeros whithout using a CharField? (I need to manipulate that numb...
I'd like to use the user updated values of a ManyToManyField in a model's overriden save() method when I save an instance in admin.
It turns out that by design, django does not update the M2M field before calling save(), but only after the save() is complete as part of the form save...
e.g. in both print commands bellow the values disp...
Hi all,
I'm not sure what this error means:
'ManagementForm data is missing or has been tampered with'.
I have the following database schema, i have a task database, and then i can assign a task to another user as desired, so i have a user field with foreignkey pointing to User. Now, in the admin panel, i can add another user from th...
Hi all,
I have a task list, with ability to assign users. So i have foreignkey to User model in the database. However, the default display is username in the dropdown menu, i would like to display full name (first last) instead of the username. If the foreignkey is pointing to one of my own classes, i can just change the str function in...
Hi all,
I have a class Task(models.Model), and i didn't define id field explicitly (since it defines automatically for you). I checked in the database, it exists for the Task. Now i would like to display it in the list via list_display property in admin.ModelAdmin. I have a bunch of things in there, only id is not showing up for any of ...
Hey all,
The framework i'm using (django admin) pops up a new window when adding new items to the database. I would like to use a light box instead of popping up a new window (fancybox for now), and i'm using the iframe option. However, when i click save in the iframe, a request gets sent to the server, and the server responds with a pa...
I'm currently reading Practical Django Projects and in the Django admin interface there is an option to "View on site" when entering information.
But after finishing chapter 5 of the book I started to tinker with the admin interface and found that clicking this link with my categories app doesn't work as it isn't appending weblog to the...
If you have a date time field within the admin, and you invoke the "Today" link it seems it throws an exception from calendar.js where it references an undefined global method get_format. This doesn't seem to be defined in any of the latest admin js files.
Edit:
It seems like it was using a different i18n.py file from my standard djan...