from django.db import models
from django.forms import ModelForm
from datetime import date

# Create your models here.
class Nameserver(models.Model):
    hostname = models.CharField(max_length=100, unique=True)
    ip_address = models.GenericIPAddressField()
    api_auth_key = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now=True, auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True, auto_now_add=True)

    class Meta:
        db_table = 'nameserver'

    def __unicode__(self):
        return self.hostname

class NameserverForm(ModelForm):
    class Meta:
        model = Nameserver
