My Code :
class Gallery(models.Model):
GameName=models.CharField(max_length=40)
D_text=models.CharField(max_length=50)
Gime=models.ImageField(upload_to='media/',null=True,blank=True)
class Assassin(models.Model):
Gimage=models.ImageField(upload_to='media/assassin',null=True,blank=True)
imagegallery=models.ForeignKey('Gallery',on_delete='CASCADE')
( In localhost Admin
imagegallery = Gallery Object 1 )
class Batman(models.Model):
Gimage=models.ImageField(upload_to='media/batman',null=True,blank=True)
imagegallery=models.ForeignKey('Gallery',on_delete='CASCADE')
( In localhost Admin
imagegallery = Gallery Object 2 )
How can I link my class "Assassin" to class "Gallery" object 1 and class "Batman" to class "Gallery" object 2, so that when I call object 1 of Gallery in my Html file the images of Assassin class can also be shown.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKXtCfDd-9ib0SpWnA5Uh65mBoY_HXWKX1o6KyaMSkVaJ2odTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment