2011/1/31 arief nur andono <ariefnurand...@gmail.com>

> sorry for undetail, i use oracle
>
> this is output example from my inspectdb, this is one of 300 table i have
>
> from django.db import models
>
> class TempJmlGangguanPyl(models.Model):
>     singkatpyl = models.CharField(max_length=4, blank=True)
>     singkatgrd = models.CharField(max_length=4, blank=True)
>     jumlah_gangguan = models.DecimalField(null=True, max_digits=0,
> decimal_places=-127, blank=True)
>     lama_gangguan = models.DecimalField(null=True, max_digits=0,
> decimal_places=-127, blank=True)
>     class Meta:
>         db_table = u'temp_jml_gangguan_pyl'
>
> class TempJmlGangguanWilayah(models.Model):
>     kodeupp = models.CharField(max_length=2, blank=True)
>     singkatgrd = models.CharField(max_length=4, blank=True)
>     jumlah_gangguan = models.DecimalField(null=True, max_digits=0,
> decimal_places=-127, blank=True)
>     lama_gangguan = models.TextField(blank=True)
>     class Meta:
>         db_table = u'temp_jml_gangguan_wilayah'
>
> class TempPylAkhir(models.Model):
>     singkatpyl = models.CharField(max_length=4, blank=True)
>     nolanggan = models.CharField(max_length=12, blank=True)
>     nama = models.CharField(max_length=30, blank=True)
>     alamat = models.CharField(max_length=50, blank=True)
>     singkatgrd = models.CharField(max_length=4, blank=True)
>     notiangtr = models.CharField(max_length=29, blank=True)
>     golongantarip = models.CharField(max_length=4, blank=True)
>     daya = models.IntegerField(null=True, blank=True)
>     jumlah_gangguan = models.DecimalField(null=True, max_digits=0,
> decimal_places=-127, blank=True)
>     lama_gangguan = models.DecimalField(null=True, max_digits=0,
> decimal_places=-127, blank=True)
>     kelas_slk = models.IntegerField(null=True, blank=True)
>     class Meta:
>         db_table = u'temp_pyl_akhir'
>
> actually the real table name is beban_harian_trafogi_teg
>
> and this is a small part errors that django says when i python manage.py
> syncdb
>
> simdis.tempjmlgangguangrd: "jumlah_gangguan": DecimalFields require a
> "max_digits" attribute that is a positive integer.
> simdis.tempjmlgangguangrd: "lama_gangguan": DecimalFields require a
> "decimal_places" attribute that is a non-negative integer.
> simdis.tempjmlgangguangrd: "lama_gangguan": DecimalFields require a
> "max_digits" attribute that is a positive integer.
> simdis.tempjmlgangguanpyl: "jumlah_gangguan": DecimalFields require a
> "decimal_places" attribute that is a non-negative integer.
> simdis.tempjmlgangguanpyl: "jumlah_gangguan": DecimalFields require a
> "max_digits" attribute that is a positive integer.
> simdis.tempjmlgangguanpyl: "lama_gangguan": DecimalFields require a
> "decimal_places" attribute that is a non-negative integer.
> simdis.tempjmlgangguanpyl: "lama_gangguan": DecimalFields require a
> "max_digits" attribute that is a positive integer.
> simdis.tempjmlgangguanwilayah: "jumlah_gangguan": DecimalFields require a
> "decimal_places" attribute that is a non-negative integer.
> simdis.tempjmlgangguanwilayah: "jumlah_gangguan": DecimalFields require a
> "max_digits" attribute that is a positive integer.
> simdis.temppylakhir: "jumlah_gangguan": DecimalFields require a
> "decimal_places" attribute that is a non-negative integer.



In your models you have:

max_digits=0, decimal_places=-127

this is error... max_digits must be positive and decimal_places must
be non-negative.

http://docs.djangoproject.com/en/1.2/ref/models/fields/#decimalfield

-- 
Simo

- Registered Linux User #395060

- Software is like sex, it is better when it is free  --> Linus B. Torvalds

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to