Commits

tehfink committed d709cd6

unnecessary example project files

  • Participants
  • Parent commits 536b2a3

Comments (0)

Files changed (19)

File examples/cms-trunk/cmsplugin_photologue_example/categories/__init__.py

Empty file removed.

File examples/cms-trunk/cmsplugin_photologue_example/categories/admin.py

-from django.contrib import admin
-from categories.models import Category
-from reversion.admin import VersionAdmin
-
-
-class CategoryAdmin(VersionAdmin):
-    pass
-
-admin.site.register(Category, CategoryAdmin)

File examples/cms-trunk/cmsplugin_photologue_example/categories/models.py

-from django.db import models
-from django.core.urlresolvers import reverse
-import mptt
-
-class Category(models.Model):
-    parent = models.ForeignKey('self', blank=True, null=True)
-    name = models.CharField(max_length=20)
-    
-    def __unicode__(self):
-        return self.name
-    
-    def get_title(self):
-        return self.name
-    
-    def get_menu_title(self):
-        return self.name
-    
-    def get_absolute_url(self):
-        return reverse('category_view', args=[self.pk])
-    
-    class Meta:
-        verbose_name_plural = 'categories'
-    
-try:
-    mptt.register(Category)
-except mptt.AlreadyRegistered:
-    pass

File examples/cms-trunk/cmsplugin_photologue_example/categories/navigation.py

-from categories.models import Category
-
-def get_nodes(request):
-    cats = list(Category.objects.all())
-    res = []
-    all_cats = cats[:]
-    childs = []
-    for cat in cats:
-        if cat.parent_id:
-            childs.append(cat)
-        else:
-            res.append(cat)
-    for cat in all_cats:
-        cat.childrens = []
-        for child in childs:
-            if child.parent_id == cat.pk:
-                cat.childrens.append(child)
-    return res

File examples/cms-trunk/cmsplugin_photologue_example/categories/templates/categories/category_view.html

-{% extends 'index.html' %}
-
-{% block content %}
-<h1>{{ category.get_title }}</h1>
-{% endblock %}

File examples/cms-trunk/cmsplugin_photologue_example/categories/urls.py

-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('categories.views',
-    url(r'(?P<id>[0-9]+)/$', 'category_view', name='category_view'),
-)

File examples/cms-trunk/cmsplugin_photologue_example/categories/views.py

-from django.shortcuts import render_to_response
-from categories.models import Category
-from django.template.context import RequestContext
-
-
-def category_view(request, id):
-    return render_to_response('categories/category_view.html', RequestContext(request, {'category':Category.objects.get(pk=id)}))

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/__init__.py

Empty file removed.

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/media/sampleapp/img/gift.jpg

Removed
Old image

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/menu_extender.py

-from cms.utils.navigation import NavigationNode
-from django.core.urlresolvers import reverse
-from django.utils.translation import ugettext_lazy as _
-
-def get_nodes(request):
-    res = [] # result list
-    lang = request.LANGUAGE_CODE
-    n = NavigationNode(_('Sublevel'), reverse('%s:sample-app-sublevel' % lang))
-    n2 = NavigationNode(_('Sublevel3'), reverse('%s:sample-app-sublevel3' % lang))
-    n.childrens = [n2]
-    res.append(n)
-    n = NavigationNode(_('Sublevel 2'), reverse('%s:sample-app-sublevel2' % lang))
-    res.append(n)
-    return res

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/models.py

-from django.db import models
-
-# Create your models here.

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/templates/sampleapp/home.html

-{% extends "index.html" %}
-{% load cms_tags %}
-
-{% block content %}
-	<h2>Sample application home page</h2>
-	<h3>{{ message }}</h3>
-	{{ block.super }}
-	<ul>
-		<li>
-			<a href="{% url sample-app-sublevel %}">Sample app sublevel reverse test</a>
-		</li>
-		<li>
-			<a href="{% url de:sample-app-sublevel %}">Sample app sublevel reverse test de</a>
-		</li>
-		<li>
-			<a href="{% url en:sample-app-sublevel %}">Sample app sublevel reverse test en</a>
-		</li>
-	</ul>
-	<h4>Sample image  - appmedia works?</h4>
-	<img src="{{ MEDIA_URL }}sampleapp/img/gift.jpg" alt="gift">
-{% endblock content %}

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/urls.py

