# Path: app/models.py
# class Character(db.Model):
# class TrueSkill(db.Model):
# class Region(db.Model):
# class User(db.Model):
# class Placement(db.Model):
# class TournamentHeader(db.Model):
# class Tournament(db.Model):
# class Set(db.Model):
# class Match(db.Model):
#   def __repr__(self):
#   def __str__(self):
#   def uses_character(self, user):
#   def __repr__(self):
#   def __repr__(self):
#   def __str__(self):
#   def adopt_user(self, user_tag):
#   def adopt_tournament(self, tournament_name):
#   def __iter__(self):
#   def __repr__(self):
#   def get_won_sets(self):
#   def get_lost_sets(self):
#   def get_all_sets(self):
#   def change_tag(self, new_tag):
#   def get_characters(self):
#   def is_character(self, character):
#   def add_character(self, character):
#   def remove_character(self, character):
#   def add_characters_list(self, characterlist):
#   def remove_characters_list(self, characterlist):
#   def get_main(self):
# def check_set_user(set_user_tag, *args):
#   def __repr__(self):
#   def __unicode__(self):
#   def __repr__(self):
#   def get_final_entrants(self):
#   def __repr__(self):
#   def __repr__(self):
#   def __unicode__(self): # String representation to be printed in html. Ex: Armada vs Mango: (3-2) Armada
#   def getSetWinner(self):
#   def getSetWinnerID(self):
#   def getSetLoserID(self):
#   def getSetLoser(self):
#   def invalidScores(self):
#   def __repr__(self):
#   def __unicode__(self): # String representation to be printed in html. Ex: Stage: Battlefield | Winner: Mango | Loser: Armada


import sys
from app import app, db, models
from sanitize_utils import check_and_sanitize_tag
#!flask/bin/python
sys.path.append('./sanitize')

def sanitize_users():
  users = models.User.query.all()
  for user in users:
    sanitized_tag = check_and_sanitize_tag(user.tag)
    # If tag already sanitized, skip sanitation.
    if not sanitized_tag == user.tag:

# Path: app/models.py
# class Character(db.Model):
# class TrueSkill(db.Model):
# class Region(db.Model):
# class User(db.Model):
# class Placement(db.Model):
# class TournamentHeader(db.Model):
# class Tournament(db.Model):
# class Set(db.Model):
# class Match(db.Model):
#   def __repr__(self):
#   def __str__(self):
#   def uses_character(self, user):
#   def __repr__(self):
#   def __repr__(self):
#   def __str__(self):
#   def adopt_user(self, user_tag):
#   def adopt_tournament(self, tournament_name):
#   def __iter__(self):
#   def __repr__(self):
#   def get_won_sets(self):
#   def get_lost_sets(self):
#   def get_all_sets(self):
#   def change_tag(self, new_tag):
#   def get_characters(self):
#   def is_character(self, character):
#   def add_character(self, character):
#   def remove_character(self, character):
#   def add_characters_list(self, characterlist):
#   def remove_characters_list(self, characterlist):
#   def get_main(self):
# def check_set_user(set_user_tag, *args):
#   def __repr__(self):
#   def __unicode__(self):
#   def __repr__(self):
#   def get_final_entrants(self):
#   def __repr__(self):
#   def __repr__(self):
#   def __unicode__(self): # String representation to be printed in html. Ex: Armada vs Mango: (3-2) Armada
#   def getSetWinner(self):
#   def getSetWinnerID(self):
#   def getSetLoserID(self):
#   def getSetLoser(self):
#   def invalidScores(self):
#   def __repr__(self):
#   def __unicode__(self): # String representation to be printed in html. Ex: Stage: Battlefield | Winner: Mango | Loser: Armada


# Path: sanitize/db_sanitize.py
import sys
from app import app, db, models
from sanitize_utils import check_and_sanitize_tag

#!flask/bin/python
sys.path.append('./sanitize')

def sanitize_users():
  users = models.User.query.all()
  for user in users:
    sanitized_tag = check_and_sanitize_tag(user.tag)
    # If tag already sanitized, skip sanitation.
    if not sanitized_tag == user.tag:

      sanitized_user = models.User.query.filter(models.User.tag==sanitized_tag).first()