added offersneeds app
This commit is contained in:
parent
01f5996b02
commit
df757a0ea8
0
itf/offersneeds/__init__.py
Normal file
0
itf/offersneeds/__init__.py
Normal file
16
itf/offersneeds/forms.py
Normal file
16
itf/offersneeds/forms.py
Normal 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
29
itf/offersneeds/models.py
Normal 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
16
itf/offersneeds/tests.py
Normal 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
1
itf/offersneeds/views.py
Normal file
|
@ -0,0 +1 @@
|
|||
# Create your views here.
|
Loading…
Reference in New Issue
Block a user