# Path: data/base.py
# class BaseModel(pwe.Model):
#     """Add field-level validation to the Peewee ORM."""
#     def validate_fields(self):
#         """Validate model fields."""
#         fields = validate.validation_fields.get(self.__class__.__name__, None)
#         try:
#             for field, method in fields:
#                 try:
#                     getattr(self, method)()
#                 except AssertionError:
#                     raise
#         except TypeError:
#             pass
# 
#     def save(self, *args, **kwargs):
#         """Validate fields then save record."""
#         self.validate_fields()
#         super(BaseModel, self).save(*args, **kwargs)
# 
#     class Meta:
#         database = obfuscatedb
# 
# def validate(model, field):
#     """Decorator to add validation methods to validation_fields dictionary.
# 
#     Populate validation_fields dictionary. The key/value pair is made up of
#     the model (table) name and tuples field name and the method to run.
# 
#     For example,
#         {'table_1': [('field_1', 'method_1'), ('field_2', 'method_2'), ...],
#          'table_A': [('field_a', 'method_a'), ('field_b', 'method_b'), ...],
#         }
# 
#     Parameters
#     ----------
#     field : str
#     model : str
#     """
#     def _validate(validation_method):
#         try:
#             validate.validation_fields[model].append(
#                 (field, validation_method.__name__))
#         except AttributeError:
#             validate.validation_fields = defaultdict(list)
#             validate.validation_fields[model].append(
#                 (field, validation_method.__name__))
# 
#         @wraps(validation_method)
#         def wrapped(self):
#             return validation_method(self)
#         return wrapped
# 
#     return _validate


from collections import namedtuple
from data.base import BaseModel, validate
import peewee as pwe
    import datetime




############################
# Reserved folders and files
############################
# Leading special characters:
#     / = reserved directory, copy as is
#     ~ = reserved file, copy as is
#     # = non-obfuscated directory: run through obfuscator to pick up other
#         other module's obfuscated names, but treat the
#         names as reserved
#     = = non-obfuscated file: run through obfuscator, but treat all names
#         as reserved
ReservedPrefixes = namedtuple('ReservedPrefixes', ['reserved_dir',
                                                   'reserved_file',
                                                   'non_obfuscated_dir',
                                                   'non_obfuscated_file'])

# Path: data/base.py
# class BaseModel(pwe.Model):
#     """Add field-level validation to the Peewee ORM."""
#     def validate_fields(self):
#         """Validate model fields."""
#         fields = validate.validation_fields.get(self.__class__.__name__, None)
#         try:
#             for field, method in fields:
#                 try:
#                     getattr(self, method)()
#                 except AssertionError:
#                     raise
#         except TypeError:
#             pass
# 
#     def save(self, *args, **kwargs):
#         """Validate fields then save record."""
#         self.validate_fields()
#         super(BaseModel, self).save(*args, **kwargs)
# 
#     class Meta:
#         database = obfuscatedb
# 
# def validate(model, field):
#     """Decorator to add validation methods to validation_fields dictionary.
# 
#     Populate validation_fields dictionary. The key/value pair is made up of
#     the model (table) name and tuples field name and the method to run.
# 
#     For example,
#         {'table_1': [('field_1', 'method_1'), ('field_2', 'method_2'), ...],
#          'table_A': [('field_a', 'method_a'), ('field_b', 'method_b'), ...],
#         }
# 
#     Parameters
#     ----------
#     field : str
#     model : str
#     """
#     def _validate(validation_method):
#         try:
#             validate.validation_fields[model].append(
#                 (field, validation_method.__name__))
#         except AttributeError:
#             validate.validation_fields = defaultdict(list)
#             validate.validation_fields[model].append(
#                 (field, validation_method.__name__))
# 
#         @wraps(validation_method)
#         def wrapped(self):
#             return validation_method(self)
#         return wrapped
# 
#     return _validate


# Path: logic/reserved/reserved.py
from collections import namedtuple
from data.base import BaseModel, validate
import peewee as pwe
    import datetime





############################
# Reserved folders and files
############################
# Leading special characters:
#     / = reserved directory, copy as is
#     ~ = reserved file, copy as is
#     # = non-obfuscated directory: run through obfuscator to pick up other
#         other module's obfuscated names, but treat the
#         names as reserved
#     = = non-obfuscated file: run through obfuscator, but treat all names
#         as reserved
ReservedPrefixes = namedtuple('ReservedPrefixes', ['reserved_dir',
                                                   'reserved_file',
                                                   'non_obfuscated_dir',
                                                   'non_obfuscated_file'])

reserved_prefixes = ReservedPrefixes('/', '~', '#', '=')