How to use the safrs.util.classproperty function in safrs

To help you get started, we’ve selected a few safrs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thomaxxl / safrs / safrs / base.py View on Github external
    @classproperty
    def _s_auto_commit(self):
        """
            :return: whether the instance should be automatically commited.
            :rtype: boolen
            fka db_commit: auto_commit is a beter name, but keep db_commit for backwards compatibility
        """
        return self.db_commit
github thomaxxl / safrs / safrs / jsonapi.py View on Github external
    @classproperty
    def _s_type(cls):
        return cls._target._s_type
github thomaxxl / safrs / safrs / _api.py View on Github external
    @classproperty
    def _s_class_name(cls):
        """

        """
        return cls._target.__name__
github thomaxxl / safrs / examples / demo_stateless.py View on Github external
    @classproperty
    def _s_query(cls):
        """
            query placeholder
        """
        return TestQuery()
github thomaxxl / safrs / safrs / safrs_types.py View on Github external
    @classproperty
    def column_names(self):
        """
            :return: a list of columns names of this id type
        """
        return [c.name for c in self.columns]
github thomaxxl / safrs / examples / demo_stateless.py View on Github external
    @classproperty
    def _s_type(cls):
        """
            json:api type
        """
        return cls.ja_type
github thomaxxl / safrs / safrs / jsonapi.py View on Github external
    @classproperty
    def _s_relationship_names(cls):
        return cls._target._s_relationship_names
github thomaxxl / safrs / safrs / base.py View on Github external
    @classproperty
    def _s_class_name(cls):
        """
            :return: the name of the instances
        """
        return cls.__name__
github thomaxxl / safrs / safrs / base.py View on Github external
    @classproperty
    def object_id(cls):
        """
            :return: the Flask url parameter name of the object, e.g. UserId
            :rtype: string
        """
        # pylint: disable=no-member
        return cls.__name__ + get_config("OBJECT_ID_SUFFIX")
github thomaxxl / safrs / safrs / base.py View on Github external
    @classproperty
    def _s_query(cls):
        """
            :return: sqla query object
        """
        _table = getattr(cls, "_table", None)
        if _table:
            return safrs.DB.session.query(_table)
        return safrs.DB.session.query(cls)