On Fri, Oct 5, 2012 at 3:56 PM, Demian Brecht <demianbre...@gmail.com> wrote:
>
>>> class QuestionSet(models.Model):
>>>      title = models.CharField(max_length=100)
>>>      description = models.TextField()
>>>      order = models.IntegerField()
>>>
>>>      def __init__(self, *args, **kwargs):
>>>          self.title = kwargs.get('title','Default Title')
>>>          self.description = kwargs.get('description', 'DefDescription')
>>>          self.order = kwargs.get('order', 0)
>
>
> One thing that looks suspect to me here is that you're not calling __init__
> on models.Model.
>

I'm sure the OP from June 2010 will be pleased that his question has
been answered so many times…

Cheers

Tom

PS: To call the parent class(es) constuctor(s) correctly when using
python "new style" classes (ie: all Django classes and classes derived
from Django classes), you should use super(ClassName, self).__init__()
and not call the base class directly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to