class MyTable(models.Model):
lat = models.FloatField(blank=True)开发者_JS百科
long = models.FloatField(blank=True)
How do I make them signed? Able to accept negative .
FloatField
can accept floating point numbers, negatives included.
If you need positive-only integers, there's PositiveIntegerField. Positive-only floats are a much rarer need, so I don't think they're natively supported - but you can, of course, implement this restriction programatically.
精彩评论