#9313: search in manyToMany fields in admin page
-----------------------------------------------------------------------------------------------------------------+
 Reporter:  [EMAIL PROTECTED]                                                   
                                 |       Owner:  nobody    
   Status:  new                                                                 
                                 |   Milestone:            
Component:  django.contrib.admin                                                
                                 |     Version:  1.0       
 Keywords:  
query,ManyToMany,models.Model,search_fields,admin.ModelAdmin,ManyToManyField,models.ManyToManyField
  |       Stage:  Unreviewed
Has_patch:  0                                                                   
                                 |  
-----------------------------------------------------------------------------------------------------------------+
 hi,

 what should i place here to search into the phones while I'm in the
 student admin page

 {{{
 class studentAdminView(admin.ModelAdmin):
         #fields = ['firstName', 'lastName']
         #list_filter = ('birthDate')
         list_display = ('firstName', 'lastName')
         #date_hierarchy = 'birthDate'
         #list_display_links = ('firstName', 'lastName')
         list_per_page = 1
         search_fields = ['firstName','lastName']
 }}}

 {{{
 class phone_type(models.Model):
         type = models.CharField(max_length=20)

 class phone(models.Model):
         number = models.CharField(max_length=20)
         phone_type_id = models.ForeignKey(phone_type)

 class student(models.Model):
         classNumber = models.CharField(max_length=20)
         firstName = models.CharField(max_length=100)
         lastName = models.CharField(max_length=100)
         image = models.ImageField(upload_to='uploads')
         branch = models.CharField(max_length=100)
         birthDate = models.DateField('Birth Date',default=datetime.now)
         phones = models.ManyToManyField(phone)
 }}}

 I want to search between phones for example a number which is in phone
 table

 {{{
 select * from student
 innerjoin studentPhone on student.id = studentPhone.studentId
 innerjoin phone on phone.id = studentPhone.phoneId
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9313>
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 django-updates@googlegroups.com
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