Just quit it with this relative import stuff.
While I think these relative imports seem to be valid for the running application, I am having trouble with the django-admin applications regarding them. I don't see this syntactic sugar as absolutely essential, so I'm just going to change it now.
This commit is contained in:
		
							parent
							
								
									d73018440a
								
							
						
					
					
						commit
						f6bbcc7ee3
					
				
					 18 changed files with 20 additions and 20 deletions
				
			
		|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import EntryTag, Entry | from conservancy.apps.blog.models import EntryTag, Entry | ||||||
| 
 | 
 | ||||||
| class EntryTagAdmin(admin.ModelAdmin): | class EntryTagAdmin(admin.ModelAdmin): | ||||||
|     prepopulated_fields = {'slug': ('label',)} |     prepopulated_fields = {'slug': ('label',)} | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| from django.conf.urls import patterns, url, include | from django.conf.urls import patterns, url, include | ||||||
| from models import Entry, EntryTag # relative import | from conservancy.apps.blog.models import Entry, EntryTag # relative import | ||||||
| from conservancy.apps.staff.models import Person | from conservancy.apps.staff.models import Person | ||||||
| from datetime import datetime | from datetime import datetime | ||||||
| from views import last_name, BlogYearArchiveView, BlogMonthArchiveView, BlogDayArchiveView, BlogDateDetailView | from conservancy.apps.blog.views import last_name, BlogYearArchiveView, BlogMonthArchiveView, BlogDayArchiveView, BlogDateDetailView | ||||||
| 
 | 
 | ||||||
| extra_context = {} | extra_context = {} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| from models import Entry, EntryTag # relative import | from conservancy.apps.blog.models import Entry, EntryTag # relative import | ||||||
| # from django.views.generic.list_detail import object_list | # from django.views.generic.list_detail import object_list | ||||||
| from django.views.generic import ListView | from django.views.generic import ListView | ||||||
| from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView | from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import ContactEntry | from conservancy.apps.contacts.models import ContactEntry | ||||||
| 
 | 
 | ||||||
| class ContactEntryAdmin(admin.ModelAdmin): | class ContactEntryAdmin(admin.ModelAdmin): | ||||||
|     list_display = ('email', 'subscribe_conservancy') |     list_display = ('email', 'subscribe_conservancy') | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| from django.shortcuts import render_to_response | from django.shortcuts import render_to_response | ||||||
| from django import forms | from django import forms | ||||||
| from models import ContactEntry | from conservancy.app.contacts.models import ContactEntry | ||||||
| from django.forms import ModelForm | from django.forms import ModelForm | ||||||
| 
 | 
 | ||||||
| def subscribe(request): | def subscribe(request): | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import EventTag, Event, EventMedia | from conservancy.apps.event.models import EventTag, Event, EventMedia | ||||||
| 
 | 
 | ||||||
| admin.site.register(EventTag) | admin.site.register(EventTag) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.conf.urls import patterns, url, include | from django.conf.urls import patterns, url, include | ||||||
| from models import Event # relative import | from conservancy.apps.events.models import Event | ||||||
| 
 | 
 | ||||||
