from django.db import models

from generic.models import AuditModel, LocationModel

from django_fsm import FSMField


class Resource(AuditModel, LocationModel):
    """
        A Resource Brought Forward by the people
    """

    class Meta:
        verbose_name = 'Resource'
        verbose_name_plural = 'Resources'

    STATES = ('Available', 'Expired',)
    STATES = list(zip(STATES, STATES))

    title = models.CharField(max_length=200)
    slug = models.SlugField(unique=True)
    short_description = models.CharField(max_length=300)
    long_description = models.CharField(max_length=4096)
    status = FSMField(default=STATES[0], choices=STATES)
    extra_information = models.CharField(max_length=1000, null=True, blank=True)

    def __str__(self):
        return self.title
