# Path: lfc/models.py
# class Application(models.Model):
# class WorkflowStatesInformation(models.Model):
# class Template(models.Model):
#     class Meta:
# class ContentTypeRegistration(models.Model):
#     class Meta:
# class Portal(models.Model, PermissionBase):
# class AbstractBaseContent(models.Model, WorkflowBase, PermissionBase):
#     class Meta:
# class BaseContent(AbstractBaseContent):
#     class Meta:
# class Image(models.Model):
#     class Meta:
# class File(models.Model):
#     class Meta:
# class History(models.Model):
#     class Meta:
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def get_subtypes(self):
#     def get_templates(self):
#     def __unicode__(self):
#     def content_type(self):
#     def get_content_type(self):
#     def get_absolute_url(self):
#     def get_notification_emails(self):
#     def are_comments_allowed(self):
#     def get_parent_for_permissions(self):
#     def get_parent_for_portlets(self):
#     def get_template(self):
#     def get_children(self, request=None, *args, **kwargs):
#     def has_permission(self, user, codename):
#     def check_permission(self, user, codename):
#     def __unicode__(self):
#     def has_meta_data_tab(self):
#     def has_children_tab(self):
#     def has_images_tab(self):
#     def has_files_tab(self):
#     def has_portlets_tab(self):
#     def has_comments_tab(self):
#     def has_seo_tab(self):
#     def has_history_tab(self):
#     def has_permissions_tab(self):
#     def get_tabs(self, request):
#     def save(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get_absolute_url(self):
#     def add_history(self, request, action):
#     def get_content_object(self):
#     def get_base_object(self):
#     def get_searchable_text(self):
#     def edit_form(self, **kwargs):
#     def add_form(self, **kwargs):
#     def get_ancestors(self):
#     def get_ancestors_reverse(self):
#     def get_content_type(self):
#     def get_descendants(self, request=None, result=None):
#     def has_children(self, request=None, *args, **kwargs):
#     def get_children(self, request=None, *args, **kwargs):
#     def get_image(self):
#     def get_meta_title(self):
#     def get_meta_keywords(self):
#     def get_meta_description(self):
#     def get_template(self):
#     def get_title(self):
#     def is_canonical(self):
#     def get_canonical(self, request):
#     def is_translation(self):
#     def has_language(self, request, language):
#     def get_translation(self, request, language):
#     def are_comments_allowed(self):
#     def get_parent_for_portlets(self):
#     def set_context(self, request):
#     def get_context(self, request):
#     def render(self, request):
#     def get_parent_for_permissions(self):
#     def has_permission(self, user, codename):
#     def check_permission(self, user, codename):
#     def is_active(self, user):
#     def reindex(self):
#     def is_working_copy(self):
#     def has_working_copy(self):
#     def get_working_copy(self):
#     def get_allowed_transitions(self, user):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def __unicode__(self):
#     def get_absolute_url(self):


from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from lfc.models import Role
import permissions.utils
# django imports

# permissions imports

# lfc imports


class Command(BaseCommand):
    args = ''
    help = """Creates test users for roles: author, editor, manager, reviewer"""

    def handle(self, *args, **options):
        User.objects.exclude(username="admin").delete()

        author = User.objects.create(username="author", is_active=True)
        permissions.utils.add_role(author, Role.objects.get(name="Author"))

        editor = User.objects.create(username="editor", is_active=True)
        permissions.utils.add_role(editor, Role.objects.get(name="Editor"))

        manager = User.objects.create(username="manager", is_active=True)
        permissions.utils.add_role(manager, Role.objects.get(name="Manager"))

        reviewer = User.objects.create(username="reviewer", is_active=True)

# Path: lfc/models.py
# class Application(models.Model):
# class WorkflowStatesInformation(models.Model):
# class Template(models.Model):
#     class Meta:
# class ContentTypeRegistration(models.Model):
#     class Meta:
# class Portal(models.Model, PermissionBase):
# class AbstractBaseContent(models.Model, WorkflowBase, PermissionBase):
#     class Meta:
# class BaseContent(AbstractBaseContent):
#     class Meta:
# class Image(models.Model):
#     class Meta:
# class File(models.Model):
#     class Meta:
# class History(models.Model):
#     class Meta:
#     def __unicode__(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def get_subtypes(self):
#     def get_templates(self):
#     def __unicode__(self):
#     def content_type(self):
#     def get_content_type(self):
#     def get_absolute_url(self):
#     def get_notification_emails(self):
#     def are_comments_allowed(self):
#     def get_parent_for_permissions(self):
#     def get_parent_for_portlets(self):
#     def get_template(self):
#     def get_children(self, request=None, *args, **kwargs):
#     def has_permission(self, user, codename):
#     def check_permission(self, user, codename):
#     def __unicode__(self):
#     def has_meta_data_tab(self):
#     def has_children_tab(self):
#     def has_images_tab(self):
#     def has_files_tab(self):
#     def has_portlets_tab(self):
#     def has_comments_tab(self):
#     def has_seo_tab(self):
#     def has_history_tab(self):
#     def has_permissions_tab(self):
#     def get_tabs(self, request):
#     def save(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get_absolute_url(self):
#     def add_history(self, request, action):
#     def get_content_object(self):
#     def get_base_object(self):
#     def get_searchable_text(self):
#     def edit_form(self, **kwargs):
#     def add_form(self, **kwargs):
#     def get_ancestors(self):
#     def get_ancestors_reverse(self):
#     def get_content_type(self):
#     def get_descendants(self, request=None, result=None):
#     def has_children(self, request=None, *args, **kwargs):
#     def get_children(self, request=None, *args, **kwargs):
#     def get_image(self):
#     def get_meta_title(self):
#     def get_meta_keywords(self):
#     def get_meta_description(self):
#     def get_template(self):
#     def get_title(self):
#     def is_canonical(self):
#     def get_canonical(self, request):
#     def is_translation(self):
#     def has_language(self, request, language):
#     def get_translation(self, request, language):
#     def are_comments_allowed(self):
#     def get_parent_for_portlets(self):
#     def set_context(self, request):
#     def get_context(self, request):
#     def render(self, request):
#     def get_parent_for_permissions(self):
#     def has_permission(self, user, codename):
#     def check_permission(self, user, codename):
#     def is_active(self, user):
#     def reindex(self):
#     def is_working_copy(self):
#     def has_working_copy(self):
#     def get_working_copy(self):
#     def get_allowed_transitions(self, user):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def __unicode__(self):
#     def get_absolute_url(self):


# Path: lfc/management/commands/lfc_create_test_users.py
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from lfc.models import Role
import permissions.utils

# django imports

# permissions imports

# lfc imports


class Command(BaseCommand):
    args = ''
    help = """Creates test users for roles: author, editor, manager, reviewer"""

    def handle(self, *args, **options):
        User.objects.exclude(username="admin").delete()

        author = User.objects.create(username="author", is_active=True)
        permissions.utils.add_role(author, Role.objects.get(name="Author"))

        editor = User.objects.create(username="editor", is_active=True)
        permissions.utils.add_role(editor, Role.objects.get(name="Editor"))

        manager = User.objects.create(username="manager", is_active=True)
        permissions.utils.add_role(manager, Role.objects.get(name="Manager"))

        reviewer = User.objects.create(username="reviewer", is_active=True)

        permissions.utils.add_role(reviewer, Role.objects.get(name="Reviewer"))