usgo/agagd

Replace Views with Django Native ORM

michaelhiiva opened this issue · 0 comments

Summary of the Bug

The current model for TopDan, TopKyu, MostRatedGamesPastYear and MostTournamentsPastYear use a view instead of Django Native ORM for pulling the data from usgo's AGAGD database.

The Expected Behaviour

The removal of each respective view for these models and move to Django Native Utils for requesting information from usgo's AGAGD database.

agagd_core/models.py - lines 109-151

class TopDan(models.Model):
member_id = models.IntegerField(primary_key=True, db_column='member_id')
full_name = models.CharField(max_length=255, db_column='full_name')
rating = models.CharField(max_length=42, db_column='rating')
class Meta:
managed = False
db_table = 'top_dan_view'
verbose_name = 'top_dan_view'
verbose_name_plural = 'top_dan_view'
class TopKyu(models.Model):
member_id = models.IntegerField(primary_key=True, db_column='member_id')
full_name = models.CharField(max_length=255, db_column='full_name')
rating = models.CharField(max_length=42, db_column='rating')
class Meta:
managed = False
db_table = 'top_kyu_view'
verbose_name = 'top_kyu_view'
verbose_name_plural = 'top_kyu_view'
class MostRatedGamesPastYear(models.Model):
member_id = models.IntegerField(primary_key=True, db_column='pin')
name = models.CharField(max_length=65, db_column='Name')
total = models.BigIntegerField(db_column='Game_Count')
class Meta:
managed = False
db_table = 'most_rated_games_view'
verbose_name = 'most_rated_games_view'
verbose_name_plural = 'most_rated_games_view'
class MostTournamentsPastYear(models.Model):
member_id = models.IntegerField(primary_key=True, db_column='pin')
name = models.CharField(max_length=65, db_column='Name')
total = models.BigIntegerField(db_column='Tournament_Count')
class Meta:
managed = False
db_table = 'most_tournaments_view'
verbose_name = 'most_tournaments_view'
verbose_name_plural = 'most_tournaments_view'