Пример #1
0
    def getEnvironment(self):
        '''
        Returns an environment valid for the record this object represents
        '''
        from uds.core.util.UniqueMacGenerator import UniqueMacGenerator
        from uds.core.util.UniqueNameGenerator import UniqueNameGenerator

        return Environment.getEnvForTableElement(self._meta.verbose_name, self.id, {'mac': UniqueMacGenerator, 'name': UniqueNameGenerator})
Пример #2
0
    def getEnvironment(self):
        '''
        Returns an environment valid for the record this object represents
        '''
        from uds.core.util.UniqueMacGenerator import UniqueMacGenerator
        from uds.core.util.UniqueNameGenerator import UniqueNameGenerator

        return Environment.getEnvForTableElement(
            self._meta.verbose_name, self.id, {
                'mac': UniqueMacGenerator,
                'name': UniqueNameGenerator
            })
Пример #3
0
    def getEnvironment(self):
        """
        Returns an environment valid for the record this object represents
        """
        # from uds.core.util.UniqueMacGenerator import UniqueMacGenerator
        # from uds.core.util.UniqueNameGenerator import UniqueNameGenerator

        return Environment.getEnvForTableElement(
            self._meta.verbose_name,
            self.id,
            {"mac": unique.UniqueMacGenerator, "name": unique.UniqueNameGenerator, "id": unique.UniqueGIDGenerator},
        )
Пример #4
0
    def getEnvironment(self):
        '''
        Returns an environment valid for the record this object represents.

        In the case of the user, there is an instatiation of "generators".
        Right now, there is two generators provided to child instance objects, that are
        valid for generating unique names and unique macs. In a future, there could be more generators

        To access this generators, use the Envirnment class, and the keys 'name' and 'mac'.

        (see related classes uds.core.util.UniqueNameGenerator and uds.core.util.UniqueMacGenerator)
        '''
        from uds.core.util.UniqueMacGenerator import UniqueMacGenerator
        from uds.core.util.UniqueNameGenerator import UniqueNameGenerator
        return Environment.getEnvForTableElement(self._meta.verbose_name, self.id, {'mac': UniqueMacGenerator, 'name': UniqueNameGenerator})
Пример #5
0
    def getEnvironment(self) -> Environment:
        """
        Returns an environment valid for the record this object represents.

        In the case of the user, there is an instatiation of "generators".
        Right now, there is two generators provided to child instance objects, that are
        valid for generating unique names and unique macs. In a future, there could be more generators

        To access this generators, use the Envirnment class, and the keys 'name' and 'mac'.

        (see related classes uds.core.util.UniqueNameGenerator and uds.core.util.UniqueMacGenerator)
        """
        return Environment.getEnvForTableElement(
            self._meta.verbose_name, self.id, {
                'mac': unique.UniqueMacGenerator,
                'name': unique.UniqueNameGenerator,
                'id': unique.UniqueGIDGenerator,
            })
Пример #6
0
 def getEnvironment(self):
     """
     Returns an environment valid for the record this object represents
     """
     return Environment.getEnvForTableElement(self._meta.verbose_name, self.id)
Пример #7
0
 def getEnvironment(self):
     """
     Returns an environment valid for the record this object represents
     """
     return Environment.getEnvForTableElement(self._meta.verbose_name, self.id)