If I want to add a Foreignkey to a model from another class in the same model e.g.
class1 (models.Model):
variable1 = models.IntegerField()
class2 (models.Model):
variable2 = models.CharField()
foreignkey = models.Foreignkey(class1.variable1)
Is that possible? Does that make sense as a programming move?
This ForeignKey would be an ID Number (like a primary key) that I would like to import to other classes as well.
@ Manoj Govindan:
e.g.
class author(models.Model):
authorlabel= models.IntegerField() # With choices
...
class books(models.Model):
books=models.CharField()
foreignkey= models.Foreignkey(author.authorlabel)
So that I have that data available in that table(?)/model as well.
Thanks!