Permalink
Browse files

96. Move apps under richard.

I moved everything that was under apps/ to under richard/. I also did some
cosmetic cleanup when I bumped into odd looking things.
  • Loading branch information...
1 parent 33610e0 commit f2d47173ca7f0258212d5c84678c3d441c876768 Will Kahn-Greene committed May 26, 2012
Showing with 84 additions and 88 deletions.
  1. +0 −17 apps/__init__.py
  2. 0 apps/pages/tests/__init__.py
  3. +3 −7 docs/contributors/dev_layout.rst
  4. +1 −1 docs/contributors/dev_testing.rst
  5. +3 −1 manage.py
  6. 0 {apps/videos/management/commands → richard/pages}/__init__.py
  7. 0 {apps/suggestions → richard/pages/tests}/__init__.py
  8. 0 {apps → richard}/pages/tests/test_views.py
  9. +1 −1 {apps → richard}/pages/urls.py
  10. 0 {apps → richard}/pages/views.py
  11. 0 {apps/videos/management → richard/sampledata}/__init__.py
  12. 0 {apps/videos → richard/sampledata/management}/__init__.py
  13. 0 {apps/sitenews → richard/sampledata/management/commands}/__init__.py
  14. 0 {apps → richard}/sampledata/management/commands/load_sampledata.py
  15. 0 {apps → richard}/sampledata/tests/__init__.py
  16. +5 −11 richard/settings.py
  17. 0 {apps/sampledata/management/commands → richard/sitenews}/__init__.py
  18. +2 −1 {apps → richard}/sitenews/admin.py
  19. +1 −1 {apps → richard}/sitenews/feeds.py
  20. 0 {apps → richard}/sitenews/migrations/0001_initial.py
  21. 0 {apps/videos → richard/sitenews}/migrations/__init__.py
  22. 0 {apps → richard}/sitenews/models.py
  23. +1 −1 {apps → richard}/sitenews/sampledata.py
  24. 0 {apps → richard}/sitenews/templates/sitenews/macros.html
  25. 0 {apps → richard}/sitenews/templates/sitenews/news.html
  26. 0 {apps → richard}/sitenews/templates/sitenews/news_list.html
  27. +1 −1 {apps → richard}/sitenews/tests/__init__.py
  28. 0 {apps → richard}/sitenews/tests/test_feeds.py
  29. +2 −2 {apps → richard}/sitenews/tests/test_models.py
  30. +1 −1 {apps → richard}/sitenews/tests/test_views.py
  31. +2 −2 {apps → richard}/sitenews/urls.py
  32. +1 −1 {apps → richard}/sitenews/views.py
  33. +15 −0 richard/suggestions/__init__.py
  34. +1 −1 {apps → richard}/suggestions/admin.py
  35. +1 −1 {apps → richard}/suggestions/forms.py
  36. 0 {apps → richard}/suggestions/migrations/0001_initial.py
  37. 0 {apps → richard}/suggestions/migrations/__init__.py
  38. 0 {apps → richard}/suggestions/models.py
  39. 0 {apps → richard}/suggestions/templates/suggestions/list.html
  40. 0 {apps → richard}/suggestions/templates/suggestions/submit.html
  41. 0 {apps → richard}/suggestions/templates/suggestions/submit_form.html
  42. +1 −1 {apps → richard}/suggestions/tests/__init__.py
  43. +2 −2 {apps → richard}/suggestions/tests/test_models.py
  44. +2 −2 {apps → richard}/suggestions/tests/test_views.py
  45. +1 −1 {apps → richard}/suggestions/urls.py
  46. +2 −2 {apps → richard}/suggestions/views.py
  47. +1 −1 richard/tests/test_views.py
  48. +4 −4 richard/urls.py
  49. 0 {apps/sampledata/management → richard/videos}/__init__.py
  50. +1 −1 {apps → richard}/videos/admin.py
  51. +7 −5 {apps → richard}/videos/api.py
  52. +1 −1 {apps → richard}/videos/feeds.py
  53. 0 {apps/sampledata → richard/videos/management}/__init__.py
  54. 0 {apps/pages → richard/videos/management/commands}/__init__.py
  55. 0 {apps → richard}/videos/management/commands/fetchvideothumbnails.py
  56. 0 {apps → richard}/videos/migrations/0001_initial.py
  57. 0 {apps → richard}/videos/migrations/0002_auto__chg_field_category_whiteboard.py
  58. 0 ...}/videos/migrations/0003_auto__add_field_video_video_flv_length__add_field_video_video_flv_url.py
  59. 0 {apps/sitenews → richard/videos}/migrations/__init__.py
  60. +1 −1 {apps → richard}/videos/models.py
  61. +2 −2 {apps → richard}/videos/sampledata.py
  62. +2 −1 {apps → richard}/videos/search_indexes.py
  63. BIN {apps → richard}/videos/static/videos/img/no_thumbnail.png
  64. 0 {apps → richard}/videos/static/videos/js/videos.js
  65. 0 {apps → richard}/videos/templates/search/indexes/videos/video_rendered.txt
  66. 0 {apps → richard}/videos/templates/search/indexes/videos/video_text.txt
  67. 0 {apps → richard}/videos/templates/videos/category.html
  68. 0 {apps → richard}/videos/templates/videos/category_list.html
  69. 0 {apps → richard}/videos/templates/videos/macros.html
  70. 0 {apps → richard}/videos/templates/videos/opensearch.xml
  71. 0 {apps → richard}/videos/templates/videos/search.html
  72. 0 {apps → richard}/videos/templates/videos/speaker.html
  73. 0 {apps → richard}/videos/templates/videos/speaker_list.html
  74. 0 {apps → richard}/videos/templates/videos/video.html
  75. 0 {apps → richard}/videos/templates/videos/video_display.html
  76. +1 −1 {apps → richard}/videos/tests/__init__.py
  77. +2 −2 {apps → richard}/videos/tests/test_api.py
  78. +3 −1 {apps → richard}/videos/tests/test_feeds.py
  79. +2 −2 {apps → richard}/videos/tests/test_views.py
  80. +4 −4 {apps → richard}/videos/urls.py
  81. 0 {apps → richard}/videos/utils.py
  82. +1 −1 {apps → richard}/videos/views.py
  83. +3 −3 richard/views.py
