﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
94	Mysterious error	Joey Marshall	Adrian Holovaty	"I am trying to create a module for news, but with the code below, it reports a mysterious error.
When trying to add a news item, it says ""Please correct the errors below."", but it doesn't show any like it normally does. :/   I'm thinking it's just a stupid mistake on my part as I'm new to this (oh, I guess pretty much every one is right now ;) ) and rather new to python programming (and I've done little with object oriented coding).

So if someone could help me out, that would be great!


{{{
# 'news' module code:

from django.core import meta
from django.models import auth, core

# Create your models here.

class News(meta.Model):
    fields = (
        meta.ForeignKey(auth.User, raw_id_admin=True),
        meta.CharField('title', maxlength=200),
        meta.DateTimeField('pub_date', 'date published'),
 meta.TextField('body',),
 meta.ManyToManyField(auth.Group, blank=True, help_text=""Select which user groups will see this news article.""),
    )
    
    admin = meta.Admin(
        fields = (
            (None, {'fields': ('title','body')}),
            ('Date information', {'fields': ('pub_date',)}),
     ('Groups', {'fields': ('groups',)}),
        ),
        list_display = ('title', 'pub_date', 'groups', 'was_published_today'),
        list_filter = ('pub_date', ),
        search_fields = ('title', ),
        date_hierarchy = 'pub_date',
    )
    
    
    def __repr__(self):
        return self.title
        
    def was_published_today(self):
        if self.pub_date.date() == datetime.date.today():
            return ""Yes""
        else:
            return ""No""
    was_published_today.short_description = 'Was published today'
}}}"	defect	closed	contrib.admin		normal	fixed			Ready for checkin	0	0	0	0	0	0
