mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-18 20:40:38 +03:00
Improve Django field conversion real-life tests
This commit is contained in:
parent
191d9c6ecb
commit
31eae0aee3
|
@ -26,6 +26,10 @@ class Article(models.Model):
|
||||||
headline = models.CharField(max_length=100)
|
headline = models.CharField(max_length=100)
|
||||||
pub_date = models.DateField()
|
pub_date = models.DateField()
|
||||||
reporter = models.ForeignKey(Reporter, related_name='articles')
|
reporter = models.ForeignKey(Reporter, related_name='articles')
|
||||||
|
lang = models.CharField(max_length=2, help_text='Language', choices=[
|
||||||
|
('es', 'Spanish'),
|
||||||
|
('en', 'English')
|
||||||
|
], default='es')
|
||||||
|
|
||||||
def __str__(self): # __unicode__ on Python 2
|
def __str__(self): # __unicode__ on Python 2
|
||||||
return self.headline
|
return self.headline
|
||||||
|
|
Loading…
Reference in New Issue
Block a user