Commits

Kai Diefenbach  committed da8e1cd

Initial import

  • Participants

Comments (0)

Files changed (12)

+syntax: glob
+*.pyc
+*.pyo
+*.DS_Store
+*.installed.cfg
+*build/
+*dist/
+*.egg-info/
+Copyright (c) 2011, Kai Diefenbach - iqplusplus
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+    
+    * Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+      
+    * Neither the name of the author nor the names of other contributors may 
+      be used to endorse or promote products derived from this software 
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+include README.txt
+include LICENSE.txt
+recursive-include lfc_folder/templates *
+recursive-include lfc_folder/locale *
+What is it?
+===========
+
+A folder content type for `LFC <http://pypi.python.org/pypi/django-lfc/>`_
+
+Changes
+=======
+
+No public release yet.

File lfc_folder/__init__.py

+# django imports
+from django.utils.translation import ugettext_lazy as _
+
+# lfc imports
+from lfc.utils.registration import register_content_type
+from lfc.utils.registration import unregister_content_type
+
+# lfc_folder imports
+from lfc_folder.models import Folder
+
+name = _(u"Folder")
+description = _(u"A folder content type for LFC")
+
+
+def install():
+    """Installs the folder application.
+    """
+    # Register objects
+    register_content_type(
+        Folder,
+        name="Folder",
+        sub_types=["Folder"],
+        templates=["Plain", "Gallery", "Overview"],
+        default_template="Overview")
+
+
+def uninstall():
+    """Uninstalls the folder application.
+    """
+    # Unregister content type
+    unregister_content_type("Folder")

File lfc_folder/forms.py

+# django imports
+from django import forms
+
+# lfc_folder imports
+from lfc_folder.models import Folder
+
+
+class FolderDataForm(forms.ModelForm):
+    """Core data form for folder.
+    """
+    class Meta:
+        model = Folder
+        fields = ("title", "display_title", "slug", "description", "tags")

File lfc_folder/interfaces.py

+# lfc imports
+from lfc.interfaces import IBaseContent
+
+
+class IFolder(IBaseContent):
+    """
+    Interface to mark an Folder.
+    """
+    pass

File lfc_folder/locale/de/LC_MESSAGES/django.mo

Binary file added.

File lfc_folder/locale/de/LC_MESSAGES/django.po

+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-10-15 07:41-0500\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: __init__.py:11
+msgid "Folder"
+msgstr "Ordner"
+
+#: __init__.py:12
+msgid "A folder content type for LFC"
+msgstr "Ein Ordner Inhaltstyp für LFC"

File lfc_folder/models.py

+# django imports
+from django.utils.translation import ugettext_lazy as _
+
+# lfc imports
+import lfc.utils
+from lfc.models import BaseContent
+
+# lfc_folder imports
+from lfc_folder.interfaces import IFolder
+
+# zope imports
+from zope.interface import implements
+
+
+class Folder(BaseContent):
+    """
+    A Folder can hold other content objects.
+    """
+    implements(IFolder)
+
+    def get_searchable_text(self):
+        return ""
+
+    def edit_form(self, **kwargs):
+        """
+        Returns the edit form of the folder.
+        """
+        from lfc_folder.forms import FolderDataForm
+        return FolderDataForm(**kwargs)
+
+    def has_images_tab(self):
+        return super(Folder, self).has_images_tab(False)
+
+    def has_files_tab(self):
+        return super(Folder, self).has_files_tab(False)
+
+    def has_comments_tab(self):
+        return super(Folder, self).has_comments_tab(False)

File lfc_folder/test.py

Empty file added.
+from setuptools import setup, find_packages
+import os
+
+version = '1.0b1'
+
+here = os.path.abspath(os.path.dirname(__file__))
+README = open(os.path.join(here, 'README.txt')).read()
+
+setup(name='lfc-folder',
+      version=version,
+      description='Folder content type for LFC',
+      long_description=README,
+      classifiers=[
+          'Development Status :: 4 - Beta',
+          'Environment :: Web Environment',
+          'Framework :: Django',
+          'License :: OSI Approved :: BSD License',
+          'Operating System :: OS Independent',
+          'Programming Language :: Python',
+      ],
+      keywords='django lfc cms',
+      author='Kai Diefenbach',
+      author_email='kai.diefenbach@iqpp.de',
+      url='http://www.iqpp.de',
+      license='BSD',
+      packages=find_packages(exclude=['ez_setup']),
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+        'setuptools',
+      ],
+      )