get_dict methods
This commit is contained in:
parent
5c3274da80
commit
c4c2c640ce
|
@ -6,6 +6,7 @@ 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)
|
||||
|
@ -13,10 +14,17 @@ class Offer(ItfModel):
|
|||
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)
|
||||
|
@ -24,6 +32,11 @@ class Need(ItfModel):
|
|||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
def get_dict(self):
|
||||
return {
|
||||
'title': self.title,
|
||||
'description': self.description
|
||||
}
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
|
Loading…
Reference in New Issue
Block a user