ti possible CommaSeparatedIpField

17 views
Skip to first unread message

Jorge Cadena

unread,
Aug 30, 2016, 6:29:20 PM8/30/16
to Django users
Hi

I have a idea CommaSeparatedIpField, it possible ?

this for validacion IP ACL list in FreeSWITCH.

ludovic coues

unread,
Aug 31, 2016, 4:47:09 AM8/31/16
to django...@googlegroups.com
If you are asking if it is possible to create such field, the response
is yes, you can create such field.
Looking at the source of CommaSeparatedIntegerField, you can see it's
a simple CharField with a validate_comma_separated_integer_list
validator and a custom error message.

You could also have an IPAdress model and a manytomany field in the
model in place of CommaSeparatedIpField. As an added bonus, the
IPAddress model could have extra field like a description for the ip.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9d5d8359-ce30-41c8-8d88-2733b32ad76d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

Gergely Polonkai

unread,
Aug 31, 2016, 8:19:06 AM8/31/16
to Django users
Hello,

although it is possible, I'd go with an IP field and generate a list of them, comma separated, at run time. This will make it easier to search and manage the list.

Best,

Gergely


--
Reply all
Reply to author
Forward
0 new messages