added offersneeds app

This commit is contained in:
Sanj 2012-08-08 03:13:29 +05:30
parent 01f5996b02
commit df757a0ea8
5 changed files with 62 additions and 0 deletions

View File

16
itf/offersneeds/forms.py Normal file
View File

@ -0,0 +1,16 @@
import floppyforms as forms
from models import *
from app.forms import *
class OfferForm(ItfForm):
pass
class Meta:
model = Offer
class NeedForm(ItfForm):
pass
class Meta:
model = Need

29
itf/offersneeds/models.py Normal file
View File

@ -0,0 +1,29 @@
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'
user = models.ForeignKey(User)
title = models.CharField(max_length=255)
description = models.TextField(blank=True)
def __unicode__(self):
return self.title
class Need(ItfModel):
form_names = ['NeedForm']
main_form = 'NeedForm'
user = models.ForeignKey(User)
title = models.CharField(max_length=255)
description = models.TextField(blank=True)
def __unicode__(self):
return self.title
# Create your models here.

16
itf/offersneeds/tests.py Normal file
View File

@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

1
itf/offersneeds/views.py Normal file
View File

@ -0,0 +1 @@
# Create your views here.