django-admin

Relationships in Django Admin

I get really confused with many-to-many database relationships, so can some one please clarify how I would achieve this? I need a table of "Tags" (as in tag words) and a table for "Entries", such at many "Entries" could correspond to many Tag words. Right now I have my models like this: # models.py class Tags(models.Model): tag ...

SelectDateWidget in Django Admin?

Can i change default AdminDateWidget to SelectDateWidget in my models? How can i do this? I try: class RespondentAdmin(admin.ModelAdmin): formfield_overrides = { models.DateField: {'widget': SelectDateWidget}, } but it doesn't work ...

Is it possible to subclass a django model used in a many2many though relation?

Hi there, I was wondering whether it was possible to subclass a model used as the intermediate model in a M2M relation - and then display it through the usual ModelInline procedure... The code will explain it better (in models.py): from django.db import models from django.contrib import admin #the many2many_through model first class...

Django, Tiny_MCE break my css style in admin flatpage and dont appear

Hi guys, im trying to use the Tiny MCE editor in my FlatPages, but the Editor dont appear and the css of the add form in flatpage is broken. im using in this way: url.py (r'^tiny_mce/(?P<path>.*)$','django.views.static.serve',{'document_root': 'e:/wamp/www/diligencia/src/tiny_mce/jscripts/tiny_mce/'}), template: template overriding...

InlineFormSet with queryset of different model

What we're trying to do is populate a list of inline forms with initial values using some queryset of a different model. We have products, metrics (some category or type or rating), and a rating, which stores the actual rating and ties metrics to products. class Product(models.Model): name = models.CharField(max_length=100) pric...

permission_required decorator not working for me

I can't figure out why the permission required decorator isn't working. I would like to allow access to a view only for staff members. I have tried @permission_required('request.user.is_staff',login_url="../admin") def series_info(request): ... and also @permission_required('user.is_staff',login_url="../admin") def series_info(req...

Django, choices option field

Hi guys, i have a question about the choices option field. i have this field: SECUENCIA = ( ('1','1'), ('2','2'), ('3','3'), ) secuencia = models.IntegerField(max_length=1,choices=SECUENCIA) All is fine in my forms for add or update but in my show view (template display) the field just appear li...

Django, Overriding behavior Admin Model

Hi guys, in the django admin, in any app model, the diplay data (datagrid o view template, i dont know how call it), django show "all" the entry, but what happen if i want that django just show the entry with statu live or x status and not all entry with any status?. how, overriding initial behavior in admin model? Thanks ...

How to test custom django-admin commands

I created custom django-admin commands But, I don't know how to test it in standard django tests ...

Django Admin Inline Change List

I can edit a parent child relationship using the TablularInline and StackedInline classes, however I would prefer to list the child relationships as a change list as there is a lot of information and the forms are too big. Is there an inline change list available in DJango admin or a way or creating one? ...

Django, Display thumbs in Admin?

Hi guys, how ill show in the admin section the user picture?, i was looking the template of the admin and i can't see how... i think that Django show the fields in the section code (change_list template), but jeje ..how? jeje {% block result_list %} {% if action_form and actions_on_top and cl.full_result_count %}{% admin_acti...

django admin: company branches must manage only their records across many models

One company with many branches across the world using the same app. Each branch's supervisor, signing into the same /admin, should see and be able to manage only their records across many models (blog, galleries, subscribed users, clients list, etc.). How to solve it best within django? I need a flexible and reliable solution, not hack...

app-engine-patch "DJANGO_STYLE_MODEL_KIND = False" settings causes the Dango Administration fail.

The Problm occurs when Iset DJANGO_STYLE_MODEL_KIND = False in the file "settings.py". The datastore model entity of admin users in GAE will change from auth_users to Users, then try to login to admin and server error occured. That is, if DJANGO_STYLE_MODEL_KIND set to "False", the Django admin funciton will fail because of the name of d...

Admin interface editable Django app settings

Is there a good way provide user configurable app settings in Django admin? Basically I would like to have a nice forms where site owner can easily edit such one off information as his contact information, front page text content, etc. Sort of like a normal admin interface of a model, but limited to only one undeletable item in the mode...

Using list_filter with Intermediary Models

We have three models, Artist: class Artist(models.Model): family_name = models.CharField(max_length=50) given_name = models.CharField(max_length=50) Group: class Group(models.Model): name = models.CharField(max_length=50) members = models.ManyToManyField(Artist, through='Membership') and Membership: class Membershi...

Alter Django admin change list title text

I am creating some custom views for the Django admin interface that use the standard change-list as an interim stage. This works fine, apart from the fact the change-list page H1 is 'Select object to change'. 'Change' is not the right verb for the action the user will be undertaking in my custom views. I have found the django.contrib.a...

Django Admin - Bulk editing data?

Are there any admin extensions to let bulk editing data in Django Admin? (ie. Changing the picture fields of all product models at once. Note that this is needed for a users POV so scripting doesn't count.) Any thoughts on subject welcome. ...

How to alphabetically sort the values in a many-to-many django-admin box?

Hi, I have a simple model like this one: class Artist(models.Model): surname = models.CharField(max_length=200) name = models.CharField(max_length=200, blank=True) slug = models.SlugField(unique=True) photo = models.ImageField(upload_to='artists', blank=True) bio = models.TextField(blank=True) class Images(models.Model...

Django_tagging (v0.3/pre): Configuration issue

I am trying to use the django-tagging in one of my project and run into some errors. I can play with tags in the shell but couldn't assign them from admin interface. What I want to do is add "tag" functionality to a model and add/remove tags from Admin interface. Why is it the "tags" are seen by shell and not by "admin" interface? Wha...

how to make a page in django

Hello , I have two models , class A(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=200) type = models.CHarFIeld(max_length=200) .. .. .. class B(models.Model): a= models.ForeignKey(A) state = models.CharField(max_length=200) now when i am seeing the page of class A i...