AJAXForeignKey: fields.py

File fields.py, 414 bytes (added by Michael Axiak <axiak@…>, 8 years ago)

field definition

Line 
1from django.db.models import ForeignKey
2from ajaxfkey.forms import AjaxForeignKeyFormField
3
4
5class 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)]
Back to Top