#2331: Related Field has invalid lookup: icontains
---------------------------------------------------+------------------------
          Reporter:  [email protected]               |         Owner:  adrian
            Status:  closed                        |     Milestone:        
         Component:  Database layer (models, ORM)  |       Version:        
        Resolution:  invalid                       |      Keywords:        
             Stage:  Unreviewed                    |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by AntonBessonov):

 This error raised if use search_fields in admin.py. E.x:

 {{{
 class AnotherModel(models.Model):
   txt = models.CharField(_('Text'), max_length=255)

 class MyModel(models.Model):
   prop = models.ForeignKey(AnotherModel)
 }}}

 You must use:

 {{{
 class MyModelAdmin(admin.ModelAdmin):
   search_fields = ('prop__txt')
 }}}

 Maybe must raise properly exception?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2331#comment:6>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to