Hi folks,
I'm trying to add graphs to the admin interface, problem is that I have not found any documentation regarding this.
I'm sure there are generally accepted ways of customizing the way fields are displayed, and I do not wish to follow any problematic route.
Any ideas?
Edit:
this is a model I'm trying to reproduce!
Un...
Hi,
I'm writing a hockey database/manager. So I have the following models:
class Team(models.Model):
name = models.CharField(max_length=60)
class Game(models.Model):
home_team = models.ForeignKey(Team,related_name='home_team')
away_team = models.ForeignKey(Team,related_name='away_team')
class SeasonStats(models.Model):
tea...
Hi folks,
I'm having a little problem here!
I have discovered the following as being the globally accepted method for customizing Django admin field.
from django import forms
from django.utils.safestring import mark_safe
class AdminImageWidget(forms.FileInput):
"""
A ImageField Widget for admin that shows a thumbnail.
"...
I have inserted this in settings.py:
AUTHENTICATION_BACKENDS = (
'blog.auth.backends.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
)
blog is an application ( correctly installed ), auth is a folder in blog application, backends.py is the file that contain this method:
from django.contrib.auth.backends import ModelBacke...
I'm trying to sync my db from a view, something like this:
from django import http
from django.core import management
def syncdb(request):
management.call_command('syncdb')
return http.HttpResponse('Database synced.')
The issue is, it will block the dev server by asking for user input from the terminal. How can I pass it the ...
I'm trying to use ModelAdmin.filter_horizontal and ModelAdmin.filter_vertical for ManyToMany field instead of select multiple box but all I get is:
My model:
class Title(models.Model):
#...
production_companies = models.ManyToManyField(Company, verbose_name="компании-производители")
#...
My admin:
class TitleAdmin(ad...
I have several question for the Django Admin feature. Im kind of new in Django so im not sure how to do it.
Basically what Im looking to do is when Im adding information on the model.
Some of the fields i want them to be combo-boxes with AutoCompleteMode.
Also looking for some fields to have the same information, for example if i ha...
Suppose I have a model:
class SomeModel(models.Model):
id = models.AutoField(primary_key=True)
a = models.IntegerField(max_length=10)
b = models.CharField(max_length=7)
Currently I am using the default admin to create/edit objects of this type. How do I set the field 'a' to have the same number as id? (default=???)
Other...
I have this Model:
class Occurrence(models.Model):
id = models.AutoField(primary_key=True, null=True)
reference = models.IntegerField(null=True, editable=False)
def save(self):
self.reference = self.id
super(Occurrence, self).save()
I want for the reference field to be hidden and at the same time have th...
Hi,
With "fieldsets" you can make it collapsible by specifying the CSS class "collapse". How to do the same with "inlines"? Thank you!
...
Hi,
I'm new to the web development world - that means I'm new to javaScript/CSS. Now I'm building a web system with Python Django. I'm wondering would you like to give me some hints as the starting point for adding "tabbed" interface to Django admin?
For example, there are 3 detail table for a master table, and I want to use 3 differen...
One of my Django sites is missing the Django Admin Action bar shown here:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#ref-contrib-admin-actions
There is no checkbox next to each row and no Action select box near the top of the page. This is happening on every model.
I have several sites running Django 1.1, and the...
I was wondering if there is a way to put a "Clear Form" button on the admin forms of the apps in django?
...
This is my model:
class Author(models.Model):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)
middle_name = models.CharField(max_length=200, blank=True)
def __unicode__(self):
return full_name
def _get_full_name(self):
"Returns the person's full name."
...
I am looking to sort the related objects that show up when editing an object using the admin form. So for example, I would like to take the following object:
class Person(models.Model):
first_name = models.CharField( ... )
last_name = models.CharField( ... )
hero = models.ForeignKey( 'self', null=True, blank=True )
and ed...
Hi,
How to show two "fieldsets" horizontally in a form?
Note: I don't mean show multiple fields horizontally, but multiple fieldsets.
Thank you!
...
I have most of this figured out already. I have AJAX returning the region/state/province when a country is selected. The correct foreign key is saved to the database, however, when the record is viewed afterwards the selected state is not shown in the select nor are any states for the selected country. I understand why this is happening ...
I thought for whatever reason this would be easy to do, but I looked deeper and it appears there is no straightforward way to allow users to execute custom admin actions on the "change" view of an instance (i.e. when you are just viewing the edit screen for a single instance, not the list of instances).
Am I overlooking an easy way to d...
I am new to the Django framework.
On Django's admin index page I'd like to get rid of the "s" at the end of my model names.
Example:
<div class="module">
<table summary="Models available in the my application.">
<caption><a href="" class="section">My application</a></caption>
<tr>
<th scope="row"><a ...
Hello,
I have an app using raw_id on both ForeignKeyField and ManyToManyField. The admin displays the value of the foreign key on the right of the edit box.
Unfortunatey, it doesn't work with ManyToMany. I've checked the code and I think that it is the normal behavior. However I would like to know if someone has an easy tip to change t...