Skip to content

Commit

Permalink
Merge pull request #861 from rafalp/0.7
Browse files Browse the repository at this point in the history
Misago 0.7
  • Loading branch information
rafalp authored Jun 1, 2017
2 parents acddac1 + 0fc87fb commit 28abb92
Show file tree
Hide file tree
Showing 43 changed files with 50 additions and 1,872 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include README.rst
include requirements.txt
graft docs
prune docs/build
prune extras
prune testproject
graft misago
global-exclude __pycache__
Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Misago
:alt: Works on Python 2.7, 3.5, 3,6


**Development Status:** 🍌 `Banans <https://en.wikipedia.org/wiki/Perpetual_beta>`_ 🍌
**Development Status:** 🍌 `Bananas <https://en.wikipedia.org/wiki/Perpetual_beta>`_ 🍌

Misago aims to be complete, featured and modern forum solution that has no fear to say 'NO' to common and outdated opinions about how forum software should be made and what it should do.

Expand Down Expand Up @@ -62,11 +62,13 @@ As of now Misago implements all features considered "must have" on live internet

Even more features will follow in future releases:

* Admin-manageable custom profile fields letting site admins to define custom fields for users to fill in without need to write any code.
* Achievements and awards system.
* Custom profile fields letting site owners to define custom fields for users to fill in.
* Content reporting for users to report offensive content.
* Forum-wide JS routing further reducing navigation times.
* Notifications for users to notice content and events of concern faster.
* Post accurate read tracker that lets moderators spot unapproved replies and non-moderators spot approved posts.
* Sign in with Facebook/Google/Github/Steam/etc/ect.
* Warning system for easy tracking users history of infractions and offenses.
* WYSIWYM content editor for even easier post formatting.

Expand Down
13 changes: 7 additions & 6 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Table of contents

* [Introduction](./README.md)
* [Setup and maintenance](./SetupMaintenance.md)
* [Upgrading from Misago 0.5](./UpgradingFrom05.md)
* [Setup and maintenance](./setup/README.md)
* [Updating from Misago 0.5](./setup/UpdatingFrom05.md)
* [Update paths](./setup/UpdatePaths.md)
* [Settings](./settings/README.md)
* [Core settings](./settings/Core.md)
* [Database settings](./settings/Database.md)
* [Coding style](./CodingStyle.md)
* [User rank styles](./UserRankStyles.md)
* [Category styles](./CategoryStyles.md)
Expand All @@ -25,7 +29,4 @@
* [Template tags](./TemplateTags.md)
* [Shortcuts](./Shortcuts.md)
* [Thread store](./ThreadStore.md)
* [View errors](./ViewErrors.md)
* [Settings](./settings/README.md)
* [Core settings](./settings/Core.md)
* [Database settings](./settings/Database.md)
* [View errors](./ViewErrors.md)
4 changes: 2 additions & 2 deletions docs/SetupMaintenance.md → docs/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ This error is caused by Misago being installed using setuptools older than 8.0 r

To install Misago setup and activate virtual environment for your site and then fire following command:

pip install misago --pre
pip install misago

This will install Misago in your virtual environment and make `misago-start.py` script available for you to use to create pre-configured Misago site.

Now decide on your site's module name. This name will be used for python module that will contain your configuration files. This means it should be only latin lowercase letters and (optionally) digits or underscore sign ("_"). Good idea is to use your domain name as source for project namespace, for example turning "misago-forum.org" into "misagoforumorg".

Once you've decided on your name, create your site configuration module. In example we assume your site will be named "misagoforumorg":

misago-start.py misagoforumorg
misago-start.py misagoforumorg

This will create directory "misagoforumorg" in your working directory. Inside you will find following items:

Expand Down
24 changes: 24 additions & 0 deletions docs/setup/UpgradePath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Update path
===========

Some versions of Misago contain migrations for deprecated features.

## 0.6 Alphas to 0.6

### Some database indexes have changed

Misago 0.6 final release contains special migrations that replace old database indexes with new ones using custom `PgPartialIndex` index class that uses custom index types feature that was introduced in the Django 1.11.


## 0.6 to 0.7

### `misago.datamover` has been removed

`misago.datamover` entry in your `settings.py` `INSTALLED_APPS` setting is an error in Misago 0.7 and should be removed. Likewise the `url(r'^', include('misago.datamover.urls'))` entry in your `urls.py` will also error and has to be removed.

