AJAXForeignKey: fields.py
File fields.py, 414 bytes (added by , 18 years ago) |
---|
Line | |
---|---|
1 | from django.db.models import ForeignKey |
2 | from ajaxfkey.forms import AjaxForeignKeyFormField |
3 | |
4 | |
5 | class AjaxForeignKey(ForeignKey): |
6 | |
7 | def __init__(self, *args, **kwargs): |
8 | ForeignKey.__init__(self, *args, **kwargs) |
9 | |
10 | |
11 | def get_manipulator_fields(self, *args, **kwargs): |
12 | return [AjaxForeignKeyFormField(field_name = self.name, |
13 | field = self)] |