# Path: dnsforever/config.py



from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, Unicode, Boolean, DateTime, \
    UnicodeText
from sqlalchemy import ForeignKey
from sqlalchemy.orm import sessionmaker, validates, relationship
from sqlalchemy.sql import functions
from sqlalchemy.ext.declarative import declarative_base
from dnsforever.config import database_url, webforwarding_domain
import re
import unittest
import string
import random
        self.type = u'A'
        self.ddns_key = random_string(10)
        self.memo = memo

    id = Column(Integer, ForeignKey('record.id'), primary_key=True)
    ddns_key = Column(Unicode(80), nullable=False)
    memo = Column(UnicodeText, default=u'')

    @property
    def ip(self):
        return self.rdata

    @ip.setter
    def ip(self, value):
        self.rdata = value

    def reset_key(self):
        self.ddns_key = random_string(10)


class RecordWebForwarding(Record):
    __tablename__ = 'record_webforwarding'

    __mapper_args__ = {
        'polymorphic_identity': 'webforwarding',
    }

    def __init__(self, domain, name, target_url, type='iframe', ttl=3600):
        self.domain = domain
        self.name = name

# Path: dnsforever/config.py



# Path: dnsforever/models.py
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, Unicode, Boolean, DateTime, \
    UnicodeText
from sqlalchemy import ForeignKey
from sqlalchemy.orm import sessionmaker, validates, relationship
from sqlalchemy.sql import functions
from sqlalchemy.ext.declarative import declarative_base
from dnsforever.config import database_url, webforwarding_domain
import re
import unittest
import string
import random

        self.type = u'A'
        self.ddns_key = random_string(10)
        self.memo = memo

    id = Column(Integer, ForeignKey('record.id'), primary_key=True)
    ddns_key = Column(Unicode(80), nullable=False)
    memo = Column(UnicodeText, default=u'')

    @property
    def ip(self):
        return self.rdata

    @ip.setter
    def ip(self, value):
        self.rdata = value

    def reset_key(self):
        self.ddns_key = random_string(10)


class RecordWebForwarding(Record):
    __tablename__ = 'record_webforwarding'

    __mapper_args__ = {
        'polymorphic_identity': 'webforwarding',
    }

    def __init__(self, domain, name, target_url, type='iframe', ttl=3600):
        self.domain = domain
        self.name = name

        self.rdata = webforwarding_domain