From: Rob van der Linde Date: Thu, 21 Mar 2024 22:33:17 +0000 (+1300) Subject: python: domain: models: move OrganizationalPerson to org.py X-Git-Tag: tdb-1.4.11~1341 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=5ac4b6969be802a3cdefff4f36b5542a94736295;p=thirdparty%2Fsamba.git python: domain: models: move OrganizationalPerson to org.py There are other models like OrganizationalUnit which can go in org.py better if this is done first Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/domain/models/__init__.py b/python/samba/domain/models/__init__.py index f3cdad0c8fd..4d2e930ac6a 100644 --- a/python/samba/domain/models/__init__.py +++ b/python/samba/domain/models/__init__.py @@ -29,7 +29,8 @@ from .container import Container from .gmsa import GroupManagedServiceAccount from .group import Group from .model import Model -from .person import OrganizationalPerson, Person +from .org import OrganizationalPerson +from .person import Person from .registry import MODELS from .schema import AttributeSchema, ClassSchema from .site import Site diff --git a/python/samba/domain/models/org.py b/python/samba/domain/models/org.py new file mode 100644 index 00000000000..c34526e48d4 --- /dev/null +++ b/python/samba/domain/models/org.py @@ -0,0 +1,33 @@ +# Unix SMB/CIFS implementation. +# +# Organizational models. +# +# Copyright (C) Catalyst.Net Ltd. 2024 +# +# Written by Rob van der Linde +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +from .fields import IntegerField, StringField +from .person import Person + + +class OrganizationalPerson(Person): + country_code = IntegerField("countryCode") + given_name = StringField("givenName") + + @staticmethod + def get_object_class(): + return "organizationalPerson" diff --git a/python/samba/domain/models/person.py b/python/samba/domain/models/person.py index 8e68c80eacd..20a99394ff7 100644 --- a/python/samba/domain/models/person.py +++ b/python/samba/domain/models/person.py @@ -1,6 +1,6 @@ # Unix SMB/CIFS implementation. # -# Person and OrganisationalPerson models. +# Person model. # # Copyright (C) Catalyst.Net Ltd. 2024 # @@ -20,7 +20,7 @@ # along with this program. If not, see . # -from .fields import IntegerField, StringField +from .fields import StringField from .model import Model @@ -30,12 +30,3 @@ class Person(Model): @staticmethod def get_object_class(): return "person" - - -class OrganizationalPerson(Person): - country_code = IntegerField("countryCode") - given_name = StringField("givenName") - - @staticmethod - def get_object_class(): - return "organizationalPerson" diff --git a/python/samba/domain/models/user.py b/python/samba/domain/models/user.py index 48fcd80a7e1..f19d378503b 100644 --- a/python/samba/domain/models/user.py +++ b/python/samba/domain/models/user.py @@ -27,7 +27,7 @@ from samba.dsdb import DS_GUID_USERS_CONTAINER from .exceptions import NotFound from .fields import DnField, EnumField, IntegerField, NtTimeField, StringField -from .person import OrganizationalPerson +from .org import OrganizationalPerson from .types import AccountType, UserAccountControl