Попытка сделать модель в Django - PullRequest
0 голосов
/ 09 января 2020

Нажав на приведенный ниже запрос и попытаясь сохранить в БД и получить ошибку ())

new_tutorial.save ()

Tutorial.objects.all ()

 ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\Anaconda3\lib\site-packages\IPython\core\formatters.py in __call__(self, obj)
    700                 type_pprinters=self.type_printers,
    701                 deferred_pprinters=self.deferred_printers)
--> 702             printer.pretty(obj)
    703             printer.flush()
    704             return stream.getvalue()

~\Anaconda3\lib\site-packages\IPython\lib\pretty.py in pretty(self, obj)
    398                         if cls is not object \
    399                                 and callable(cls.__dict__.get('__repr__')):
--> 400                             return _repr_pprint(obj, self, cycle)
    401
    402             return _default_pprint(obj, self, cycle)

~\Anaconda3\lib\site-packages\IPython\lib\pretty.py in _repr_pprint(obj, p, cycle)
    693     """A pprint that just redirects to the normal repr function."""
    694     # Find newlines and replace them with p.break_()
--> 695     output = repr(obj)
    696     for idx,output_line in enumerate(output.splitlines()):
    697         if idx:

~\Anaconda3\lib\site-packages\django\db\models\query.py in __repr__(self)
    245         if len(data) > REPR_OUTPUT_SIZE:
    246             data[-1] = "...(remaining elements truncated)..."
--> 247         return '<%s %r>' % (self.__class__.__name__, data)
    248
    249     def __len__(self):

~\Anaconda3\lib\site-packages\django\db\models\base.py in __repr__(self)
    501
    502     def __repr__(self):
--> 503         return '<%s: %s>' % (self.__class__.__name__, self)
    504
    505     def __str__(self):

TypeError: __str__() takes 0 positional arguments but 1 was given
...