Django

Code

Ticket #484 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

FloatField with decimal_places but not max_digits causes mysql error.

Reported by: mmarshall Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

A FloatField? that uses decimal_places without max_digits results in using numeric(None, 2). This causes an error in mysql (at least.)

I can see two ways to fix this:

  • Update the docs with this info and/or throw a helpful error message.
  • Set the max_digits to the maximum possible. (255-decimal_places, on mysql at least.)

Note that the same thing also happens when you have max_digits without decimal_places.

MWM

Attachments

Change History

11/20/05 16:28:58 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [1314]) Fixed #484 -- Model validator now raises an error for FloatFields? without max_digits or decimal_places


Add/Change #484 (FloatField with decimal_places but not max_digits causes mysql error.)




Change Properties
Action