-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('sampleapp.views',
-    (r'^$', 'sample_view', {'message': 'urls.py => root',}),  
-    url(r'^sublevel/$', 'sample_view', kwargs={'message': 'urls.py => sublevel'}, name='sample-app-sublevel'),
-)

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/urlstwo.py

-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('sampleapp.views',
-    (r'^$', 'sample_view', {'message': 'urlstwo.py => root'}),
-    url(r'^sublevel/$', 'sample_view', {'message': 'urlstwo.py => sublevel1'}, name='sample-app-sublevel'),
-    url(r'^sublevel2/$', 'sample_view', {'message': 'urlstwo.py => sublevel2'}, name='sample-app-sublevel2'),
-    url(r'^sublevel/sublevel3/$', 'sample_view', {'message': 'urlstwo.py => sublevel3'}, name='sample-app-sublevel3'),
-)

File examples/cms-trunk/cmsplugin_photologue_example/sampleapp/views.py

-# Create your views here.
-from django.shortcuts import render_to_response
-from django.template.context import RequestContext
-
-def sample_view(request, **kw):
-    context = RequestContext(request, kw)
-    return render_to_response("sampleapp/home.html", context)

File examples/cms-trunk/cmsplugin_photologue_example/store/__init__.py

-"""Sample application for testing admin inlines.
-"""

File examples/cms-trunk/cmsplugin_photologue_example/store/cms_plugins.py

-from django.contrib import admin
-from cms.plugin_pool import plugin_pool
-from cms.plugin_base import CMSPluginBase
-from django.utils.translation import ugettext_lazy as _
-from example.store.models import Store, StoreItem
-
-from django.contrib import admin
-
-class StoreItemInlineAdmin(admin.TabularInline):
-    model = StoreItem
-
-
-class StorePlugin(CMSPluginBase):
-    model = Store
-    name = _("Store")
-    
-    inlines = [
-        StoreItemInlineAdmin,
-    ]
-    
-    render_template = "store/plugins/store.html"
-    
-    def render(self, context, instance, placeholder):
-        return {}
-    
-plugin_pool.register_plugin(StorePlugin)

File examples/cms-trunk/cmsplugin_photologue_example/store/models.py

-from django.conf import settings
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from cms.models import CMSPlugin
-from publisher import Publisher
-
-if 'reversion' in settings.INSTALLED_APPS:
-    import reversion
-
-class Store(CMSPlugin):
-    """Simple store example - for testing admin inlines
-    """
-    name = models.CharField(_('name'), max_length=32)
-    
-    class Meta:
-        verbose_name=_('Store')
-        verbose_name_plural=_('Store')
-        
-    __unicode__ = lambda self: self.name
-
-
-class StoreItem(Publisher):
-    """Store item examle
-    """
-    store = models.ForeignKey(Store, verbose_name=_('store item'))
-    name = models.CharField(_('name'), max_length=32)
-    price = models.DecimalField(_('price'), max_digits=10, decimal_places=4)
-    
-    class Meta:
-        verbose_name=_('Store item')
-        verbose_name_plural=_('Store items')
-        
-    __unicode__ = lambda self: self.name
-
-
-if 'reversion' in settings.INSTALLED_APPS:
-    try:
-        # seems there is some issue with reversion, probably this get imported
-        # more than once, so avoid multiple registrations
-        reversion.register(Store, follow=["cmsplugin_ptr", "storeitem_set"])
-        reversion.register(StoreItem)
-    except:
-        pass

File examples/cms-trunk/cmsplugin_photologue_example/store/templates/store/plugins/store.html

-<h3>MY SAMPLE STORE</h3>