# Path: gitcms/tagging/models.py
# class Tag(models.Model):
#     name = models.CharField(u'tag', max_length=255)
#     slug = models.SlugField(u'slug')
#     def __unicode__(self):
#         return self.slug
#     class Meta:
#         verbose_name_plural = tr(u'Tags')


from .models import Tag
import yaml

def loaddir(directory, clear=False):
    if clear:
        Tag.objects.all().delete()
    for cat in yaml.load(open(directory + '/tags')):

# Path: gitcms/tagging/models.py
# class Tag(models.Model):
#     name = models.CharField(u'tag', max_length=255)
#     slug = models.SlugField(u'slug')
#     def __unicode__(self):
#         return self.slug
#     class Meta:
#         verbose_name_plural = tr(u'Tags')


# Path: gitcms/tagging/load.py
from .models import Tag
import yaml


def loaddir(directory, clear=False):
    if clear:
        Tag.objects.all().delete()
    for cat in yaml.load(open(directory + '/tags')):

        C = Tag(name=cat['name'], slug=cat['slug'])