Skip to content

Commit

Permalink
Preparations for Django 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Steadman committed May 24, 2014
1 parent 4527029 commit d3dd708
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions bambu_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from django.conf import settings
from datetime import datetime

default_app_config = 'bambu_api.apps.APIConfig'
site = APISite()

def autodiscover():
Expand Down
4 changes: 4 additions & 0 deletions bambu_api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.apps import AppConfig

class APIConfig(AppConfig):
verbose_name = 'API'
10 changes: 1 addition & 9 deletions bambu_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

REQUEST_LOGGER = helpers.get_request_logger()

class CustomTitleString(str):
def title(self):
return str(self[6:]).title()

class App(models.Model):
admin = models.ForeignKey(User, related_name = 'owned_apps')
name = models.CharField(max_length = 50)
Expand Down Expand Up @@ -77,7 +73,6 @@ def users(self):
class Meta:
ordering = ('name',)
db_table = 'api_app'
app_label = CustomTitleString('bambu_api')

class Nonce(models.Model):
token_key = models.CharField(max_length = 18)
Expand All @@ -89,7 +84,6 @@ def __unicode__(self):

class Meta:
db_table = 'api_nonce'
app_label = CustomTitleString('bambu_api')

class Token(models.Model):
key = models.CharField(max_length = 18)
Expand Down Expand Up @@ -170,7 +164,6 @@ def set_callback(self, callback):

class Meta:
db_table = 'api_token'
app_label = CustomTitleString('bambu_api')

class RequestBatch(models.Model):
app = models.ForeignKey(App, related_name = 'requests')
Expand All @@ -179,5 +172,4 @@ class RequestBatch(models.Model):

class Meta:
unique_together = ('app', 'timestamp')
db_table = 'api_requestbatch'
app_label = CustomTitleString('bambu_api')
db_table = 'api_requestbatch'

0 comments on commit d3dd708

Please sign in to comment.