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

T2 #5

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

T2 #5

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
8 changes: 7 additions & 1 deletion apps/hello/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from django.contrib import admin

from hello.models import Request
from django.db import models
# Register your models here.

class RequestAdmin(admin.ModelAdmin):
list_display = ['method', 'path', 'user', 'created_at', 'updated_at']

admin.site.register(Request, RequestAdmin)
40 changes: 40 additions & 0 deletions apps/hello/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

def forwards(self, orm):
# Adding model 'Request'
db.create_table(u'hello_request', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('method', self.gf('django.db.models.fields.CharField')(max_length=10)),
('path', self.gf('django.db.models.fields.TextField')()),
('user', self.gf('django.db.models.fields.TextField')()),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
))
db.send_create_signal(u'hello', ['Request'])


def backwards(self, orm):
# Deleting model 'Request'
db.delete_table(u'hello_request')


models = {
u'hello.request': {
'Meta': {'object_name': 'Request'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'path': ('django.db.models.fields.TextField', [], {}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.TextField', [], {})
}
}

complete_apps = ['hello']
Empty file.
10 changes: 10 additions & 0 deletions apps/hello/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
from django.db import models

# Create your models here.

class Request(models.Model):
method = models.CharField(max_length=10)
path = models.TextField()
user = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def __unicode__(self):
return self.path
5 changes: 3 additions & 2 deletions apps/hello/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.test import TestCase

# Create your tests here.
#Create your tests here.
class SomeTests(TestCase):
def test_math(self):
assert(2+2==5)
# assert(2+2==4)
pass
3 changes: 3 additions & 0 deletions apps/hello/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.shortcuts import render

# Create your views here.

def home(request):
return render(request, 'index.html')
Loading