mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
queryset-refactor: Merged to [6130]
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -481,7 +481,7 @@ In SQL terms, that evaluates to::
|
||||
WHERE NOT (pub_date > '2005-1-3' AND headline = 'Hello')
|
||||
|
||||
This example excludes all entries whose ``pub_date`` is later than 2005-1-3
|
||||
AND whose headline is NOT "Hello"::
|
||||
OR whose headline is "Hello"::
|
||||
|
||||
Entry.objects.exclude(pub_date__gt=datetime.date(2005, 1, 3)).exclude(headline='Hello')
|
||||
|
||||
|
||||
@@ -1887,7 +1887,7 @@ field on the model, you could define the callback::
|
||||
... else:
|
||||
... return field.formfield(**kwargs)
|
||||
|
||||
>>> ArticleForm = form_for_model(formfield_callback=my_callback)
|
||||
>>> ArticleForm = form_for_model(Article, formfield_callback=my_callback)
|
||||
|
||||
Note that your callback needs to handle *all* possible model field types, not
|
||||
just the ones that you want to behave differently to the default. That's why
|
||||
|
||||
Reference in New Issue
Block a user