Changes between Version 3 and Version 4 of AJAXForeignKey
- Timestamp:
- May 20, 2007, 4:31:31 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AJAXForeignKey
v3 v4 68 68 === Using it in your models === 69 69 70 To use, you need to define a {{{ajax_autocomplete(data)}}} (either in {{{Model}}} or {{{Model.objects}}}) and an {{{ajax_str}}}. 71 70 72 Below is an example usage in some models: 71 73 … … 84 86 pub_date = models.DateTimeField('date published') 85 87 88 # this is how it displays in the autocompletion...should be related to 89 # how the person filters above 90 def ajax_str(self): 91 return self.question 92 86 93 class Choice(models.Model): 87 94 # notice it's the same syntax as models.ForeignKey