mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-06 11:13:21 +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.py
Normal file
30
src/registrar/models/host.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from django.db import models
|
||||
|
||||
from .utility.time_stamped_model import TimeStampedModel
|
||||
from .domain import Domain
|
||||
|
||||
class Host(TimeStampedModel):
|
||||
"""
|
||||
Hosts are internet-connected computers.
|
||||
|
||||
They may handle email, serve websites, or perform other tasks.
|
||||
|
||||
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.
|
||||
"""
|
||||
name = models.CharField(
|
||||
max_length=253,
|
||||
null=False,
|
||||
blank=False,
|
||||
default=None, # prevent saving without a value
|
||||
unique=True,
|
||||
help_text="Fully qualified domain name",
|
||||
)
|
||||
|
||||
domain = models.ForeignKey(
|
||||
Domain,
|
||||
on_delete=models.PROTECT,
|
||||
help_text="Domain to which this host belongs",
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue