I wrote the following model in Django, and wanted to define a foreign key to a class which is declared below the first class. Eclipse is showing an error. How to do it ?
class address_type(models.Model):
address_type_desc = models.CharField(max_length=100)
class customer_address(models.Model):
address_type_code = models.ForeignKey(address_type, related_name='type_of_address')
You don’t actually have an error, but you can use quotes:
I have also edited your class names to conform to the norm in Python. You should read pep-8, the official style guide for Python.