zoukankan      html  css  js  c++  java
  • django startapp报 maximum recursion depth exceeded

    报错截图如下:

    解决办法:修改指定路径下的functools.py文件的def total_ordering(cls):方法:

    原来的样子:

    convert = {
            '__lt__': [('__gt__', lambda self, other: other < self),
                       ('__le__', lambda self, other: not other < self),
                       ('__ge__', lambda self, other: not self < other)],
            '__le__': [('__ge__', lambda self, other: other <= self),
                       ('__lt__', lambda self, other: not other <= self),
                       ('__gt__', lambda self, other: not self <= other)],
            '__gt__': [('__lt__', lambda self, other: other > self),
                       ('__ge__', lambda self, other: not other > self),
                       ('__le__', lambda self, other: not self > other)],
            '__ge__': [('__le__', lambda self, other: other >= self),
                       ('__gt__', lambda self, other: not other >= self),
                       ('__lt__', lambda self, other: not self >= other)]
        }
    

    修改后的样子:

    convert = {  
        '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),  
                   ('__le__', lambda self, other: self < other or self == other),  
                   ('__ge__', lambda self, other: not self < other)],  
        '__le__': [('__ge__', lambda self, other: not self <= other or self == other),  
                   ('__lt__', lambda self, other: self <= other and not self == other),  
                   ('__gt__', lambda self, other: not self <= other)],  
        '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),  
                   ('__ge__', lambda self, other: self > other or self == other),  
                   ('__le__', lambda self, other: not self > other)],  
        '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),  
                   ('__gt__', lambda self, other: self >= other and not self == other),  
                   ('__lt__', lambda self, other: not self >= other)]  
    }  
    

    改完之后即可创建app

      

      

  • 相关阅读:
    查看网络接口
    httpd sshd firewalld 很多服务后面的d是什么意思
    CentOS7入门
    1005:取余,循环,找规律
    1006 Tick and Tick
    cv.Mat 与 .txt 文件数据的读写操作
    禁止别人用QQ号搜索到你,同时告诉你如何破解
    LaTex初学
    github上对一些名词的理解(之如fork)
    CCF Z字形扫描
  • 原文地址:https://www.cnblogs.com/phyger/p/8628821.html
Copyright © 2011-2022 走看看