mistercrunch commented on a change in pull request #5524: A tagging system for dashboards, charts and queries URL: https://github.com/apache/incubator-superset/pull/5524#discussion_r207050752
########## File path: superset/models/tags.py ########## @@ -0,0 +1,233 @@ +# -*- coding: utf-8 -*- +# pylint: disable=no-init +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import enum + +from flask_appbuilder import Model +from sqlalchemy import Column, Enum, ForeignKey, Integer, String +from sqlalchemy.orm import relationship, sessionmaker +from sqlalchemy.orm.exc import NoResultFound + +from superset.models.helpers import AuditMixinNullable + + +Session = sessionmaker(autoflush=False) + + +class TagTypes(enum.Enum): + + """ + Types for tags. + + Objects (queries, charts and dashboards) will have with implicit tags based + on metadata: types, owners and who favorited them. This way, user "alice" + can find all their objects by querying for the tag `owner:alice`. + """ + + # explicit tags, added manually by the owner + custom = 1 Review comment: Personally [despite the perf implications] I prefer having readable strings in the db. You could also model this as fks to reference tables so that the db has all the information instead of a fk to an enum that lives only in code. From what I'm seeing I'm thinking the tag name may have the info anyways, which makes it work. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
