In my django app's models.py, I inherit from two classes: models.Model and a class called Isbn10 from an imported Python module pyisbn. However, if I try to create an instance of the class, I get a TypeError: __init__() takes exactly 2 arguments (1 given)
I've tried reversing the parent class order, but it didn't help.
Model:
from django.db import models
import pyisbn
class Book10(pyisbn.Isbn10, models.Model):
pass
Isbn Class definition (defined in pyisbn module):
class Isbn(object):
def __init__(self, isbn):
super(Isbn, self).__init__()
self._isbn = isbn
if len(isbn) in (9, 12):
self.isbn = _isbn_cleanse(isbn, False)
else:
self.isbn = _isbn_cleanse(isbn)