# 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
    confirm = PasswordField('Repeat Password')
    active = BooleanField('Active', default=True)
    roles = QuerySelectMultipleField('Roles', query_factory=roles)

class MyUserForm(FlaskForm):
    email = StringField('Email')
    password = PasswordField(
        'Password',
        [
            validators.Optional(),
            validators.Length(min=2),
            validators.EqualTo('confirm', message='Passwords must match'),
        ]
    )
    confirm = PasswordField('Repeat Password')

class NewVoucherForm(FlaskForm):
    gateway_id = SelectField('Gateway')
    minutes = IntegerField('Minutes', [ validators.InputRequired(), validators.NumberRange(min=0) ], default=default_minutes)
    megabytes = IntegerField('Megabytes', [ validators.Optional(), validators.NumberRange(min=0) ], default=default_megabytes)

class BroadcastForm(FlaskForm):
    message = StringField('Message', [ validators.InputRequired() ])

class LoginVoucherForm(FlaskForm):
    voucher_code = StringField('Voucher Code', [ validators.InputRequired() ], default=args_get('voucher'), description='The voucher code you were given at the counter')
    name = StringField('Your Name', description='So we know what to call you')

    gw_address = HiddenField('Gateway Address', default=args_get('gw_address'))
    gw_port = HiddenField('Gateway Port', default=args_get('gw_port'))

# 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

    confirm = PasswordField('Repeat Password')
    active = BooleanField('Active', default=True)
    roles = QuerySelectMultipleField('Roles', query_factory=roles)

class MyUserForm(FlaskForm):
    email = StringField('Email')
    password = PasswordField(
        'Password',
        [
            validators.Optional(),
            validators.Length(min=2),
            validators.EqualTo('confirm', message='Passwords must match'),
        ]
    )
    confirm = PasswordField('Repeat Password')

class NewVoucherForm(FlaskForm):
    gateway_id = SelectField('Gateway')
    minutes = IntegerField('Minutes', [ validators.InputRequired(), validators.NumberRange(min=0) ], default=default_minutes)
    megabytes = IntegerField('Megabytes', [ validators.Optional(), validators.NumberRange(min=0) ], default=default_megabytes)

class BroadcastForm(FlaskForm):
    message = StringField('Message', [ validators.InputRequired() ])

class LoginVoucherForm(FlaskForm):
    voucher_code = StringField('Voucher Code', [ validators.InputRequired() ], default=args_get('voucher'), description='The voucher code you were given at the counter')
    name = StringField('Your Name', description='So we know what to call you')

    gw_address = HiddenField('Gateway Address', default=args_get('gw_address'))
    gw_port = HiddenField('Gateway Port', default=args_get('gw_port'))

    gateway_id = HiddenField('Gateway ID', default=args_get('gw_id'))