# Path: staff/fields.py
# class RemovableImageField(models.ImageField, RemovableFileField):
#     """
#     A specific form of removeable file field, but specifically for images
#     """
#     attr_class = MyImageFieldFile
# 
#     def formfield(self, **kwargs):
#         defaults = {'form_class': RemovableImageFormField}
#         defaults.update(kwargs)
#         return super(RemovableImageField, self).formfield(**defaults)
# 
# Path: staff/settings.py
# DEFAULT_SETTINGS = {
#     'PHOTO_STORAGE': settings.DEFAULT_FILE_STORAGE,
#     'ORDERING': ('last_name', 'first_name'),
# }
# USER_SETTINGS = DEFAULT_SETTINGS.copy()
#     USER_SETTINGS['ORDERING'] = settings.STAFF_ORDERING
#     USER_SETTINGS['PHOTO_STORAGE'] = settings.STAFF_PHOTO_STORAGE


from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.files.storage import get_storage_class
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django_localflavor_us.models import PhoneNumberField
from .fields import RemovableImageField
from .settings import PHOTO_STORAGE, ORDERING
    from django.core.exceptions import ImproperlyConfigured
        from django.db import transaction
    from django.db.models.signals import post_save
        _('Title'),
        max_length=50,
        blank=True,
        default="")
    bio = models.TextField(_('Biography'), blank=True)
    is_active = models.BooleanField(_('is a current employee'), default=True)
    phone = PhoneNumberField(_('Phone Number'), blank=True)
    photo = RemovableImageField(_('Photo'),
        blank=True,
        upload_to='img/staff/%Y',
        storage=DEFAULT_STORAGE(),
        height_field='photo_height',
        width_field='photo_width')
    photo_height = models.IntegerField(default=0, blank=True)
    photo_width = models.IntegerField(default=0, blank=True)
    twitter = models.CharField(_('Twitter ID'),
        max_length=100,
        blank=True)
    facebook = models.CharField(_('Facebook Acccount'),
        max_length=100,
        blank=True)
    google_plus = models.CharField(_('Google+ ID'),
        max_length=100,
        blank=True)
    website = models.URLField(_('Website'),
        blank=True)

    objects = StaffMemberManager()

    class Meta:

# Path: staff/fields.py
# class RemovableImageField(models.ImageField, RemovableFileField):
#     """
#     A specific form of removeable file field, but specifically for images
#     """
#     attr_class = MyImageFieldFile
# 
#     def formfield(self, **kwargs):
#         defaults = {'form_class': RemovableImageFormField}
#         defaults.update(kwargs)
#         return super(RemovableImageField, self).formfield(**defaults)
# 
# Path: staff/settings.py
# DEFAULT_SETTINGS = {
#     'PHOTO_STORAGE': settings.DEFAULT_FILE_STORAGE,
#     'ORDERING': ('last_name', 'first_name'),
# }
# USER_SETTINGS = DEFAULT_SETTINGS.copy()
#     USER_SETTINGS['ORDERING'] = settings.STAFF_ORDERING
#     USER_SETTINGS['PHOTO_STORAGE'] = settings.STAFF_PHOTO_STORAGE


# Path: staff/models.py
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.files.storage import get_storage_class
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django_localflavor_us.models import PhoneNumberField
from .fields import RemovableImageField
from .settings import PHOTO_STORAGE, ORDERING
    from django.core.exceptions import ImproperlyConfigured
        from django.db import transaction
    from django.db.models.signals import post_save

        _('Title'),
        max_length=50,
        blank=True,
        default="")
    bio = models.TextField(_('Biography'), blank=True)
    is_active = models.BooleanField(_('is a current employee'), default=True)
    phone = PhoneNumberField(_('Phone Number'), blank=True)
    photo = RemovableImageField(_('Photo'),
        blank=True,
        upload_to='img/staff/%Y',
        storage=DEFAULT_STORAGE(),
        height_field='photo_height',
        width_field='photo_width')
    photo_height = models.IntegerField(default=0, blank=True)
    photo_width = models.IntegerField(default=0, blank=True)
    twitter = models.CharField(_('Twitter ID'),
        max_length=100,
        blank=True)
    facebook = models.CharField(_('Facebook Acccount'),
        max_length=100,
        blank=True)
    google_plus = models.CharField(_('Google+ ID'),
        max_length=100,
        blank=True)
    website = models.URLField(_('Website'),
        blank=True)

    objects = StaffMemberManager()

    class Meta:

        ordering = ORDERING