Increase width of filter_horizontal in django admin

76 views
Skip to first unread message

rc

unread,
Mar 15, 2010, 7:27:16 PM3/15/10
to Django users
I need to increase the width of the filter_horizontal in my django
admin page.

When the profile_test (keys off of testcase.test_name which is very
wide) fields are displayed both sides of the filter_horizontal are to
narrow. How do I increase the width?

I don't need the max_length of 300, but 75 would be good.

I have a models like this:

class Testcase(models.Model):
test_id = models.AutoField(primary_key=True)
test_name = models.CharField(max_length=300)
src = models.ForeignKey(Source, null=True, blank=True, \
help_text='Video source file')
asrc = models.ForeignKey(Source, null=True, blank=True, \
help_text='Audio source file')
bitrate = models.IntegerField(null=True, blank=True)
audio_bitrate = models.IntegerField(null=True, blank=True)
test_type = models.CharField(max_length=300)
output_resolution = models.CharField(max_length=15, blank=True)
out_progressive = models.BooleanField()
out_framerate = models.CharField(max_length=10, blank=True)
multicodec = models.BooleanField()
out_audio_channels = models.CharField(max_length=10, blank=True)
out_samplerate = models.IntegerField(null=True, blank=True)
out_format = models.CharField(max_length=10, blank=True)
out_chan_map = models.CharField(max_length=10, blank=True)
description = models.CharField(max_length=3000, blank=True)
ref_file = models.CharField(max_length=765, blank=True)
ref_encode_filesize = models.IntegerField(null=True, blank=True)
ref_y_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_u_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_v_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_yuv_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
highmark_version = models.CharField(max_length=60, blank=True)
def __unicode__(self):
return force_unicode(self.test_name)
class Meta:
ordering = ['test_name']
db_table = u'testcase'

class Profile(models.Model):
profile_id = models.AutoField(primary_key=True)
profile_name = models.CharField(max_length=75)
description = models.CharField(max_length=1500, blank=True)
profile_test = models.ManyToManyField(Testcase)
def __unicode__(self):
return force_unicode(self.profile_name)
class Meta:
ordering = ['profile_name']
db_table = u'profile

And model admins like this:
class ProfileAdmin(admin.ModelAdmin):
search_fields = ('profile_name',)
ordering = ('profile_name',)
filter_horizontal = ('profile_test') *****this is the field i
need to be wider******

Reply all
Reply to author
Forward
0 new messages