| info_dict = { | info_dict = { | ||||||
|     'queryset': Event.objects.all(), |     'queryset': Event.objects.all(), | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ from django.shortcuts import render_to_response | ||||||
| from django.http import Http404, HttpResponse | from django.http import Http404, HttpResponse | ||||||
| from django.template import loader | from django.template import loader | ||||||
| from django.core.exceptions import ObjectDoesNotExist | from django.core.exceptions import ObjectDoesNotExist | ||||||
| from models import Event # relative import | from conservancy.apps.events.models import Event | ||||||
| # for debugging... | # for debugging... | ||||||
| from django.http import HttpResponse | from django.http import HttpResponse | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import FundraisingGoal | from conservancy.apps.fundgoal.models import FundraisingGoal | ||||||
| 
 | 
 | ||||||
| class FundraisingGoalAdmin(admin.ModelAdmin): | class FundraisingGoalAdmin(admin.ModelAdmin): | ||||||
|     list_display = ('display_name', 'display_until_date') |     list_display = ('display_name', 'display_until_date') | ||||||
|  |  | ||||||
|  | @ -1,2 +1,2 @@ | ||||||
| from models import FundraisingGoal # relative import | from conservancy.apps.fundgoal.models import FundraisingGoal | ||||||
| from django.shortcuts import get_object_or_404, render_to_response | from django.shortcuts import get_object_or_404, render_to_response | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import PressRelease, ExternalArticleTag, ExternalArticle | from conservancy.apps.news.models import PressRelease, ExternalArticleTag, ExternalArticle | ||||||
| 
 | 
 | ||||||
| class PressReleaseAdmin(admin.ModelAdmin): | class PressReleaseAdmin(admin.ModelAdmin): | ||||||
|     list_display = ("headline", "pub_date") |     list_display = ("headline", "pub_date") | ||||||
|  |  | ||||||
|  | @ -19,8 +19,8 @@ | ||||||
| 
 | 
 | ||||||
| from django.conf.urls import patterns, url, include | from django.conf.urls import patterns, url, include | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
| from models import PressRelease, ExternalArticle # relative import | from conservancy.app.news.models import PressRelease, ExternalArticle | ||||||
| from views import NewsYearArchiveView, NewsMonthArchiveView, NewsDayArchiveView, NewsDateDetailView | from conservancy.apps.news.views import NewsYearArchiveView, NewsMonthArchiveView, NewsDayArchiveView, NewsDateDetailView | ||||||
| 
 | 
 | ||||||
| info_dict = { | info_dict = { | ||||||
|     'queryset': PressRelease.objects.all().filter(sites__id__exact=settings.SITE_ID), |     'queryset': PressRelease.objects.all().filter(sites__id__exact=settings.SITE_ID), | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import Person | from conservancy.apps.staff.models import Person | ||||||
| 
 | 
 | ||||||
| class PersonAdmin(admin.ModelAdmin): | class PersonAdmin(admin.ModelAdmin): | ||||||
|     list_display = ("username", "formal_name", "casual_name", |     list_display = ("username", "formal_name", "casual_name", | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import SummitRegistration | from conservancy.apps.summit_registration.models import SummitRegistration | ||||||
| 
 | 
 | ||||||
| class SummitRegistrationAdmin(admin.ModelAdmin): | class SummitRegistrationAdmin(admin.ModelAdmin): | ||||||
|     list_display = ('name', 'email', 'affiliation', 'cle_credit') |     list_display = ('name', 'email', 'affiliation', 'cle_credit') | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| from django.shortcuts import render_to_response | from django.shortcuts import render_to_response | ||||||
| from django import forms | from django import forms | ||||||
| from models import SummitRegistration | from conervancy.apps.summit_registration.models import SummitRegistration | ||||||
| 
 | 
 | ||||||
| def register(request): | def register(request): | ||||||
|     """Summit registration form view |     """Summit registration form view | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import Supporter | from conservancy.app.Supporter.models import Supporter | ||||||
| 
 | 
 | ||||||
| class SupporterAdmin(admin.ModelAdmin): | class SupporterAdmin(admin.ModelAdmin): | ||||||
|     list_display = ('display_name', 'display_until_date') |     list_display = ('display_name', 'display_until_date') | ||||||
|  |  | ||||||
|  | @ -1,3 +1,3 @@ | ||||||
| from models import Supporter # relative import | from conservancy.apps.supporters.models import Supporter | ||||||
| from django.shortcuts import get_object_or_404, render_to_response | from django.shortcuts import get_object_or_404, render_to_response | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from models import EarthLocation | from conservancy.apps.worldmap.models import EarthLocation | ||||||
| 
 | 
 | ||||||
| class EarthLocationAdmin(admin.ModelAdmin): | class EarthLocationAdmin(admin.ModelAdmin): | ||||||
|     list_display = ("label", "html_map_link") |     list_display = ("label", "html_map_link") | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn