Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tags model #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kerckhoff/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
url(r'^accounts/', include('user_profile.urls')),
url(r'^accounts/', include('allauth.urls')),
url(r'^api/', include('api.urls')),
url(r'^api/tags/', include('tags.urls')),
url(r'^api/packages/', include('packages.urls')),
url(r'', include('pages.urls')),
]
302 changes: 151 additions & 151 deletions package-lock.json

Large diffs are not rendered by default.

Empty file added tags/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions tags/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also register the tag model? this lets us see this in the admin screen

5 changes: 5 additions & 0 deletions tags/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class TagsConfig(AppConfig):
name = 'tags'
Empty file added tags/migrations/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions tags/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.db import models

# Create your models here.
class Tags(models.Model):
value = models.CharField(max_length=64)

def __str__(self):
return self.value

3 changes: 3 additions & 0 deletions tags/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
6 changes: 6 additions & 0 deletions tags/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path
from . import views

urlpatterns = [
path('', views.index, name='index'),
]
7 changes: 7 additions & 0 deletions tags/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.

def index():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we implement a simple listing API? you can refer to the method i implemented in packages

return HttpResponse("Hello, world")