def seed(): Session = sessionmaker(bind=engine) session = Session() domain = models.Domain(url='https://register.start.bg') link = models.Link(url=domain.ulr, domain=domain) session.add(domain) session.add(link) session.commit()
def seed(): Session = sessionmaker(bind=engine) session = Session() domain1 = models.Domain(url='http://register.start.bg/') link1 = models.Link(url=domain1.url, domain=domain1) session.add(domain1) session.add(link1) session.commit()
def addDomain(organization_name, domain): key = domain row = models.Domain(key_name=key) row.organisation_name = organization_name row.domain = domain row.put()
def get_or_create_domain(name): try: domain = models.Domain.select(models.Domain.q.name == name)[0] except IndexError: domain = models.Domain(name=name) return domain