Skip to content

Commit

Permalink
models: OrganizationalUnit should just inherit from base Model for cl…
Browse files Browse the repository at this point in the history
…arity

Having it inherit of Samba's OrganizationalUnit model just makes it unclear.

And it makes it easier to donate upstream again later.
  • Loading branch information
robvdl committed Mar 29, 2024
1 parent 98d2a44 commit 8395da8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/sambal/models/org.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
from samba.domain import models
from samba.domain.models.fields import IntegerField
from samba.domain.models.fields import IntegerField, StringField
from samba.domain.models import Model


class OrganizationalUnit(models.OrganizationalUnit):
"""OrganizationalUnit contains additional fields not in Samba yet.
class OrganizationalUnit(Model):
"""OrganizationalUnit container model.
This is an example where the original Samba model can be overridden.
The resource must be set up to use this model over the Samba one.
This model exists in upstream Samba but many of the fields are missing.
The model is declared again here which overrides the original.
"""

ou = StringField("ou")
country_code = IntegerField("countryCode")

def __str__(self):
return str(self.ou)

@staticmethod
def get_object_class():
return "organizationalUnit"

0 comments on commit 8395da8

Please sign in to comment.