View
@@ -1,17 +0,0 @@
-# richard -- video index system
-# Copyright (C) 2012 richard contributors. See AUTHORS.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
No changes.
@@ -8,8 +8,7 @@ directory tree like this::
richard
|- docs/ -- documentation
|- requirements/ -- requirements files for pip
- |- richard/ -- richard django project
- \- apps/
+ \- richard/ -- richard django project
|- pages/ -- code for "about", "contac", etc pages
|- sampledata/ -- code for loading sampledata from apps
|- sitenews/ -- code for sitenews
@@ -30,11 +29,8 @@ Here's what's there:
**richard/richard/**
- This is the "Django project" part of the project.
-
-**richard/apps/**
-
- This is where the "Django apps" go. There are a few:
+ This is the "Django project" part of the project and where the
+ "Django apps" go. There are a few:
**pages**
@@ -29,7 +29,7 @@ Add new tests
Locations
---------
-Tests for apps go in ``richard/apps/APPNAME/tests/``.
+Tests for apps go in ``richard/richard/APPNAME/tests/``.
Tests for richard project go in ``richard/richard/tests/``.
View
@@ -16,7 +16,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import os, sys
+import os
+import sys
+
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "richard.settings")
File renamed without changes.
@@ -18,7 +18,7 @@
urlpatterns = patterns(
- 'pages.views',
+ 'richard.pages.views',
url(r'^(?P<page>[\w-]+)/?$', 'pages_view', name='pages-page'),
)
File renamed without changes.
View
@@ -14,10 +14,6 @@
# root is this directory
ROOT = os.path.dirname(__file__)
-# add the apps/ directory to the path
-sys.path.append(os.path.join(os.path.dirname(ROOT), 'apps'))
-
-
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -178,13 +174,11 @@
'south',
'tastypie',
- # Uncomment the next line to enable admin documentation:
- # 'django.contrib.admindocs',
-
- 'videos',
- 'sitenews',
- 'pages',
- 'suggestions',
+ 'richard.videos',
+ 'richard.sitenews',
+ 'richard.pages',
+ 'richard.sampledata',
+ 'richard.suggestions',
)
try:
@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
-from sitenews.models import SiteNews, Notification
+
+from richard.sitenews.models import SiteNews, Notification
class SiteNewsAdmin(admin.ModelAdmin):
@@ -17,7 +17,7 @@
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
-from sitenews.models import SiteNews
+from richard.sitenews.models import SiteNews
class NewsFeed(Feed):
File renamed without changes.
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from sitenews.tests import sitenews
+from richard.sitenews.tests import sitenews
def run():
@@ -16,7 +16,7 @@
from datetime import datetime, timedelta
-from sitenews import models
+from richard.sitenews import models
from richard.tests.utils import with_save
@@ -19,8 +19,8 @@
from django.test import TestCase
from nose.tools import eq_
-from . import notification
-from sitenews.models import Notification
+from richard.sitenews.tests import notification
+from richard.sitenews.models import Notification
class TestNotification(TestCase):
@@ -20,7 +20,7 @@
from django.test import TestCase
from nose.tools import eq_
-from . import sitenews
+from richard.sitenews.tests import sitenews
class TestSitenews(TestCase):
@@ -16,11 +16,11 @@
from django.conf.urls.defaults import patterns, url
-from sitenews.feeds import NewsFeed
+from richard.sitenews.feeds import NewsFeed
urlpatterns = patterns(
- 'sitenews.views',
+ 'richard.sitenews.views',
# news item
url(r'^entry/(?P<pk>\d+)/(?P<slug>[\w-]*)/?$',
@@ -17,7 +17,7 @@
from django.views.generic.dates import ArchiveIndexView, YearArchiveView
from django.views.generic.detail import DetailView
-from sitenews import models
+from richard.sitenews import models
def get_years():
@@ -0,0 +1,15 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -16,7 +16,7 @@
from django.contrib import admin
-from suggestions.models import Suggestion
+from richard.suggestions.models import Suggestion
class SuggestionAdmin(admin.ModelAdmin):
@@ -16,7 +16,7 @@
from django.forms import ModelForm
-from suggestions.models import Suggestion
+from richard.suggestions.models import Suggestion
class SuggestionForm(ModelForm):
File renamed without changes.
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from richard.tests.utils import with_save
-from suggestions.models import Suggestion
+from richard.suggestions.models import Suggestion
@with_save
@@ -16,8 +16,8 @@
from django.test import TestCase
-from . import suggestion
-from suggestions.models import Suggestion
+from richard.suggestions.tests import suggestion
+from richard.suggestions.models import Suggestion
class TestSuggestion(TestCase):
@@ -19,8 +19,8 @@
from nose.tools import eq_
-from suggestions.models import Suggestion
-from suggestions.tests import suggestion
+from richard.suggestions.models import Suggestion
+from richard.suggestions.tests import suggestion
class TestSuggestions(TestCase):
@@ -18,7 +18,7 @@
urlpatterns = patterns(
- 'suggestions.views',
+ 'richard.suggestions.views',
url(r'^$', 'overview', name='suggestions-list'),
url(r'^submit/$', 'submit', name='suggestions-submit'),
@@ -16,8 +16,8 @@
from django.shortcuts import render
-from suggestions.forms import SuggestionForm
-from suggestions.models import Suggestion
+from richard.suggestions.forms import SuggestionForm
+from richard.suggestions.models import Suggestion
def overview(request):
@@ -18,7 +18,7 @@
from django.test import TestCase
from nose.tools import eq_
-from sitenews.tests import notification
+from richard.sitenews.tests import notification
class RichardViewsTest(TestCase):
View
@@ -30,8 +30,8 @@
url(r'^admin/', include(admin.site.urls)),
- url(r'^news/', include('sitenews.urls')),
- url(r'^pages/', include('pages.urls')),
- url(r'^suggestions/', include('suggestions.urls')),
- url(r'', include('videos.urls')),
+ url(r'^news/', include('richard.sitenews.urls')),
+ url(r'^pages/', include('richard.pages.urls')),
+ url(r'^suggestions/', include('richard.suggestions.urls')),
+ url(r'', include('richard.videos.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
@@ -18,7 +18,7 @@
from django.contrib.admin import SimpleListFilter
from django.utils.translation import ugettext_lazy as _
-from videos.models import Video, Category, Speaker, CategoryKind, Tag
+from richard.videos.models import Video, Category, Speaker, CategoryKind, Tag
class WhiteboardFilter(SimpleListFilter):
@@ -16,11 +16,11 @@
from tastypie import fields
from tastypie.authentication import (ApiKeyAuthentication, Authentication,
- MultiAuthentication)
+ MultiAuthentication)
from tastypie.authorization import Authorization
from tastypie.resources import ModelResource
-from videos.models import Video, Speaker, Category, Tag
+from richard.videos.models import Video, Speaker, Category, Tag
class AdminAuthorization(Authorization):
@@ -46,9 +46,11 @@ def get_authentication():
class VideoResource(ModelResource):
- category = fields.ToOneField('videos.api.CategoryResource', 'category')
- speakers = fields.ToManyField('videos.api.SpeakerResource', 'speakers')
- tags = fields.ToManyField('videos.api.TagResource', 'tags')
+ category = fields.ToOneField('richard.videos.api.CategoryResource',
+ 'category')
+ speakers = fields.ToManyField('richard.videos.api.SpeakerResource',
+ 'speakers')
+ tags = fields.ToManyField('richard.videos.api.TagResource', 'tags')
class Meta:
queryset = Video.objects.live()
@@ -24,7 +24,7 @@
from django.utils.translation import ugettext as _
-from videos.models import Speaker, Category
+from richard.videos.models import Speaker, Category
class MediaRSSFeed(Rss201rev2Feed):
@@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _
-from videos.utils import generate_unique_slug
+from richard.videos.utils import generate_unique_slug
MIMETYPES_MAP = {
@@ -16,8 +16,8 @@
from datetime import datetime, date
-from videos.models import Video
-from videos.tests import category_kind, category, speaker, tag, video
+from richard.videos.models import Video
+from richard.videos.tests import category_kind, category, speaker, tag, video
def run():
@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from haystack import indexes
-from videos.models import Video
+
+from richard.videos.models import Video
class VideoIndex(indexes.SearchIndex, indexes.Indexable):
@@ -18,7 +18,7 @@
from django.template.defaultfilters import slugify
-from videos.models import CategoryKind, Category, Speaker, Tag, Video
+from richard.videos.models import CategoryKind, Category, Speaker, Tag, Video
from richard.tests.utils import with_save
@@ -22,8 +22,8 @@
from nose.tools import eq_
from tastypie.models import ApiKey
-from . import video, speaker, category
-from videos.models import Video
+from richard.videos.tests import video, speaker, category
+from richard.videos.models import Video
class TestApi(TestCase):
@@ -17,4 +17,6 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
-from . import category, speaker, video
+from richard.videos.tests import category, speaker, video
+
+# TODO: Write these
Oops, something went wrong.

0 comments on commit f2d4717

Please sign in to comment.