# 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
    soil = Column(db.String(400), nullable=True)
    zoning = Column(db.String(80), nullable=False)
    geometry = Column(db.String(6250000), nullable=False)
    center = Column(db.String(2000), nullable=False)
    geom = Column(Geometry(geometry_type='MULTIPOLYGON'))
    cent = Column(Geometry(geometry_type='POINT'))
    developmentPlan = Column(db.String(400), nullable=True)
    restrictions = Column(db.String(400), nullable=True)
    address = Column(db.String(400), nullable=True)
    apn = Column(db.BigInteger(), nullable=False, unique=True)
    jurisdiction = Column(db.String(400))
    landType = Column(db.String(80), nullable=True)
    landUse = Column(db.String(80), nullable=True)

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

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

class Farmland(SurrogatePK, Model):
    __tablename__ = 'farmlands'
    size = Column(db.Numeric(precision=6, scale=2), nullable = False)
    hasWater = Column(db.Boolean(), nullable=False, server_default='False')
    water = Column(db.Numeric(precision=3, scale=0), nullable=True)
    public = Column(db.Boolean(), nullable=False, server_default='False')
    soil = Column(db.String(400), nullable=True)
    zoning = Column(db.String(80), nullable=False)
    geometry = Column(Geometry(geometry_type='MULTIPOLYGON'), nullable=False)
    center = Column(Geometry(geometry_type='POINT'), nullable=False)

# 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

    soil = Column(db.String(400), nullable=True)
    zoning = Column(db.String(80), nullable=False)
    geometry = Column(db.String(6250000), nullable=False)
    center = Column(db.String(2000), nullable=False)
    geom = Column(Geometry(geometry_type='MULTIPOLYGON'))
    cent = Column(Geometry(geometry_type='POINT'))
    developmentPlan = Column(db.String(400), nullable=True)
    restrictions = Column(db.String(400), nullable=True)
    address = Column(db.String(400), nullable=True)
    apn = Column(db.BigInteger(), nullable=False, unique=True)
    jurisdiction = Column(db.String(400))
    landType = Column(db.String(80), nullable=True)
    landUse = Column(db.String(80), nullable=True)

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

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

class Farmland(SurrogatePK, Model):
    __tablename__ = 'farmlands'
    size = Column(db.Numeric(precision=6, scale=2), nullable = False)
    hasWater = Column(db.Boolean(), nullable=False, server_default='False')
    water = Column(db.Numeric(precision=3, scale=0), nullable=True)
    public = Column(db.Boolean(), nullable=False, server_default='False')
    soil = Column(db.String(400), nullable=True)
    zoning = Column(db.String(80), nullable=False)
    geometry = Column(Geometry(geometry_type='MULTIPOLYGON'), nullable=False)
    center = Column(Geometry(geometry_type='POINT'), nullable=False)

    developmentPlan = Column(db.String(400), nullable=True)