mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 04:07:16 +03:00
18 lines
374 B
Python
18 lines
374 B
Python
|
from __future__ import absolute_import
|
||
|
from django.db import models
|
||
|
|
||
|
|
||
|
class Faction(models.Model):
|
||
|
name = models.CharField(max_length=50)
|
||
|
|
||
|
def __str__(self):
|
||
|
return self.name
|
||
|
|
||
|
|
||
|
class Ship(models.Model):
|
||
|
name = models.CharField(max_length=50)
|
||
|
faction = models.ForeignKey(Faction, related_name='ships')
|
||
|
|
||
|
def __str__(self):
|
||
|
return self.name
|