Skip to content

Commit

Permalink
Merge pull request #190 from fga-eps-mds/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nukdown authored Oct 8, 2018
2 parents eee64d0 + 9408864 commit ec1d2f7
Show file tree
Hide file tree
Showing 40 changed files with 742 additions and 166 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Network Trash Folder
Temporary Items
.apdisk

**/**/migrations/*

### Python ###
# Byte-compiled / optimized / DLL files
Expand Down
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ language: python
python:
- "3.6"

before_install: docker-compose build
before_install:
- sudo rm /usr/local/bin/docker-compose
- sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose build

script:
- docker-compose up -d
- sleep 10
- docker-compose run web coverage run --source=. manage.py test
- docker-compose run web coverage report

after_success:
- coveralls
- docker-compose run web coveralls

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions CrossData/importdata/fixtures/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CrossData/importdata/fixtures/orig_data.json

Large diffs are not rendered by default.

233 changes: 85 additions & 148 deletions GameColorBI/importdata/models.py → CrossData/importdata/models.py
Original file line number Diff line number Diff line change
@@ -1,183 +1,78 @@
from django.db import models
from djongo import models

class Genre(models.Model):
class GeneralData(models.Model):

id_igdb = models.IntegerField(
('Genre ID'),
help_text=("Genre id at IGDB"),
primary_key=True,
id = models.AutoField(
primary_key=True
)

name = models.CharField(
('Genre name'),
help_text=("Genre name"),
max_length=100,
)

class Stream(models.Model):

id = models.IntegerField(
('Stream ID'),
help_text=("Id da stream na Twitch"),
primary_key=True,
)

game_id = models.IntegerField(
('Game ID'),
help_text=("Id do jogo na Twitch")
)

language = models.CharField(
('Language'),
help_text=("Language of stream"),
max_length=100,
null=True
)

started_at = models.CharField(
('Started date'),
help_text=("Date when stream started"),
max_length=100,
null=True
)

type = models.CharField(
('Type'),
help_text=("Type of stream"),
max_length=100,
null=True
)

viewer_count = models.IntegerField(
('Viewer count'),
help_text=("Number of views in stream"),
max_length=100,
null=True
)

user = models.ForeignKey(
User,
on_delete=models.CASCADE
)

game = models.ForeignKey(
Game,
on_delete=models.CASCADE
)

class User(models.Model):

user_id = models.IntegerField(
('User ID'),
help_text=("User id at Twitch API"),
primary_key=True,
)

display_name = models.CharField(
('Display name'),
help_text=("Display name"),
max_length=100,
null=True
)

type = models.CharField(
('Type'),
help_text=("Type"),
('Name'),
help_text=("Game name"),
max_length=100,
null=True
)

view_count = models.IntegerField(
('Count views'),
help_text=("Views couting of user"),
#IGDB
time_to_beat = models.FloatField(
('Time To Beat'),
help_text=("Average time to beat the game"),
null=True
)

follows = models.IntegerField(
('follows'),
help_text=("Number of followers"),
hypes = models.IntegerField(
('Hypes'),
help_text=("Number of access in the game befores its release"),
null=True
)


class Game(models.Model):

id_igdb = models.IntegerField(
('IGDB ID'),
help_text=("Id do jogo na IGDB"),
popularity = models.FloatField(
('Popularity'),
help_text=("Popularity of game"),
null=True
)

id_steam = models.IntegerField(
('STEAM ID'),
help_text=("Id do jogo na Steam"),
critics_rating = models.FloatField(
('Critics Rating'),
help_text=("Rating based on external critic scores"),
null=True
)

id_twitch = models.IntegerField(
('TWITCH ID'),
help_text=("Id do jogo na Twitch"),
null=True
)

name = models.CharField(
('Name'),
help_text=("Name of game"),
max_length=100,
genres = models.CharField(
('Game Genre'),
help_text=("Name of the Game Genre"),
max_length=50,
null=True
)

#Steam
positive_reviews_steam = models.IntegerField(
('Positive Reviews'),
('Steam Positive Reviews'),
help_text=("Number of positive reviews at Steam"),
null=True
)

negative_reviews_steam = models.IntegerField(
('Negative Reviews'),
('Steam Negative Reviews'),
help_text=("Number of negative reviews at Steam"),
null=True
)

owners = models.IntegerField(
('Owners'),
('Steam Owners'),
help_text=("Name of the owners"),
null=True
)

hypes = models.IntegerField(
('Hypes'),
help_text=("Number of access in the game befores its release"),
null=True
)

popularity = models.FloatField(
('Popularity'),
help_text=("Popularity of game"),
null=True
)

critics_rating = models.FloatField(
('Critics Rating'),
help_text=("Rating based on external critic scores"),
null=True
)

time_to_beat = models.FloatField(
('Time To Beat'),
help_text=("Average time to beat the game"),
null=True
)

average_forever = models.IntegerField(
('Average Forever'),
('Average Played Time'),
help_text=("Average forever of the game"),
null=True
)

average_2weeks = models.IntegerField(
('Average 2 weeks'),
help_text=("Average forever of the game"),
('Average Played Time 2 weeks'),
help_text=("Average Played Time 2 weeks of the game"),
null=True
)

Expand All @@ -187,48 +82,90 @@ class Game(models.Model):
null=True
)

language = models.CharField(
languages_game = models.CharField(
('Languages'),
help_text=("Language of the game"),
null=True
null=True,
max_length=150
)

genres = models.ManyToManyField(
Genre,
on_delete=models.CASCADE
)

#YouTube
count_videos = models.IntegerField(
('count_videos'),
('Youtube total videos number'),
help_text=("Number of videos found in youtube request"),
null=True
)

count_views = models.IntegerField(
('count_views'),
('Youtube total views'),
help_text=("Number of views summed from youtube videos"),
null=True
)

count_likes = models.IntegerField(
('count_likes'),
('Youtube total likes'),
help_text=("Number of likes summed from youtube videos"),
null=True
)

count_dislikes = models.IntegerField(
('count_dislikes'),
('Youtube total dislikes'),
help_text=("Number of dislikes summed from youtube videos"),
null=True
)

count_comments = models.IntegerField(
('count_comments'),
('Youtube total comments count'),
help_text=("Number of comments summed from youtube videos"),
null=True
)

#Twitch
view_count = models.IntegerField(
('Twitch users total views'),
help_text=("Total Views couting of twitch users"),
null=True
)

follows = models.IntegerField(
('Twitch users total follows'),
help_text=("Number of followers"),
null=True
)

language_stream = models.CharField(
('Twitch stream Language'),
help_text=("Language of stream"),
max_length=100,
null=True
)

started_at = models.CharField(
('Twitch stream Started date'),
help_text=("Date when stream started"),
max_length=100,
null=True
)

type = models.CharField(
('Twitch stream Type'),
help_text=("Type of stream"),
max_length=100,
null=True
)

viewer_count = models.IntegerField(
('Twitch Game streams Viewer count'),
help_text=("Number of views in stream"),
null=True
)

objects = models.DjongoManager()
date = models.DateField(
default=None
)

def __str__(self):
"""
Returns the object as a string, the attribute that will represent
Expand All @@ -241,5 +178,5 @@ class Meta:
"""
Some information about feedback class.
"""
verbose_name = ("Game BI")
verbose_name_plural = ("Games BI")
verbose_name = ("Game Data")
verbose_name_plural = ("Games Data")
File renamed without changes.
6 changes: 6 additions & 0 deletions CrossData/importdata/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import include, path
from .views import GamesView

urlpatterns = [
path('get_games_list/', GamesView.as_view(), name="get_games")
]
Loading

0 comments on commit ec1d2f7

Please sign in to comment.