# Path: farmsList/database.py
# class CRUDMixin(object):
# class Model(CRUDMixin, db.Model):
# class SurrogatePK(object):
#     def create(cls, **kwargs):
#     def update(self, commit=True, **kwargs):
#     def save(self, commit=True):
#     def delete(self, commit=True):
#     def get_by_id(cls, id):
# def ReferenceCol(tablename, nullable=False, pk_name='id', **kwargs):


from farmsList.database import (
    Column,
    Table,
    db,
    Model,
    ReferenceCol,
    relationship,
    SurrogatePK,
)
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy2.types import Geometry
    center = Column(Geometry(geometry_type='POINT'), nullable=False)
    developmentPlan = Column(db.String(400), nullable=True)
    ownerName = Column(db.String(400), nullable=True)
    address = Column(db.String(400), nullable=True)
    email = Column(db.String(80), nullable=True)
    monthlyCost = Column(db.Numeric(precision=7, scale=2), nullable = False)
    priorUses = Column(db.String(10000), nullable=True)

    def __init__(self, **kwargs):
        db.Model.__init__(self, **kwargs)

    def __repr__(self):
        return '<Farmland({id})>'.format(id=self.id)

association_table = Table('parcel-farmland', Base.metadata,
    Column('parcel_apn', db.BigInteger(), db.ForeignKey('parcels.apn')),
    Column('farmland_id', db.Integer(), db.ForeignKey('farmlands.id'))
)

class AdditionalLayer(SurrogatePK, Model):
    __tablename__ = 'additional_layers'
    name = Column(db.String(400), nullable=False)
    geom = Column(Geometry(geometry_type='MULTIPOLYGON'), nullable=False)

    def __init__(self, **kwargs):
        db.Model.__init__(self, **kwargs)

    def __repr__(self):
        return '<AdditionalLayer({id}, {name})>'.format(id=self.id, name=self.name)


# Path: farmsList/database.py
# class CRUDMixin(object):
# class Model(CRUDMixin, db.Model):
# class SurrogatePK(object):
#     def create(cls, **kwargs):
#     def update(self, commit=True, **kwargs):
#     def save(self, commit=True):
#     def delete(self, commit=True):
#     def get_by_id(cls, id):
# def ReferenceCol(tablename, nullable=False, pk_name='id', **kwargs):


# Path: farmsList/public/models.py
from farmsList.database import (
    Column,
    Table,
    db,
    Model,
    ReferenceCol,
    relationship,
    SurrogatePK,
)
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy2.types import Geometry

    center = Column(Geometry(geometry_type='POINT'), nullable=False)
    developmentPlan = Column(db.String(400), nullable=True)
    ownerName = Column(db.String(400), nullable=True)
    address = Column(db.String(400), nullable=True)
    email = Column(db.String(80), nullable=True)
    monthlyCost = Column(db.Numeric(precision=7, scale=2), nullable = False)
    priorUses = Column(db.String(10000), nullable=True)

    def __init__(self, **kwargs):
        db.Model.__init__(self, **kwargs)

    def __repr__(self):
        return '<Farmland({id})>'.format(id=self.id)

association_table = Table('parcel-farmland', Base.metadata,
    Column('parcel_apn', db.BigInteger(), db.ForeignKey('parcels.apn')),
    Column('farmland_id', db.Integer(), db.ForeignKey('farmlands.id'))
)

class AdditionalLayer(SurrogatePK, Model):
    __tablename__ = 'additional_layers'
    name = Column(db.String(400), nullable=False)
    geom = Column(Geometry(geometry_type='MULTIPOLYGON'), nullable=False)

    def __init__(self, **kwargs):
        db.Model.__init__(self, **kwargs)

    def __repr__(self):
        return '<AdditionalLayer({id}, {name})>'.format(id=self.id, name=self.name)


class RemoteDataset(SurrogatePK, Model):