Possible bug in django oracle backend - no way to map from model type to oracle NUMBER type.
Currently I'm working with some oracle legacy db which I would like to access using django ORM. I have a column of type NUMERIC (without precision and scale) and all possible values are kept there (for example, 65, 2.3, 0.5) After running inspectdb django suggested that this column should be of type models.DecimalField(unique= True, null=True, max_digits=0, decimal_places=-127, blank=True) but this makes little sense since I'm getting an error when trying to do syncdb from this model: Error: One or more models did not validate: DecimalFields require a "decimal_places" attribute that is a non-negative integer. DecimalFields require a "max_digits" attribute that is a positive integer. Do you know what type in model will map to NUMBER in oracle? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/Mk8B4oBeE4IJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Possible bug in django oracle backend - no way to map from model type to oracle NUMBER type.
On Wed, Oct 17, 2012 at 7:26 AM, Michał Nowotka wrote: > Currently I'm working with some oracle legacy db which I would like to > access using django ORM. > I have a column of type NUMERIC (without precision and scale) and all > possible values are kept there (for example, 65, 2.3, 0.5) > After running inspectdb django suggested that this column should be of type > models.DecimalField(unique= True, null=True, max_digits=0, > decimal_places=-127, blank=True) but this makes little sense since I'm > getting an error when trying to do syncdb from this model: > > Error: One or more models did not validate: DecimalFields require a > "decimal_places" attribute that is a non-negative integer. > DecimalFields require a "max_digits" attribute that is a positive integer. > > Do you know what type in model will map to NUMBER in oracle? This is a question for the django-users mailing list. django-dev is exclusively for the development OF Django not for development WITH Django. To answer your question. Take a look at this file frm the source code, it might be fo help: https://github.com/django/django/blob/master/django/db/backends/oracle/creation.py -- Ramiro Morales -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Possible bug in django oracle backend - no way to map from model type to oracle NUMBER type.
On Wed, Oct 17, 2012 at 4:26 AM, Michał Nowotka wrote: > Currently I'm working with some oracle legacy db which I would like to > access using django ORM. > I have a column of type NUMERIC (without precision and scale) and all > possible values are kept there (for example, 65, 2.3, 0.5) > After running inspectdb django suggested that this column should be of type > models.DecimalField(unique= True, null=True, max_digits=0, > decimal_places=-127, blank=True) but this makes little sense since I'm > getting an error when trying to do syncdb from this model: > > Error: One or more models did not validate: DecimalFields require a > "decimal_places" attribute that is a non-negative integer. > DecimalFields require a "max_digits" attribute that is a positive integer. > > Do you know what type in model will map to NUMBER in oracle? There is none. The proper type would be a floating-point DecimalField, but Django doesn't allow that as the decimal_places attribute is required. I'm not really sure why that is; maybe the requirement could be relaxed? If you don't need a lot of precision, then you could probably get away with using a FloatField. Otherwise you might want consider creating a custom field that looks like a FloatField but uses decimals instead of floats. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: Possible bug in django oracle backend - no way to map from model type to oracle NUMBER type.
On Wed, 2012-10-17 at 12:16 -0600, Ian Kelly wrote: > > Do you know what type in model will map to NUMBER in oracle? > > There is none. The proper type would be a floating-point > DecimalField, but Django doesn't allow that as the decimal_places > attribute is required. I'm not really sure why that is; maybe the > requirement could be relaxed? > > If you don't need a lot of precision, then you could probably get away > with using a FloatField. Otherwise you might want consider creating a > custom field that looks like a FloatField but uses decimals instead of > floats. > Not if you have a "legacy" database which uses NUMBER, I'm guessing... I'd have thought the inability to work with any particular common field type should be a bug, as it could effectively prevent working with non-managed models altogether. Cheers, Nick -- Nick Phillips / +64 3 479 4195 / nick.phill...@otago.ac.nz # these statements are my own, not those of the University of Otago -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
[ANN] Django 1.4.2 and 1.3.4 remedy security issues
Django 1.4.2 and 1.3.4 have just been released in response to a security issue reported to us. Details are here: https://www.djangoproject.com/weblog/2012/oct/17/security/ Everyone is encouraged to upgrade. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: [ANN] Django 1.4.2 and 1.3.4 remedy security issues
Django==1.3.4 doesn't appear to be on Pypi, is it likely to be there soon? On Thursday, 18 October 2012 09:38:49 UTC+11, James Bennett wrote: > > Django 1.4.2 and 1.3.4 have just been released in response to a > security issue reported to us. > > Details are here: > > https://www.djangoproject.com/weblog/2012/oct/17/security/ > > Everyone is encouraged to upgrade. > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/dGLC9Oh_V5gJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: [ANN] Django 1.4.2 and 1.3.4 remedy security issues
Seems to be there: http://pypi.python.org/pypi/Django/1.3.4 and pip installs it fine. pypi will always favor the latest version -Preston On Wednesday, October 17, 2012 4:37:12 PM UTC-7, Ross Poulton wrote: > > Django==1.3.4 doesn't appear to be on Pypi, is it likely to be there soon? > > On Thursday, 18 October 2012 09:38:49 UTC+11, James Bennett wrote: >> >> Django 1.4.2 and 1.3.4 have just been released in response to a >> security issue reported to us. >> >> Details are here: >> >> https://www.djangoproject.com/weblog/2012/oct/17/security/ >> >> Everyone is encouraged to upgrade. >> > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/AHesja4nyhQJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.