Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge fun

  • Loading branch information...
commit eb79c7604a6379790f7fa27f3dfa45776edd9cba 1 parent be65ece
@pydanny pydanny authored
View
11 apps/grid/tests/data.py
@@ -1,8 +1,11 @@
-from grid.models import Grid
from django.contrib.auth.models import Group, User, Permission
-from package.models import Category, PackageExample, Package
-from grid.models import Element, Feature, GridPackage
+
from core.tests import datautil
+from grid.models import Grid
+from grid.models import Element, Feature, GridPackage
+from package.models import Category, PackageExample, Package
+from profiles.models import Profile
+
def load():
category, created = Category.objects.get_or_create(
@@ -204,6 +207,8 @@ def load():
active=True,
title=u'www.example.com',
)
+ for user in User.objects.all():
+ profile = Profile.objects.create(user=user)
datautil.reset_sequences(Grid, Group, User, Permission, Category, PackageExample,
Package, Element, Feature, GridPackage)
View
7 apps/package/repos/bitbucket.py
@@ -37,7 +37,12 @@ def _get_bitbucket_commits(self, package):
def fetch_commits(self, package):
from package.models import Commit # Import placed here to avoid circular dependencies
for commit in self._get_bitbucket_commits(package):
- commit, created = Commit.objects.get_or_create(package=package, commit_date=commit["timestamp"])
+ timestamp = commit["timestamp"].split("+")
+ if len(timestamp) > 1:
+ timestamp = timestamp[0]
+ else:
+ timestamp = commit["timestamp"]
+ commit, created = Commit.objects.get_or_create(package=package, commit_date=timestamp)
def fetch_metadata(self, package):
# prep the target name
View
7 apps/package/tests/data.py
@@ -1,6 +1,9 @@
from django.contrib.auth.models import User
-from packaginator.apps.package.models import Category, Package, Version
+
from core.tests import datautil
+from package.models import Category, Package, Version
+from profiles.models import Profile
+
def load():
category, created = Category.objects.get_or_create(
@@ -1204,5 +1207,5 @@ def load():
hidden=False,
)
- datautil.reset_sequences(Category, Package, Version, User)
+ datautil.reset_sequences(Category, Package, Profile, Version, User)
View
11 apps/package/tests/test_views.py
@@ -4,12 +4,16 @@
from django.test import TestCase
from package.models import Category, Package, PackageExample
-
from package.tests import initial_data
+from profiles.models import Profile
+
class FunctionalPackageTest(TestCase):
def setUp(self):
initial_data.load()
+ for user in User.objects.all():
+ profile = Profile.objects.create(user=user)
+ profile.save()
settings.RESTRICT_PACKAGE_EDITORS = False
settings.RESTRICT_GRID_EDITORS = True
@@ -173,6 +177,11 @@ class RegressionPackageTest(TestCase):
class PackagePermissionTest(TestCase):
def setUp(self):
initial_data.load()
+ for user in User.objects.all():
+ profile = Profile.objects.create(user=user)
+ profile.save()
+
+
settings.RESTRICT_PACKAGE_EDITORS = True
self.test_add_url = reverse('add_package')
self.test_edit_url = reverse('edit_package',
View
6 apps/profiles/models.py
@@ -1,15 +1,17 @@
from django.conf import settings
+from django.contrib.auth.models import User
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
-from idios.models import ProfileBase
+from core.models import BaseModel
from package.models import Package
-class Profile(ProfileBase):
+class Profile(BaseModel):
+ user = models.OneToOneField(User)
github_url = models.CharField(_("Github account"), null=True, blank=True, max_length=100)
bitbucket_url = models.CharField(_("Bitbucket account"), null=True, blank=True, max_length=100)
google_code_url = models.CharField(_("Google Code account"), null=True, blank=True, max_length=100)
View
7 apps/profiles/templatetags/profile_tags.py
@@ -4,4 +4,9 @@
@register.filter
def package_usage(user):
- return user.package_set.all()
+ return user.package_set.all()
+
+@register.simple_tag
+def user_display(user):
+ """ TODO - turn this into an inclusion tag """
+ return user
View
13 apps/profiles/urls.py
@@ -0,0 +1,13 @@
+from django.conf.urls.defaults import *
+from django.db.models import Count
+from django.views.generic.list_detail import object_detail, object_list
+from django.views.generic.date_based import archive_index
+from django.views.generic.simple import direct_to_template
+
+from profiles import views
+
+
+urlpatterns = patterns("",
+ url(r"^(?P<username>[-\w]+)$", views.profile_detail, name="profile_detail"),
+
+)
View
12 apps/profiles/views.py
@@ -0,0 +1,12 @@
+from django.shortcuts import render_to_response, get_object_or_404
+from django.template import RequestContext
+
+
+def profile_detail(request, username, template_name="idios/profile.html"):
+ """ TODO - fix template """
+
+ return render_to_response(template_name,
+ {},
+
+
+ RequestContext(request))
View
12 manage.py
@@ -3,14 +3,6 @@
from os.path import abspath, dirname, join
-try:
- import pinax
-except ImportError:
- sys.stderr.write("Error: Can't import Pinax. Make sure you are in a virtual environment that has\nPinax installed or create one with pinax-boot.py.\n")
- sys.exit(1)
-
-from django.conf import settings
-from django.core.management import setup_environ, execute_from_command_line
try:
import settings as settings_mod # Assumed to be in the same directory.
@@ -18,10 +10,12 @@
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
+from django.core.management import setup_environ, execute_from_command_line
+
# setup the environment before we start accessing things in the settings.
setup_environ(settings_mod)
-sys.path.insert(0, join(settings.PROJECT_ROOT, "apps"))
+sys.path.insert(0, join(settings_mod.PROJECT_ROOT, "apps"))
if __name__ == "__main__":
execute_from_command_line()
View
33 requirements/mkii.txt
@@ -0,0 +1,33 @@
+# project.txt is a pip requirements file which describes the distributions
+# required by your project to run.
+
+# grabbed from base.txt
+Django==1.3
+
+django-debug-toolbar==0.8.3
+django-staticfiles==0.2.0
+
+django-uni-form==0.7.0
+
+django-pagination==1.0.7
+django-notification==0.1.4
+
+django_extensions==0.4.1
+simplejson==2.1.1
+github2==0.2.0
+south==0.7.2
+django-tastypie==0.9.7
+django-reversion==1.3.1
+django-sorting==0.1
+coverage==3.4
+django-coverage==1.1.1
+django-flatblocks==0.5.0
+feedparser==5.0.1
+psycopg2==2.4
+django-classy-tags==0.3.3.1
+
+# Celery dependencies:
+celery==2.2.4
+kombu==1.0.4
+django-celery==2.2.4
+django-kombu==0.9.2
View
37 settings.py
@@ -4,18 +4,13 @@
import os.path
import sys
import posixpath
-import pinax
-PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
-# tells Pinax to use the default theme
-PINAX_THEME = "default"
-
DEBUG = False
TEMPLATE_DEBUG = DEBUG
-# tells Pinax to serve media through the staticfiles app.
+# serve media through the staticfiles app.
SERVE_MEDIA = DEBUG
INTERNAL_IPS = [
@@ -76,7 +71,6 @@
# Additional directories which hold static files
STATICFILES_DIRS = [
os.path.join(PROJECT_ROOT, "media"),
- os.path.join(PINAX_ROOT, "media", PINAX_THEME),
]
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
@@ -105,18 +99,14 @@
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"reversion.middleware.RevisionMiddleware",
- "django_openid.consumer.SessionConsumer",
"django.contrib.messages.middleware.MessageMiddleware",
- "pinax.apps.account.middleware.LocaleMiddleware",
"pagination.middleware.PaginationMiddleware",
"django_sorting.middleware.SortingMiddleware",
- "pinax.middleware.security.HideSensistiveFieldsMiddleware",
"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
]
TEMPLATE_DIRS = [
os.path.join(PROJECT_ROOT, "templates"),
- os.path.join(PINAX_ROOT, "templates", PINAX_THEME),
]
TEMPLATE_CONTEXT_PROCESSORS = [
@@ -129,12 +119,7 @@
"staticfiles.context_processors.static_url",
- "pinax.core.context_processors.pinax_settings",
-
- "pinax.apps.account.context_processors.account",
-
"notification.context_processors.notification",
- "announcements.context_processors.site_wide_announcements",
"package.context_processors.used_packages_list",
"homepage.context_processors.grid_tabs",
@@ -166,20 +151,11 @@
"django.contrib.humanize",
"django.contrib.flatpages",
- "pinax.templatetags",
-
# external
"notification", # must be first
"staticfiles",
- "mailer",
"uni_form",
- "django_openid",
- "ajax_validation",
- "timezones",
- "emailconfirmation",
- "announcements",
"pagination",
- "idios",
"django_extensions",
"south",
"tastypie",
@@ -187,16 +163,9 @@
"django_sorting",
"flatblocks",
- # Pinax
- "pinax.apps.account",
- "pinax.apps.signup_codes",
- "pinax.apps.analytics",
-
# Celery task queue:
'djcelery',
- # Sentry error logging:
- 'sentry.client',
]
INSTALLED_APPS = PREREQ_APPS + PROJECT_APPS
@@ -220,10 +189,6 @@
ACCOUNT_EMAIL_AUTHENTICATION = False
ACCOUNT_UNIQUE_EMAIL = EMAIL_CONFIRMATION_UNIQUE_EMAIL = False
-AUTHENTICATION_BACKENDS = [
- "pinax.apps.account.auth_backends.AuthenticationBackend",
-]
-
LOGIN_URL = "/account/login/" # @@@ any way this can be a url name?
LOGIN_REDIRECT_URLNAME = "home"
View
1  templates/about/about.html
@@ -1,7 +1,6 @@
{% extends "site_base.html" %}
{% load i18n %}
-{% load ifsetting_tag %}
{% block head_title %}{% trans "What Next?" %}{% endblock %}
View
1  templates/about/what_next.html
@@ -1,7 +1,6 @@
{% extends "site_base.html" %}
{% load i18n %}
-{% load ifsetting_tag %}
{% block head_title %}{% trans "What Next?" %}{% endblock %}
View
3  templates/account/login.html
@@ -2,8 +2,7 @@
{% load i18n %}
{% load uni_form_tags %}
-{% load ifsetting_tag %}
-{% load account_tags %}
+{% load profile_tags %}
{% block head_title %}{% trans "Login" %}{% endblock %}
View
2  templates/account/password_reset.html
@@ -2,7 +2,7 @@
{% load i18n %}
{% load uni_form_tags %}
-{% load account_tags %}
+{% load profile_tags %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
View
1  templates/account/password_reset_done.html
@@ -1,7 +1,6 @@
{% extends "account/base.html" %}
{% load i18n %}
-{% load account_tags %}
{% load flatblock_tags %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
View
5 templates/base.html
@@ -1,7 +1,7 @@
{% load i18n %}
-{% load ifsetting_tag account_tags openid_tags %}
{% load packaginator_tags %}
{% load flatblock_tags %}
+{% load profile_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}">
<head>
@@ -55,7 +55,7 @@
<div class="login">
{% if user.is_authenticated %}
- {% ifopenid %}<img src="{{ STATIC_URL }}images/openid-icon.png" alt="Logged in with OpenID" />{% endifopenid %}<b>{% user_display user %}</b>
+ <b>{% user_display user %}</b>
|
<a href="/help/">{% trans "Help" %}</a>
|
@@ -155,7 +155,6 @@
<script src="{{ STATIC_URL }}pinax/js/base.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}js/site.js" type="text/javascript"></script>
- {% include "facebox_js.html" %}
{% fixed_ga %}
{% block extra_body %}{% endblock %}
View
1  templates/homepage.html
@@ -2,7 +2,6 @@
{% load cache %}
{% load i18n %}
-{% load ifsetting_tag %}
{% load package_tags %}
{% load flatblock_tags %}
View
1  templates/idios/profile.html
@@ -1,7 +1,6 @@
{% extends "site_base.html" %}
{% load i18n %}
-{% load account_tags %}
{% load profile_tags %}
{% load uni_form_tags %}
View
2  templates/idios/profiles.html
@@ -1,9 +1,9 @@
{% extends "site_base.html" %}
{% load i18n %}
-{% load account_tags %}
{% load pagination_tags %}
{% load sorting_tags %}
+{% load profile_tags %}
{% block head_title %}{% trans "All Profiles" %}{% endblock %}
View
1  templates/package/category.html
@@ -2,7 +2,6 @@
{% load cache %}
{% load i18n %}
-{% load ifsetting_tag %}
{% load package_tags %}
{% load pagination_tags %}
{% load sorting_tags %}
View
1  templates/package/package_list.html
@@ -2,7 +2,6 @@
{% load cache %}
{% load i18n %}
-{% load ifsetting_tag %}
{% load package_tags %}
{% block extra_head %}
View
20 urls.py
@@ -6,27 +6,17 @@
from django.contrib import admin
admin.autodiscover()
-from pinax.apps.account.openid_consumer import PinaxConsumer
-
from homepage.views import homepage
from package.views import package_autocomplete, category, packaginate
-handler500 = "pinax.views.server_error"
-
urlpatterns = patterns("",
url(r"^$", homepage, name="home"),
-
-
- url(r"^admin/invite_user/$", "pinax.apps.signup_codes.views.admin_invite_user", name="admin_invite_user"),
url(r"^admin/", include(admin.site.urls)),
url(r"^about/", include("about.urls")),
- url(r"^account/", include("pinax.apps.account.urls")),
- url(r"^openid/(.*)", PinaxConsumer()),
- url(r"^profiles/", include("idios.urls")),
+ url(r"^profiles/", include("profiles.urls")),
url(r"^notices/", include("notification.urls")),
- url(r"^announcements/", include("announcements.urls")),
url(r"^packages/", include("package.urls")),
url(r"^grids/", include("grid.urls")),
url(r"^search/", include("searchv1.urls")),
@@ -47,7 +37,13 @@
regex = '^autocomplete/package/$',
view = package_autocomplete,
name = 'package_autocomplete',
- )
+ ),
+
+ #TODO - fix these by using django-registration
+ url(r"^account/login/$", direct_to_template, {"template": "about/about.html"}, name="acct_login"),
+ url(r"^signup/$", direct_to_template, {"template": "about/about.html"}, name="acct_signup"),
+ url(r"^logout/$", direct_to_template, {"template": "about/about.html"}, name="acct_logout"),
+ url(r"^email/$", direct_to_template, {"template": "about/about.html"}, name="acct_email"),
)
Please sign in to comment.
Something went wrong with that request. Please try again.