Harro van der Klauw avatar Harro van der Klauw committed 5abbfec

Updated version number to 0.2a
Added migrations (Install South to use them)
Updated the code to work with rc3 of django-cms (actually tested against latest revision)

Comments (0)

Files changed (6)

 Download: http://bitbucket.org/MrOxiMoron/cmsplugin-news/
 
 Requirements:
-- django-cms-2.0: rev 2b59edde3cf1c140edfb14b544f2fbcbd56073f8
+- django-cms-2.0: rev 7353b46ba14dd30bf8db8d0981f35df5bde67fad
 - django: 1.1.1
 + requirements for django-cms-2.0
 
 Last tested with:
-- django-cms-2.0: rev 276bae54e2184187db7e71f2aab54121db7c729d
+- django-cms-2.0: rev ed053ba1bf875e5f5ca3a0e111bf572093c71222
 - django: 1.1.1
 
 Setup
 - Add more tests
 - add to cms_plugins.py for plugins
  - month view with days that link to archive_day view
-- add setup.py for easyinstall / pip
 - Allow comments on news (add option to the news model for it)
-- Add migrations
 - Optimize the navigation code, it works but there is probably a better way to do it.
 - Add RSS feed
 - Add optional author field

cmsplugin_news/migrations/0001_initial.py

+
+from south.db import db
+from django.db import models
+from cmsplugin_news.models import *
+
+class Migration:
+    
+    def forwards(self, orm):
+        
+        # Adding model 'News'
+        db.create_table('cmsplugin_news_news', (
+            ('id', orm['cmsplugin_news.News:id']),
+            ('title', orm['cmsplugin_news.News:title']),
+            ('slug', orm['cmsplugin_news.News:slug']),
+            ('excerpt', orm['cmsplugin_news.News:excerpt']),
+            ('content', orm['cmsplugin_news.News:content']),
+            ('is_published', orm['cmsplugin_news.News:is_published']),
+            ('pub_date', orm['cmsplugin_news.News:pub_date']),
+            ('created', orm['cmsplugin_news.News:created']),
+            ('updated', orm['cmsplugin_news.News:updated']),
+        ))
+        db.send_create_signal('cmsplugin_news', ['News'])
+        
+        # Adding model 'LatestNewsPlugin'
+        db.create_table('cmsplugin_latestnewsplugin', (
+            ('cmsplugin_ptr', orm['cmsplugin_news.LatestNewsPlugin:cmsplugin_ptr']),
+            ('limit', orm['cmsplugin_news.LatestNewsPlugin:limit']),
+        ))
+        db.send_create_signal('cmsplugin_news', ['LatestNewsPlugin'])
+        
+    
+    
+    def backwards(self, orm):
+        
+        # Deleting model 'News'
+        db.delete_table('cmsplugin_news_news')
+        
+        # Deleting model 'LatestNewsPlugin'
+        db.delete_table('cmsplugin_latestnewsplugin')
+        
+    
+    
+    models = {
+        'cms.cmsplugin': {
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'max_length': '5', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Page']"}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+            'placeholder': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.CMSPlugin']"}),
+            'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.page': {
+            'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+            'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'menu_login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'moderator_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'blank': 'True'}),
+            'navigation_extenders': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['cms.Page']"}),
+            'publication_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+            'publication_end_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+            'published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.Page']"}),
+            'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}),
+            'reverse_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
+            'soft_root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+            'template': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cmsplugin_news.latestnewsplugin': {
+            'Meta': {'db_table': "'cmsplugin_latestnewsplugin'"},
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'limit': ('django.db.models.fields.PositiveIntegerField', [], {})
+        },
+        'cmsplugin_news.news': {
+            'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'excerpt': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'pub_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2009, 11, 12, 12, 42, 43, 893838)'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+        },
+        'sites.site': {
+            'Meta': {'db_table': "'django_site'"},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        }
+    }
+    
+    complete_apps = ['cmsplugin_news']
Add a comment to this file

cmsplugin_news/migrations/__init__.py

Empty file added.

cmsplugin_news/widgets/tinymce_widget.py

 from tinymce.widgets import TinyMCE, get_language_config
-from cms.settings import CMS_MEDIA_URL
+from django.conf.settings import CMS_MEDIA_URL
 from django.utils.translation import get_language
 from django.template.loader import render_to_string
 from django.utils.safestring import mark_safe

cmsplugin_news/widgets/wymeditor_widget.py

 from django.template.loader import render_to_string
 from django.forms import Textarea
 
-from cms.settings import CMS_MEDIA_URL
+from django.conf.settings import CMS_MEDIA_URL
 from cms.plugins.text import settings as text_settings
 from django.utils.translation.trans_real import get_language
 
 
 setup(
     name='cmsplugin-news',
-    version='0.1a5',
+    version='0.2a',
     description='This is a news app/plugin for the django-cms 2',
     author='Harro van der Klauw',
     author_email='hvdklauw@gmail.com',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.