I am creating an application which needs a commenting system. I decided to use the comment app of Django, but needed to alter it a bit. First I do not want the user's email id to be mandatory and next I need an option to attach a file with the comment.
Thus I decided to subclass from BaseCommentAbstractModel. Now I need to override the user_email to be
user_email= models.EmailField(max_length=100, blank=True)
and add another field
file = models.FileField(upload_to='data/files')
My code should look like this:
from django.db import models
from django.contrib.comments.models import BaseCommentAbstractModel
class CommentWithFile(BaseCommentAbstractModel):
'''This is a hack of the Comment model to remove email and add a filefield'''
user_email = models.EmailField(max_length=100, blank=True)
file = models.FileField(upload_to='data/files')
but this does not work. The user_email is still mandatory. Any ideas?