mirror of
https://github.com/ansible/awx.git
synced 2026-05-05 16:37:37 -02:30
Simplify Django organization, add South support.
This commit is contained in:
0
acom/main/__init__.py
Normal file
0
acom/main/__init__.py
Normal file
BIN
acom/main/__init__.pyc
Normal file
BIN
acom/main/__init__.pyc
Normal file
Binary file not shown.
36
acom/main/migrations/0001_initial.py
Normal file
36
acom/main/migrations/0001_initial.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import 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 'Inventory'
|
||||
db.create_table('inventory', (
|
||||
('name', self.gf('django.db.models.fields.TextField')()),
|
||||
('description', self.gf('django.db.models.fields.TextField')()),
|
||||
('creation_date', self.gf('django.db.models.fields.DateField')()),
|
||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
))
|
||||
db.send_create_signal('main', ['Inventory'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Deleting model 'Inventory'
|
||||
db.delete_table('inventory')
|
||||
|
||||
|
||||
models = {
|
||||
'main.inventory': {
|
||||
'Meta': {'object_name': 'Inventory', 'db_table': "'inventory'"},
|
||||
'creation_date': ('django.db.models.fields.DateField', [], {}),
|
||||
'description': ('django.db.models.fields.TextField', [], {}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.TextField', [], {})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['main']
|
||||
0
acom/main/migrations/__init__.py
Normal file
0
acom/main/migrations/__init__.py
Normal file
BIN
acom/main/migrations/__init__.pyc
Normal file
BIN
acom/main/migrations/__init__.pyc
Normal file
Binary file not shown.
21
acom/main/models.py
Normal file
21
acom/main/models.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
|
||||
class CommonModel(models.Model):
|
||||
''' common model for all object types that have these standard fields '''
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
name = models.TextField()
|
||||
description = models.TextField()
|
||||
creation_date = models.DateField()
|
||||
db_table = 'inventories'
|
||||
|
||||
class Inventory(CommonModel):
|
||||
|
||||
class Meta:
|
||||
db_table = 'inventory'
|
||||
|
||||
id = models.AutoField(primary_key=True)
|
||||
|
||||
|
||||
BIN
acom/main/models.pyc
Normal file
BIN
acom/main/models.pyc
Normal file
Binary file not shown.
23
acom/main/tests.py
Normal file
23
acom/main/tests.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
This file demonstrates two different styles of tests (one doctest and one
|
||||
unittest). These will both pass when you run "manage.py test".
|
||||
|
||||
Replace these with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.failUnlessEqual(1 + 1, 2)
|
||||
|
||||
__test__ = {"doctest": """
|
||||
Another way to test that 1 + 1 is equal to 2.
|
||||
|
||||
>>> 1 + 1 == 2
|
||||
True
|
||||
"""}
|
||||
|
||||
1
acom/main/views.py
Normal file
1
acom/main/views.py
Normal file
@@ -0,0 +1 @@
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user