# Path: productporter/extensions.py

# 
# Path: productporter/_compat.py
# PY2 = sys.version_info[0] == 2


import re
import datetime
from productporter.extensions import db, cache
from productporter._compat import max_integer
        return self

    def delete(self):
        """Deletes a tag"""
        db.session.delete(self)
        db.session.commit()
        Tag.invalidate_cache()
        return self

    @classmethod
    @cache.memoize(timeout=max_integer)
    def tag_names(cls, limit):
        """return the all tags name array"""

        tags = Tag.query.order_by(Tag.id.asc()).limit(limit).offset(0).all()
        tagnames = []
        for tag in tags:
            tagnames.append(tag.name)
        return tagnames

    @classmethod
    def names(cls, limit=20):
        """return tag name array"""

        return cls.tag_names(limit)

    @classmethod
    def invalidate_cache(cls):
        """Invalidates this objects cached metadata."""


# Path: productporter/extensions.py

# 
# Path: productporter/_compat.py
# PY2 = sys.version_info[0] == 2


# Path: productporter/product/models.py
import re
import datetime
from productporter.extensions import db, cache
from productporter._compat import max_integer

        return self

    def delete(self):
        """Deletes a tag"""
        db.session.delete(self)
        db.session.commit()
        Tag.invalidate_cache()
        return self

    @classmethod
    @cache.memoize(timeout=max_integer)
    def tag_names(cls, limit):
        """return the all tags name array"""

        tags = Tag.query.order_by(Tag.id.asc()).limit(limit).offset(0).all()
        tagnames = []
        for tag in tags:
            tagnames.append(tag.name)
        return tagnames

    @classmethod
    def names(cls, limit=20):
        """return tag name array"""

        return cls.tag_names(limit)

    @classmethod
    def invalidate_cache(cls):
        """Invalidates this objects cached metadata."""


        cache.delete_memoized(cls.tag_names)