# Path: twobuntu/news/forms.py
# class AddItemForm(forms.ModelForm):
#     """
#     Form for adding news items.
#     """
# 
#     class Meta:
#         model = Item
#         fields = ('title', 'body', 'url')


import twitter
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.db import transaction
from django.shortcuts import redirect, render
from twobuntu.news.forms import AddItemForm



@user_passes_test(lambda u: u.is_staff)
def add(request):
    """
    Add news items to the home page.
    """
    if request.method == 'POST':

# Path: twobuntu/news/forms.py
# class AddItemForm(forms.ModelForm):
#     """
#     Form for adding news items.
#     """
# 
#     class Meta:
#         model = Item
#         fields = ('title', 'body', 'url')


# Path: twobuntu/news/views.py
import twitter
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.db import transaction
from django.shortcuts import redirect, render
from twobuntu.news.forms import AddItemForm




@user_passes_test(lambda u: u.is_staff)
def add(request):
    """
    Add news items to the home page.
    """
    if request.method == 'POST':

        form = AddItemForm(data=request.POST)