Sunday, March 29, 2015

Django system check gives error when storing method in variable

Hi all,

Haven't used Django 1.7.7 till today, but whenever I want to launch my
project I get the following error:
ERRORS:
gopro.MyPayment: (models.E020) The 'MyPayment.check()' class method is
currently overridden by <function MollieIdealPayment.is_paid at
0x7f0716731b90>.

I use another django app
(https://github.com/wmiltenburg/django-mollie-ideal) inside the app that
I am currently writing. The problem seems to be relating to line 75 in
models.py
(https://github.com/wmiltenburg/django-mollie-ideal/blob/master/mollie/ideal/models.py,
check = is_paid), where is_paid is a method. If I comment it out it
works fine. However, this used to work in previous Django releases (1.6)
and it is valid Python code. In Django 1.7 it shows the following error:
TypeError: is_paid() missing 1 required positional argument: 'self'.

The error shows up when Django performs the system checks. My guess is
that the "system check" from Django 1.7 doesn't handle function
referencing in Python well (which used to be in Django 1.6). However, I
am wondering if this is a more of a general problem in Django itself and
if other users experience the same problem.

Cheers,
Wouter.

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5518207A.2080308%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment