mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-30 17:23:55 +02:00
Second revision of Domain model draft
This commit is contained in:
parent
523c699865
commit
2b91a3c1d1
12 changed files with 561 additions and 33 deletions
30
src/registrar/models/host_ip.py
Normal file
30
src/registrar/models/host_ip.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from django.db import models
|
||||
from django.core.validators import validate_ipv46_address
|
||||
|
||||
from .utility.time_stamped_model import TimeStampedModel
|
||||
from .host import Host
|
||||
|
||||
class HostIP(TimeStampedModel):
|
||||
"""
|
||||
Hosts may have one or more IP addresses.
|
||||
|
||||
The registry is the source of truth for this data.
|
||||
|
||||
This model exists ONLY to allow a new registrant to draft DNS entries
|
||||
before their application is approved.
|
||||
"""
|
||||
address = models.CharField(
|
||||
max_length=46,
|
||||
null=False,
|
||||
blank=False,
|
||||
default=None, # prevent saving without a value
|
||||
validators=[validate_ipv46_address],
|
||||
help_text="IP address",
|
||||
)
|
||||
|
||||
host = models.ForeignKey(
|
||||
Host,
|
||||
on_delete=models.PROTECT,
|
||||
help_text="Host to which this IP address belongs",
|
||||
)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue