Hi, I am having problem implementing django mptt.
Here is my model:
class Company(models.Model):
name = models.CharField( max_length=100)
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
mptt.register(Company, order_insertion_by=['name'])
And
class Financials(models.Model):
company = models.ForeignKey(Company, related_name="financials")
year = models.IntegerField()
revenue = models.DecimalField(max_digits = 10, decimal_places = 2)
So what I am looking at is how to add Financial as an child to Company.
I tried mptt.register(Financials, parent = Company)
which of course give me error.
so mytree structure will be:
company1
....................> Financial1
--------------------> Financial 2
company2
-------------------->Financial 3
Thanks