An warware: %22DO_NOTHING%22 ba a ayyana django

ba da gudummawa.auth

Babu ฦ™ayyadaddun hali don tace %22DO_NOTHING%22 a Django. Wannan na iya haifar da sakamako mara tsammani idan aka yi amfani da su a samfuri ko kallo.

.db.utils.ProgrammingError: %22DO_NOTHING%22 is not defined

I'm trying to run a migration in Django, but I get the following error:
<code>django.db.utils.ProgrammingError: %22DO_NOTHING%22 is not defined</code>
The migration file looks like this:
<code># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-08-18 13:16
from __future__ import unicode_literals

    from django.db import migrations, models

    class Migration(migrations.Migration):

        dependencies = [("myapp", "0004_auto_20170818_1255")]

        operations = [migrations.AlterField(model_name="mymodel", name="field1", field=models.ForeignKey(null=True, on_delete=models.DO_NOTHING, related_name="+", to="myapp"))]  # noqa</code>
The model it's referring to looks like this (the field in question is <code>field1</code>) : 
<code>class MyModel(models.Model):

    field1 = models.... # other fields here</code>  # noqa

Kuskuren yana cewa DO_NOTHING Ba a fayyace zaษ“i ba - wannan yana yiwuwa saboda ba a tallafawa a cikin sigar Django da kuke amfani da ita. Don gyara wannan, zaku iya sabunta Django zuwa sabon sigar, ko canza on_delete zaษ“i zuwa wani abu dabam wanda aka goyan baya.

Warware Django 'Handler' ba a bayyana shi ba

Wannan kuskuren ya samo asali ne sakamakon ษ“acewar bayanin shigo da kaya a cikin aikin ku na Django. Kuna iya gyara wannan ta ฦ™ara layin da ke gaba zuwa sashin shigo da aikin ku:

daga django.contrib.auth.models shigo da Mai amfani

Idan kana amfani da ษ—akin karatu na tantancewa na ษ“angare na uku, ฦ™ila ka buฦ™aci ฦ™ara shigo da shi shima.

Shafi posts:

Leave a Comment