ManyToManyField

2012-08-20 Thread MN TS
Hello
I'm new in Django using 1.4version.
So got some error.

'myapp.models.AdversiteImages'> has no ForeignKey to 

*
MODEL*

class AdversiteImages(models.Model):
image = models.FileField(u'Photo' , upload_to='adversiteimage/%Y/%
m/%d', null=True, blank=True)

class Adversite(models.Model):
category = models.ForeignKey(AdversiteCategory, verbose_name=u'Зарын
ангилал', related_name='adv_cat', blank=True, null=True)
image_many = models.ManyToManyField(AdversiteImages,
verbose_name=u'Photos',related_name="photos")
title = models.CharField(u'Title', max_length=128)
body = models.TextField(u'Description')


*ADMIN*

class
AdversiteImagesInline(admin.TabularInline):

model = Adversite.image_many.through
extra = 1

class AdversiteAdmin(admin.StackedInline):
fieldsets = ((u'Ерөнхий',
{'fields':('category','title','body','code')}),
 (u'Тайлбар',
{'fields':('price','phone','email','image1','image2','image3','image4','image5'

,'is_active','is_special','is_premium','start_at','finish_at')}))
list_display = ('category','title','code','is_active','is_special')
search_fields = ('category','title','code','is_active')
model = Adversite.image_many.through

Please help me. What happened to me?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: ManyToManyField

2012-08-20 Thread MN TS
Ok
Thaks for you reply.


On Tue, Aug 21, 2012 at 3:37 AM, Karen Tracey  wrote:

> Please ask questions about using Django on django-users. The topic of this
> list is the development of Django itself.
>
> Thanks,
> Karen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.