﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9313	search in manyToMany fields in admin page	web@…	nobody	"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
}}}

"		closed	contrib.admin	1.0		invalid	query,ManyToMany,models.Model,search_fields,admin.ModelAdmin,ManyToManyField,models.ManyToManyField		Unreviewed	0	0	0	0	0	0
