26 lines
537 B
Python
26 lines
537 B
Python
from django.db import models
|
|
|
|
|
|
class Console(models.Model):
|
|
"""
|
|
All console, system or box that can be used to play video games.
|
|
"""
|
|
name = models.CharField(max_length=254)
|
|
|
|
def __str__(self):
|
|
return '%s' % self.name
|
|
|
|
class Meta:
|
|
ordering = ('name',)
|
|
|
|
|
|
class Game(models.Model):
|
|
"""
|
|
A video game you will use on a specific Console.
|
|
"""
|
|
name = models.CharField(max_length=254)
|
|
console = models.ForeignKey('games.Console')
|
|
|
|
def __str__(self):
|
|
return '%s' % self.name
|