0

I'm, trying out django-organizaitons (https://django-organizations.readthedocs.io/en/latest/) and so far it's really handy - however, I wish to extend the basic model by adding another field to a model. The app does provide abstraction classes, but I'm losing some of the core functionality of django-organizations by doing so (e.g email invitations). What's the easiest / best way to simply extend a model and adding another field to that model?

I've got something like this going on:

from organizations.abstract import (AbstractOrganization,
                                    AbstractOrganizationUser,
                                    AbstractOrganizationOwner)


class Project(AbstractOrganization):
    name = models.CharField(max_length=100, default="")
    project_owner = models.ForeignKey(
        "accounts.User", on_delete=models.CASCADE)


class ProjectUser(AbstractOrganizationUser):
    # this is a field that I wish to add to the out-of-the-box solution
    user_hour_cost = models.DecimalField(max_digits=6, decimal_places=2, default=0) 


class ProjectOwner(AbstractOrganizationOwner):
    pass

This works fine, as is, but now.. the invitation functionality is gone

erikvm
  • 858
  • 10
  • 30
  • what is the method you use for invitation? – engin_ipek Feb 04 '20 at 20:42
  • Trying to use this one: https://github.com/bennylope/django-organizations/blob/c6ead20907ca08e1cceecaf96a109ccddc1187eb/organizations/forms.py (OrganizationUserAddForm, line 85) – erikvm Feb 04 '20 at 21:46

0 Answers0