Open bareynol opened 4 years ago
My solution: Fork the project and make your desired changes :)
I am not super familiar with the code base, but I guess that one of the problems is here: https://github.com/bennylope/django-organizations/blob/17f2c9132e066d30fb1666137e45c0f484532050/src/organizations/forms.py#L163
create_organization should be able to add extra parameters for the custom model.
I ran into this issue too.
The problem is more fundamental than just passing parameters - you'd need to sub the model in the Meta for each Form class, etc. And not import the Organization models directly anywhere in the code, otherwise it errors.
It probably needs to follow the swappable model pattern to make this work, I think? (eg like described/supported in https://github.com/openwisp/django-swappable-models)
In the short term, I think the "Cooking with" documentation should at least be updated so people don't butt their heads into this issue unexpectedly (like I did). Happy to put together a PR for that some time in the next little while (and a PR for how swappable models could work too, but that'll take longer ;-) )
Happy to put together a PR for that some time in the next little while
That would be welcomed!
I have created custom organization, organization user, and organization owner models using the abstract organization models
The "Getting Started" sections of the docs say this about single-table customized organization models:
However, forms.py and views.py both import the
Organization
model fromorganizations.models
, which causes this error:I'm currently just copying the forms.py and views.py code over to my app, but is there a better way to accomplish being able to use those utilities without having organizations installed as an app?