Skip to content

Commit c447ceb

Browse files
committed
Fix missed s/Vote/VoteModel/ ...
Also: - Create LICENSE
1 parent 8d8a278 commit c447ceb

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Zdzisław Śliwiński
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ might be helpful to whoever intends to do that tutorial.
77
The commits are roughly aligned with the original chapters (with my take on
88
naming and such here and there) and are best followed alongside the tutorial.
99

10-
Here is the full list of commits here in chronological order:
10+
Here is the list of commits in chronological order:
1111

1212
[`6c12b74`](https://github.com/zdzislaw-s/howtographql/commit/6c12b74abc6ccfcaad1bcec7412ad8a422a5da8f)` Add hackernews/`
1313
[`a3c193c`](https://github.com/zdzislaw-s/howtographql/commit/a3c193c60d02162a4782f0ce79f0a86b17b433e0)` Configure Graphene Django`
@@ -27,4 +27,5 @@ Here is the full list of commits here in chronological order:
2727
[`8b611ca`](https://github.com/zdzislaw-s/howtographql/commit/8b611ca0b4830f0ce7f1dafac5c3970e7a943149)` Rename type names in schema (e.g. s/VoteType/Vote/)`
2828
[`1a5db7e`](https://github.com/zdzislaw-s/howtographql/commit/1a5db7e74a8ecb70ae3930e2b74b7352e89dabca)` Replace Exception with GraphQLError`
2929
[`f9a4d26`](https://github.com/zdzislaw-s/howtographql/commit/f9a4d269abd92fe9bd389fc640c34edfdad15540)` Filter Links`
30-
[`baaf772`](https://github.com/zdzislaw-s/howtographql/commit/baaf7723cd14321a16b67310676349eb5d904a4f)` Paginate Links`
30+
[`8d8a278`](https://github.com/zdzislaw-s/howtographql/commit/8d8a2788d5752bf9e842a70d9da775e5aac2dc54)` Paginate Links`
31+
[`662d31f`](https://github.com/zdzislaw-s/howtographql/commit/662d31fd237320edc1bde7fd9c7499857008a8cd)` Fix missed s/Vote/VoteModel/`

hackernews/hackernews/schema.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from graphql import GraphQLError
77

88
from links.models import Link as LinkModel
9-
from links.models import Vote
9+
from links.models import Vote as VoteModel
1010

1111

1212
class Link(DjangoObjectType):
@@ -16,7 +16,7 @@ class Meta:
1616

1717
class Vote(DjangoObjectType):
1818
class Meta:
19-
model = Vote
19+
model = VoteModel
2020

2121

2222
class User(DjangoObjectType):
@@ -64,7 +64,7 @@ def mutate(self, info, linkId):
6464
if link is None:
6565
raise GraphQLError(f"The link ={linkId} is invalid.")
6666

67-
Vote.objects.create(user=user, link=link)
67+
VoteModel.objects.create(user=user, link=link)
6868

6969
return CreateVote(user=user, link=link)
7070

@@ -123,7 +123,7 @@ def resolve_links(self, info, search=None, first=None, skip=None, **kwargs):
123123
return qs
124124

125125
def resolve_votes(self, info, **kwargs):
126-
return Vote.objects.all()
126+
return VoteModel.objects.all()
127127

128128
def resolve_users(self, info):
129129
return get_user_model().objects.all()

0 commit comments

Comments
 (0)