David Lopez
David Lopez

Reputation: 83

How can I put a ip field with the cidr?

I have a field in Django Models like this:

ip = models.GenericIPAddressField()

But with this field I can't save the CIDR, How could I do? I should put a new field for the CIDR?

Thanks!!

Upvotes: 1

Views: 1054

Answers (1)

Paul
Paul

Reputation: 6737

Django has no specific CIDR type for fields: https://code.djangoproject.com/ticket/1636 This bug is marked as 'won't fix'.

I believe you can use charfield or make custom field type.

Upvotes: 1

Related Questions