Skip to content

Commit 8965524

Browse files
crud app
0 parents  commit 8965524

21 files changed

+721
-0
lines changed

.gitignore

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
### OSX ###
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
6+
# Icon must ends with two \r.
7+
Icon
8+
9+
# Thumbnails
10+
._*
11+
12+
# Files that might appear on external disk
13+
.Spotlight-V100
14+
.Trashes
15+
16+
17+
### Python ###
18+
# Byte-compiled / optimized / DLL files
19+
__pycache__/
20+
*.py[cod]
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
*.egg-info/
28+
.installed.cfg
29+
*.egg
30+
31+
# Installer logs
32+
pip-log.txt
33+
pip-delete-this-directory.txt
34+
35+
# Unit test / coverage reports
36+
.tox/
37+
.coverage
38+
.cache
39+
nosetests.xml
40+
coverage.xml
41+
htmlcov/
42+
43+
# Translations
44+
*.mo
45+
46+
# Mr Developer
47+
.mr.developer.cfg
48+
.project
49+
.pydevproject
50+
51+
# Rope
52+
.ropeproject
53+
54+
# Django stuff:
55+
*.log
56+
*.pot
57+
.staticfiles/
58+
.media/
59+
60+
# Sphinx documentation
61+
docs/_build/
62+
63+
# npm
64+
node_modules/
65+
66+
# Campass
67+
.sass-cache
68+
69+
# Celery
70+
celerybeat-schedule
71+
72+
# Vagrant
73+
.vagrant
74+
75+
# Redis
76+
dump.rdb
77+
78+
# python-dotenv
79+
.env
80+
81+
# bittstop
82+
_docs_html/
83+
media/
84+
provisioner/site.retry
85+
86+
# Virtualenv
87+
venv/
88+
89+
### Vim ###
90+
[._]*.s[a-w][a-z]
91+
[._]s[a-w][a-z]
92+
*.un~
93+
Session.vim
94+
.netrwhist
95+
96+
# Pycharm
97+
.idea/

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "${workspaceFolder}/venv/bin/python"
3+
}

myproject/article/__init__.py

Whitespace-only changes.

myproject/article/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

myproject/article/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ArticleConfig(AppConfig):
5+
name = 'article'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 2.0.2 on 2018-02-04 16:49
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Article',
16+
fields=[
17+
('article_id', models.AutoField(primary_key=True, serialize=False)),
18+
('article_heading', models.CharField(max_length=250)),
19+
('artitcle_body', models.TextField()),
20+
],
21+
),
22+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.0.2 on 2018-02-04 20:04
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('article', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.RenameField(
14+
model_name='article',
15+
old_name='artitcle_body',
16+
new_name='article_body',
17+
),
18+
]

myproject/article/migrations/__init__.py

Whitespace-only changes.

myproject/article/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
class Article(models.Model):
5+
article_id = models.AutoField(primary_key=True)
6+
article_heading = models.CharField(max_length=250)
7+
article_body = models.TextField()

myproject/article/serializers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
# @Author: shubhambansal
3+
# @Date: 2018-02-04 22:43:58
4+
# @Last Modified by: shubhambansal
5+
# @Last Modified time: 2018-02-04 22:57:32
6+
from rest_framework import serializers
7+
from .models import Article
8+
9+
10+
class ArticleSerializer(serializers.ModelSerializer):
11+
class Meta:
12+
model = Article
13+
fields = '__all__'

0 commit comments

Comments
 (0)