from django.db import models
from app.models import ItfModel
from django.contrib.auth.models import User


class Offer(ItfModel):
    form_names = ['OfferForm']
    main_form = 'OfferForm'
    fts_fields = ['title', 'description']
    user = models.ForeignKey(User)
    title = models.CharField(max_length=255)
    description = models.TextField(blank=True)

    def __unicode__(self):
        return self.title

    def get_dict(self):
        return {
            'title': self.title,
            'description': self.description
        }    


class Need(ItfModel):
    form_names = ['NeedForm']
    main_form = 'NeedForm'
    fts_fields = ['title', 'description']
    user = models.ForeignKey(User)
    title = models.CharField(max_length=255)
    description = models.TextField(blank=True)

    def __unicode__(self):
        return self.title

    def get_dict(self):
        return {
            'title': self.title,
            'description': self.description
        }    


# Create your models here.