If you have updated to Misago 0.6 from Misago 0.5 and you looking to preserve redirects from old links after update to 0.7, please use the [Misago 0.5 Redirects](https://github.com/rafalp/Misago-05-Redirects) app.


### `CreatePartialIndex` and `CreatePartialCompositeIndex` migration utilities have been removed

0.7 release finalizes deprecation of previous implementation of custom indexes via removal of old migration utilities as well as their migrations. Attempting the update from any of the 0.6's alphas to 0.7 and skipping the 0.6 final release on the way will lead to your database containing both old and new indexes which may be source of errors in future migrations.
11 changes: 9 additions & 2 deletions docs/UpgradingFrom05.md → docs/setup/UpgradingFrom05.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Upgrading from Misago 0.5
Updating from Misago 0.5
=========================

Misago 0.6 comes with special utility that allows those upgrading from Misago 0.5 to move their data to new site. This utility, named `datamover`, provides set of management commands allowing you to move data over.
Misago 0.6 comes with special utility that allows those updating from Misago 0.5 to move their data to new site. This utility, named `datamover`, provides set of management commands allowing you to move data over.


##### Version support

The `datamover` is only available in the Misago 0.6. If you are updating from Misago 0.5, make sure you've installed Misago 0.6 before moving on.

If you have already updated to 0.6 and you looking to preserve redirects from old links after updating Misago to next version, please use the [Misago 0.5 Redirects](https://github.com/rafalp/Misago-05-Redirects) app.


##### Note:
Expand Down
2 changes: 1 addition & 1 deletion misago/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.6.0'
__version__ = '0.7.0'
79 changes: 0 additions & 79 deletions misago/core/pgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from django.core.paginator import Paginator
from django.db.models import Index
from django.db.migrations.operations import RunSQL
from django.utils.six import text_type


class PgPartialIndex(Index):
Expand Down Expand Up @@ -98,83 +96,6 @@ def get_sql_extra(self, model, schema_editor):
return ' WHERE {}'.format(' AND '.join(sorted(clauses)))


class CreatePartialIndex(RunSQL):
CREATE_SQL = """
CREATE INDEX %(index_name)s ON %(table)s (%(field)s)
WHERE %(condition)s;
"""

REMOVE_SQL = """
DROP INDEX %(index_name)s
"""

def __init__(self, field, index_name, condition):
self.model, self.field = field.split('.')
self.index_name = index_name
self.condition = condition

@property
def reversible(self):
return True

def state_forwards(self, app_label, state):
pass

def database_forwards(self, app_label, schema_editor, from_state, to_state):
model = from_state.apps.get_model(app_label, self.model)

statement = self.CREATE_SQL % {
'index_name': self.index_name,
'table': model._meta.db_table,
'field': self.field,
'condition': self.condition,
}

schema_editor.execute(statement)

def database_backwards(self, app_label, schema_editor, from_state, to_state):
schema_editor.execute(self.REMOVE_SQL % {'index_name': self.index_name})

def describe(self):
message = "Create PostgreSQL partial index on field %s in %s for %s"
formats = (self.field, self.model_name, self.values)
return message % formats


class CreatePartialCompositeIndex(CreatePartialIndex):
CREATE_SQL = """
CREATE INDEX %(index_name)s ON %(table)s (%(fields)s)
WHERE %(condition)s;
"""

REMOVE_SQL = """
DROP INDEX %(index_name)s
"""

def __init__(self, model, fields, index_name, condition):
self.model = model
self.fields = fields
self.index_name = index_name
self.condition = condition

def database_forwards(self, app_label, schema_editor, from_state, to_state):
model = from_state.apps.get_model(app_label, self.model)

statement = self.CREATE_SQL % {
'index_name': self.index_name,
'table': model._meta.db_table,
'fields': ', '.join(self.fields),
'condition': self.condition,
}

schema_editor.execute(statement)

def describe(self):
message = ("Create PostgreSQL partial composite index on fields %s in %s for %s")
formats = (', '.join(self.fields), self.model_name, self.values)
return message % formats


def batch_update(queryset, step=50):
"""util because psycopg2 iterators aren't memory effective in Dj<1.11"""
paginator = Paginator(queryset.order_by('pk'), step)
Expand Down
10 changes: 0 additions & 10 deletions misago/datamover/__init__.py

This file was deleted.

99 changes: 0 additions & 99 deletions misago/datamover/attachments.py

This file was deleted.

68 changes: 0 additions & 68 deletions misago/datamover/avatars.py

This file was deleted.

Loading

0 comments on commit 28abb92

Please sign in to comment.