开发者

How do I have signed fields in Django?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