Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Commit

Permalink
Make the multiselect boxes look so much nicer!
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
smarthall committed Mar 2, 2013
1 parent 27ea5df commit 0137db6
Show file tree
Hide file tree
Showing 7 changed files with 431 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cred/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models
from django.contrib import admin
from django.contrib.auth.models import User, Group
from django.forms import ModelForm
from django.forms import ModelForm, SelectMultiple

from tastypie.models import create_api_key

Expand Down Expand Up @@ -40,6 +40,8 @@ class CredForm(ModelForm):
def __init__(self,requser,*args,**kwargs):
super (CredForm,self ).__init__(*args,**kwargs) # populates the post
self.fields['group'].queryset = Group.objects.filter(user=requser)
self.fields['tags'].widget = SelectMultiple(attrs={'class':'chzn-select'})
self.fields['tags'].queryset = Tag.objects.all()

class Meta:
model = Cred
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0137db6

Please sign in to comment.