Skip to content

Commit 06ca766

Browse files
authored
Merge pull request #454 from ericfrederich/example_diff
Make examples diff better against each other
2 parents 2f68424 + a97729d commit 06ca766

File tree

14 files changed

+28
-8
lines changed

14 files changed

+28
-8
lines changed

examples/cookbook-plain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Cookbook Example Django Project
33

44
This example project demos integration between Graphene and Django.
55
The project contains two apps, one named `ingredients` and another
6-
named `recepies`.
6+
named `recipes`.
77

88
Getting started
99
---------------
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# Create your tests here.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# Create your views here.

examples/cookbook-plain/cookbook/recipes/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
class Recipe(models.Model):
77
title = models.CharField(max_length=100)
88
instructions = models.TextField()
9+
__unicode__ = lambda self: self.title
910

1011

1112
class RecipeIngredient(models.Model):
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# Create your tests here.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# Create your views here.

examples/cookbook/cookbook/ingredients/admin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from cookbook.ingredients.models import Category, Ingredient
44

5+
56
@admin.register(Ingredient)
67
class IngredientAdmin(admin.ModelAdmin):
7-
list_display = ("id","name","category")
8-
list_editable = ("name","category")
9-
8+
list_display = ('id', 'name', 'category')
9+
list_editable = ('name', 'category')
10+
11+
1012
admin.site.register(Category)

examples/cookbook/cookbook/ingredients/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __str__(self):
1010

1111
class Ingredient(models.Model):
1212
name = models.CharField(max_length=100)
13-
notes = models.TextField(null=True,blank=True)
13+
notes = models.TextField(null=True, blank=True)
1414
category = models.ForeignKey(Category, related_name='ingredients')
1515

1616
def __str__(self):

examples/cookbook/cookbook/recipes/admin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from cookbook.recipes.models import Recipe, RecipeIngredient
44

5+
56
class RecipeIngredientInline(admin.TabularInline):
6-
model = RecipeIngredient
7+
model = RecipeIngredient
8+
79

810
@admin.register(Recipe)
911
class RecipeAdmin(admin.ModelAdmin):
10-
inlines = [RecipeIngredientInline]
12+
inlines = [RecipeIngredientInline]

examples/cookbook/cookbook/recipes/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Recipe(models.Model):
88
instructions = models.TextField()
99
__unicode__ = lambda self: self.title
1010

11+
1112
class RecipeIngredient(models.Model):
1213
recipe = models.ForeignKey(Recipe, related_name='amounts')
1314
ingredient = models.ForeignKey(Ingredient, related_name='used_by')

0 commit comments

Comments
 (0)