refactoring and updating models for python 3.7 -- os_manager & permissions

This commit is contained in:
Adolfo Gómez García 2019-08-13 11:28:33 +02:00
parent 377b4542d7
commit 75b470a7d1
4 changed files with 6 additions and 3 deletions

View File

@ -45,7 +45,7 @@ from uds.core.services.Exceptions import InvalidServiceException
from uds.models.uuid_model import UUIDModel
from uds.models.Tag import TaggingMixin
from uds.models.OSManager import OSManager
from uds.models.os_manager import OSManager
from uds.models.Service import Service
from uds.models.transport import Transport
from uds.models.group import Group

View File

@ -33,7 +33,7 @@
import logging
# Permissions
from .Permissions import Permissions
from .permissions import Permissions
# Utility
from .util import getSqlDatetime
@ -45,7 +45,7 @@ from .Provider import Provider
from .Service import Service
# Os managers
from .OSManager import OSManager
from .os_manager import OSManager
# Transports
from .transport import Transport

View File

@ -59,6 +59,9 @@ class OSManager(ManagedObjectModel, TaggingMixin): # type: ignore
ordering = ('name',)
app_label = 'uds'
def getInstance(self, values: typing.Optional[typing.Dict[str, str]] = None) -> 'osmanagers.OSManager':
return typing.cast('osmanagers.OSManager', super().getInstance(values=values))
def getType(self) -> typing.Type['osmanagers.OSManager']:
"""
Get the type of the object this record represents.