Decoupled the "reddit" application from the main program

This commit is contained in:
2010-12-20 12:17:14 +00:00
parent 0aef422d9a
commit cc4f986edb
15 changed files with 113 additions and 103 deletions

View File

@@ -38,3 +38,18 @@ def dump(qs, outfile_path, model=None):
row.append(val)
writer.writerow(row)
def installed(value):
from django.conf import settings
apps = settings.INSTALLED_APPS
if "." in value:
for app in apps:
if app == value:
return True
else:
for app in apps:
fields = app.split(".")
if fields[-1] == value:
return True
return False