Tuesday, December 29, 2015

Re: 'CharField' object has no attribute 'model'

I only read the code.

I don't know if you refactorize your code, but based in the code above, I think is like this:

class QuestionAnswer(models.Model):
  ...


class QuizAttempt(models.Model):
 ...
 questions_included = models.ForeignKey(QuestionAnswer)



2015-12-28 22:57 GMT-06:00 Billu <billu.mandal@gmail.com>:
Thanks, I had changed it to 

questions_included = models.ForeignKey('quiz.Question', null=True)

and also changed the db from Postgresql to Sqlite. Will see if this problem again comes up.

@luisza14 - did you find out by going through the code or are there any other ways to find out?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c81161c4-8167-444d-b10a-20e3fceab550%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG%2B5VyMoe%2BEgi6jykxq8TAFOu%2BZttDNDSYWfvw9niM5%2BQbD%3DJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment