2014-09-21 5 views
0

나는 장고에서 초보자이며 이것을 해결하는 방법을 모른다.다음 속성 오류를 수정하려면 어떻게합니까?

컨텍스트 : 오라클 11g와

  • 1 .- 장고.

내가 'lower'와 다른 'attributeError'을 읽고,하지만 난 'nltk.pos_tag(clean)'으로 아카이브를 찾을 수 없습니다 cmd를 파이썬 manage.py의 syncdb에서

  • 2.-는 3 .- 메시지 오류가
  • 입니다 (Python AttributeError: 'tuple' object has no attribute 'lower')

    내 models.py는 정상적인 모델이며 오류는 드라이버에 있습니다 (나는 그렇게 생각합니다). 장고의 공식 웹 사이트에서 나는 우리가 오라클에 (작은 따옴표)를이 사용을 참조하십시오

    *class Meta: 
        db_table ='"desactivacion_empresa"',* 
    
    File "C:\Python27\lib\site-packages\django\db\backends\oracle\ 
    introspection.py", line 64, in table_name_converter 
    return name.lower() 
    

    반성의 (64)는 라인 (예를 들어) : 정말

    *def table_name_converter(self, name): 
        "Table name comparison is case insensitive under Oracle" 
        return name.lower()* 
    

    나는 ... 무엇을 해야할지하지 않습니다


    편집 예를 들어 전체 모델 : 당신이 db_table 속성 후 길 잃은 ,을 가지고있는 것처럼

    class desactivacion_empresa(models.Model): 
        id_desactivacion = models.AutoField(primary_key = True) 
        empresa_involucrada = models.ForeignKey(empresa_contacto) 
        fecha_desactivacion = models.DateTimeField(
         auto_now = True, 
         blank = False, 
         null = False 
        ) 
        fecha_activacion = models.DateTimeField(
         blank = False, 
         null = True 
        ) 
        motivo_desactivacion = models.TextField(
         blank = False, 
         null = False 
        ) 
        class Meta: 
         db_table ='"desactivacion_empresa"', 
         verbose_name = 'Desactivación de empresa', 
         verbose_name_plural = 'Desactivaciones de las empresas' 
    
        def __unicode__(self): 
         return self.fecha_desactivacion 
    
  • 답변

    0

    보인다. 변경하려면

    class Meta: 
        db_table = "desactivacion_empresa" 
        #        ^remove the stray , 
    

    또한 따옴표를 제거하십시오. 당신의 편집을 바탕으로

    , 단지 변경 클래스의 메타

    class Meta: 
        db_table = "desactivacion_empresa" 
        verbose_name = 'Desactivación de empresa' 
        verbose_name_plural = 'Desactivaciones de las empresas' 
    
    +0

    가 하였다 :

    ,

    데모

    >>> x = "a", >>> type(x) <type 'tuple'> >>> y = "a" >>> type(a) <type 'int'> >>> 

    편집 튜플로 해석되는 문자열을 만든다 예를 들면. 전체 메타은 다음과 같습니다 \t 클래스 메타 : \t \t db_table = ' "desactivacion_empresa"' \t \t verbose_name = 'Desactivación 드 Empresa 연락처', \t \t verbose_name_plural = 'Desactivaciones 드 라스의 empresas' – HawksGaze

    +0

    작은 따옴표를 위해, 나는 이것을 읽으십시오 : https://docs.djangoproject.com/en/dev/ref/models/options/ – HawksGaze

    +0

    아니오. 따옴표 중 하나가 필요합니다. 또한 메타 속성은 한 줄에 하나이며 쉼표로 구분되지 않습니다 ... – karthikr

    관련 문제