# Path: auth/utils.py
# def args_get(which):
#     def func():
#         value = flask.request.args.get(which)
#         if value == '':
#             value = None
#         return value
#     return func
# 
# Path: auth/models.py
# def set_sqlite_pragma(dbapi_connection, connection_record):
# def generate_code():
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# def record_change(f):
#     def func(self, **kwargs):
#     def should_expire(self):
#     def should_end(self):
#     def megabytes_are_finished(self):
#     def time_left(self):
#     def end_at(self):
#     def extend(self):
#     def login(self):
#     def end(self):
#     def expire(self):
#     def block(self):
#     def unblock(self):
#     def archive(self):
#     def available_actions(self):
#     def __str__(self):
#     def matches_voucher(self, voucher):
#     def process_request(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# class Role(db.Model, RoleMixin):
# class User(db.Model, UserMixin):
# class Network(db.Model):
# class Gateway(db.Model):
# class Voucher(db.Model):
# class Auth(db.Model):
# class Change(db.Model):
# class Country(db.Model):
# class Currency(db.Model):
# class Category(db.Model):
# class Product(db.Model):
# class Order(db.Model):
# class OrderItem(db.Model):
# class Transaction(db.Model):
# 
# Path: auth/resources.py
# def mkdir_p(path):
#     def instances(self, where=None, sort=None):
#     def instances(self, where=None, sort=None):
#     def extend(self, voucher, commit=True):
#     def block(self, voucher, commit=True):
#     def unblock(self, voucher, commit=True):
#     def archive(self, voucher, commit=True):
#     def current(self):
#     def logo(self, gateway):
#     def extend(self, voucher):
#     def block(self, voucher):
#     def unblock(self, voucher):
#     def archive(self, voucher):
# def set_scope(sender, item):
# class Manager(PrincipalManager):
# class VoucherManager(Manager):
# class UserResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class GatewayResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class NetworkResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class VoucherResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CategoryResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class ProductResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CountryResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CurrencyResource(PrincipalResource):
#     class Meta:
#     class Schema:


from auth.utils import args_get
from flask_security import current_user
from flask_wtf import FlaskForm
from wtforms import BooleanField, HiddenField, PasswordField, StringField, IntegerField, SelectField, fields as f, validators
from wtforms.ext.sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
from wtforms.ext.sqlalchemy.orm import converts, model_form, ModelConverter
from auth.models import db, Category, Country, Currency, Gateway, Network, Product, Voucher, Role
from auth.resources import api


GatewayForm = model_form(
    Gateway,
    db.session,
    FlaskForm,
    exclude=[
        'auths',
        'created_at',
        'categories',
        'orders',
        'products',
        'updated_at',
        'users',
        'vouchers',
    ],
    exclude_pk=False,
    field_args={
        'logo': {
            'description': 'Images only, resampled down to 300 x 300 pixels.',
        },
        'network': {
            'default': lambda: current_user.network,
            'query_factory': instances('networks'),
        }
    },
    converter=GatewayConverter()
)
NetworkForm = model_form(
    Network,

# Path: auth/utils.py
# def args_get(which):
#     def func():
#         value = flask.request.args.get(which)
#         if value == '':
#             value = None
#         return value
#     return func
# 
# Path: auth/models.py
# def set_sqlite_pragma(dbapi_connection, connection_record):
# def generate_code():
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# def record_change(f):
#     def func(self, **kwargs):
#     def should_expire(self):
#     def should_end(self):
#     def megabytes_are_finished(self):
#     def time_left(self):
#     def end_at(self):
#     def extend(self):
#     def login(self):
#     def end(self):
#     def expire(self):
#     def block(self):
#     def unblock(self):
#     def archive(self):
#     def available_actions(self):
#     def __str__(self):
#     def matches_voucher(self, voucher):
#     def process_request(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# class Role(db.Model, RoleMixin):
# class User(db.Model, UserMixin):
# class Network(db.Model):
# class Gateway(db.Model):
# class Voucher(db.Model):
# class Auth(db.Model):
# class Change(db.Model):
# class Country(db.Model):
# class Currency(db.Model):
# class Category(db.Model):
# class Product(db.Model):
# class Order(db.Model):
# class OrderItem(db.Model):
# class Transaction(db.Model):
# 
# Path: auth/resources.py
# def mkdir_p(path):
#     def instances(self, where=None, sort=None):
#     def instances(self, where=None, sort=None):
#     def extend(self, voucher, commit=True):
#     def block(self, voucher, commit=True):
#     def unblock(self, voucher, commit=True):
#     def archive(self, voucher, commit=True):
#     def current(self):
#     def logo(self, gateway):
#     def extend(self, voucher):
#     def block(self, voucher):
#     def unblock(self, voucher):
#     def archive(self, voucher):
# def set_scope(sender, item):
# class Manager(PrincipalManager):
# class VoucherManager(Manager):
# class UserResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class GatewayResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class NetworkResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class VoucherResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CategoryResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class ProductResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CountryResource(PrincipalResource):
#     class Meta:
#     class Schema:
# class CurrencyResource(PrincipalResource):
#     class Meta:
#     class Schema:


# Path: auth/forms.py
from auth.utils import args_get
from flask_security import current_user
from flask_wtf import FlaskForm
from wtforms import BooleanField, HiddenField, PasswordField, StringField, IntegerField, SelectField, fields as f, validators
from wtforms.ext.sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
from wtforms.ext.sqlalchemy.orm import converts, model_form, ModelConverter
from auth.models import db, Category, Country, Currency, Gateway, Network, Product, Voucher, Role
from auth.resources import api



GatewayForm = model_form(
    Gateway,
    db.session,
    FlaskForm,
    exclude=[
        'auths',
        'created_at',
        'categories',
        'orders',
        'products',
        'updated_at',
        'users',
        'vouchers',
    ],
    exclude_pk=False,
    field_args={
        'logo': {
            'description': 'Images only, resampled down to 300 x 300 pixels.',
        },
        'network': {
            'default': lambda: current_user.network,
            'query_factory': instances('networks'),
        }
    },
    converter=GatewayConverter()
)
NetworkForm = model_form(
    Network,

    db.session,