Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications for registered and anonymous users #197

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
66c7108
included stock record partial into product template
May 21, 2012
19d0b1f
added notification template for product
May 21, 2012
672ec75
added notification views and templates
May 21, 2012
57a04cc
Merge branch 'master', remote-tracking branch 'upstream/master' into …
May 24, 2012
64743c3
added test case for general view of notification button
May 24, 2012
af1f9ab
placed notification form in paragraph
May 24, 2012
027b3fb
added missing <div> in product partial
May 24, 2012
b8d86a2
removed separated form for notification of anonymous user
May 24, 2012
eaeb445
fixed problem with notification test authentication
May 24, 2012
ffe6b27
modified notification models and added tests
May 24, 2012
771ba77
updated model for notification and basic view
May 25, 2012
531455d
fixed wrong call to super()
May 25, 2012
ba0337b
removed middleware for notification
May 25, 2012
f908d51
implemented confirmation and unsubscription incl. tests
May 25, 2012
5888f6d
clarified definition of key length in URLs
May 25, 2012
9d3d0f8
Merge branch 'master' into feature/notifications
May 27, 2012
1e730e6
added deleting notification for signed in users
May 28, 2012
75da2bf
added administration panel for registered users
May 28, 2012
0ad1ba1
added product link and status to notification panel
May 28, 2012
412e65b
added sending of notification emails on stock record update
May 28, 2012
7da09f6
filtered processed notifications out in user view
May 29, 2012
aee212e
added notification list and delete view to dashboard
May 29, 2012
c907288
added update view for notifications
May 29, 2012
0ffff28
fixed minor issue in table of review list template
May 29, 2012
7d475c5
added bulk editing to notification dashboard
May 29, 2012
b2ad788
added search form to notification dashboard
May 29, 2012
b532e59
added notification panel to user details in dashboard
May 29, 2012
b1009d5
updated product browsing page to work with notification
May 29, 2012
bd45103
added transfering of anonymous notifications at user registration
May 29, 2012
3d54f75
added templatetag for notification signup info
May 29, 2012
903a101
moved templatetags for notification app to oscar/templatetags
May 30, 2012
12a70bf
added clean up command for unconfirmed notifications
May 30, 2012
32dd2ef
merged master into feature/notifications
May 30, 2012
5aa80ae
merged master into feature/notifications
May 30, 2012
aec117c
minor renaming of views and url names in notifications
May 31, 2012
c06d156
PEP8 and documentation updateds in notification
May 31, 2012
0e131dd
PEP8 cleanup
May 31, 2012
374ec07
Merge branch 'feature/notifications' of github.com:elbaschid/django-o…
May 31, 2012
079576e
merge 'master' into 'feature/notifications'
Jun 4, 2012
8c3ca33
merged branch 'master' into 'feature/notifications'
Jun 13, 2012
b6b58cc
fixed typo in template for user notifications
Jun 14, 2012
2083eed
fixed breadcrumbs for notifications in dashboard
Jun 14, 2012
d5d9e57
cleaned the notification return statement
Jun 14, 2012
1355ff3
fixed instantiating NotImplmentedError in notification model
Jun 14, 2012
8a29b04
fixed i18n issues in notification models and receivers
Jun 14, 2012
9b5f847
added model_utils and made notifications more generic
Jun 14, 2012
4b4ffad
updated cleanup command to use Notification model
Jun 14, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -31,3 +31,5 @@ TODO
.coverage
htmlcov/*
sandbox/public/
logs/
build/
45 changes: 22 additions & 23 deletions CHANGELOG.rst
Expand Up @@ -2,34 +2,33 @@
Changelog
=========

0.1
~~~
0.2 - 01 June 2012
~~~~~~~~~~~~~~~~~~

* Initial release - used in production by two major applications at Tangent but
still quite rough around the edges. Many features were implemented directly
in the applications rather than using a feature from oscar.
* Docs are a bit stale and need updating in 0.2
Many components have been rewritten since 0.1 - Oscar is much more of a complete
package now. New features include:

Roadmap
-------
* Dashboard for managing catalogue, offers, stock, vouchers and more. This includes
statistics pages to track performance.

0.2
~~~
* Sample templates, CSS and JS to get a shop up and running in a minutes.

* Updated documentation.

Currently a work-in-progress, estimated release date: May 2012. It will feature:
* Reworking of shipping methods.

* Much better documentation, including recipes for common tasks
* Refactoring of shipping methods
* New dashboard functionality for product management, order management, customer services
* New dynamic class loading
* Lots more tests!
* A fully styled sandbox shop based on Twitter's bootstrap.
* Automatic up-selling on the basket page. We now inform the user if they
partially qualify for an offer.

0.3
The documentation still needs more work which we'll do over the next week or
two.

0.1
~~~

* Rewrite of search app to use Solr and probably not Haystack
* Much better support for variant products which aren't handled very well at the
moment.
* Dashboard issue management
* Better support for role-based permissions
* Initial release - used in production by two major applications at Tangent but
still quite rough around the edges. Many features were implemented directly
in the applications rather than using a feature from oscar.

* Docs are a bit stale and need updating in 0.2

28 changes: 20 additions & 8 deletions README.rst
Expand Up @@ -10,37 +10,49 @@ core functionality can be customised to suit the needs of your project. This
allows it to handle a wide range of e-commerce requirements, from large-scale B2C
sites to complex B2B sites rich in domain-specific business logic.

Oscar is used in production by:

* Tata - http://www.landmarkonthenet.com
* Carlsberg's global business platform is powered by Oscar.
* Dolbeau - http://www.dolbeau.ca/
* The UK Labour party

This README is just a stub - see the following links for more details
information:

* `Official homepage`_
* `Demo site`_ (experimental)
* `Documentation`_ on `readthedocs.org`_
* `Google Group`_ - the mailing list is django-oscar@googlegroups.com
* `Continuous integration homepage`_ on `travis-ci.org`_
* `Twitter account for news and updates`_
* `Twitter account of all commits`_

.. image:: https://secure.travis-ci.org/tangentlabs/django-oscar.png

.. _`Official homepage`: http://tangentlabs.github.com/django-oscar/
.. _`Official homepage`: http://oscarcommerce.com
.. _`Demo site`: http://sandbox.oscar.tangentlabs.co.uk
.. _`Documentation`: http://django-oscar.readthedocs.org/en/latest/
.. _`readthedocs.org`: http://readthedocs.org
.. _`Continuous integration homepage`: http://travis-ci.org/#!/tangentlabs/django-oscar
.. _`travis-ci.org`: http://travis-ci.org/
.. _`Twitter account for news and updates`: https://twitter.com/#!/django_oscar
.. _`Twitter account of all commits`: https://twitter.com/#!/oscar_django
.. _`Google Group`: https://groups.google.com/forum/?fromgroups#!forum/django-oscar

Oscar was written by `David Winterbottom`_ (`@codeinthehole`_) and is developed
and maintained by `Tangent Labs`_, a London-based digital agency.

Oscar is released under the permissive `New BSD license`_.

.. _`David Winterbottom`: http://codeinthehole.com
.. _`@codeinthehole`: https://twitter.com/codeinthehole
.. _`Tangent Labs`: http://www.tangentlabs.co.uk
.. _`New BSD license`: https://github.com/tangentlabs/django-oscar/blob/master/LICENSE

Case studies
------------

Oscar is still in active development, but is used in production by a range of
companies, from large multinationals to small, boutique stores:

* Tata Group - http://www.landmarkonthenet.com
* Carlsberg - Their global "We Deliver More" platform is powered by Oscar (but
is a B2B site so it not browsable by the public).
* Dolbeau - http://www.dolbeau.ca/
* The UK Labour party - http://shop.labour.org.uk (will be live in early June)

Many more on the way.
31 changes: 16 additions & 15 deletions docs/source/_draft/getting_started/installation.rst
Expand Up @@ -21,38 +21,38 @@ Create a new virtual env::
A nice extension now is to edit your ``~/.virtualenv/$PROJECTNAME/bin/postactivate`` file to contain::

cd ~/path/to/my/workspace/$PROJECTNAME

so that you can simply type ``workon $PROJECTNAME`` to jump into your project folder with the virtual
environment set-up.

Installation
------------
Install oscar and its dependencies::

Install oscar and its dependencies::

pip install -e git+git://github.com/tangentlabs/django-oscar.git#egg=django-oscar

You will also need to install the appropriate python module for your database of choice.
If you are using MySQL, then run the following::

pip install MySQL-python

Also, depending on your search backend for haystack, you'll need to install further
Also, depending on your search backend for haystack, you'll need to install further
packages::

pip install pysolr

Now create the project::

cd /path/to/my/workspace
django-admin.py startproject $PROJECTNAME

Configure ``settings.py``
-------------------------

* Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
* Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
sure it comes AFTER ``'django.contrib.auth.middleware.AuthenticationMiddleware'``.

* Add the following to your `INSTALLED_APPS`::

'haystack',
Expand All @@ -75,25 +75,26 @@ Configure ``settings.py``
'oscar.apps.reports',
'oscar.apps.search',
'oscar.apps.catalogue_import',



* Add these to ``TEMPLATE_CONTECT_PROCESSORS``::

'oscar.apps.search.context_processors.search_form',
'oscar.apps.promotions.context_processors.promotions',
'oscar.apps.promotions.context_processors.merchandising_blocks',
'oscar.apps.promotions.context_processors.merchandising_blocks',

* Import default settings::

from oscar.defaults import *

* If using Solr, configure it::

HAYSTACK_SITECONF = 'oscar.search_sites'
HAYSTACK_SEARCH_ENGINE = 'solr'
HAYSTACK_SOLR_URL = 'http://127.0.0.1:8080/solr'
HAYSTACK_INCLUDE_SPELLING = True
Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc

Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc

A vanilla install of django-oscar is now ready, you could now finish the process by running::

Expand Down
16 changes: 0 additions & 16 deletions docs/source/components.rst

This file was deleted.

72 changes: 63 additions & 9 deletions docs/source/contributing.rst
Expand Up @@ -2,15 +2,69 @@
Contributing
============

* New features should be discussed on the mailing list (or in the meetings) before serious work starts
* Pull requests will be rejected if sufficient tests aren't provided
* Please update the documentation when altering behaviour or introducing new features
Some ground rules:

Contents:
* To avoid disappointment, new features should be discussed on the mailing list
(django-oscar@googlegroups.com) before serious work starts.

.. toctree::
:maxdepth: 2
* Pull requests will be rejected if sufficient tests aren't provided.

contributing/installation
contributing/testing
contributing/conventions
* Please update the documentation when altering behaviour or introducing new features.

* Follow the conventions (see below).

Installation
============

From zero to tests passing in 2 minutes (most of which is PIL installing)::

git clone git@github.com:<username>/django-oscar.git
cd django-oscar
mkvirtualenv oscar
./setup.py develop
pip install -r requirements.txt
./run_tests.py

Writing docs
============

There's a helper script for building the docs locally::

cd docs
./test_docs.sh

Conventions
===========

General
-------

* PEP8 everywhere while remaining sensible

URLs
----

* List pages should use plurals, eg ``/products/``, ``/notifications/``

* Detail pages should simply be a PK/slug on top of the list page, eg
``/products/the-bible/``, ``/notifications/1/``

* Create pages should have 'create' as the final path segment, eg
``/dashboard/notifications/create/``

* Update pages are sometimes the same as detail pages (ie when in the
dashboard). In those cases, just use the detail convention, eg
``/dashboard/notifications/3/``. If there is a distinction between the detail
page and the update page, use ``/dashboard/notifications/3/update/``.

* Delete pages, eg /dashboard/notifications/3/delete/

View class names
----------------

Classes should be named according to::

'%s%sView' % (class_name, verb)

For example, ``ProductUpdateView``, ``OfferCreateView`` and
``PromotionDeleteView``. This doesn't fit all situations but it's a good basis.
33 changes: 18 additions & 15 deletions docs/source/customisation.rst → docs/source/design_decisions.rst
Expand Up @@ -8,9 +8,9 @@ extended and customised to suit the domain at hand. This is acheived in several
Core models are abstract
------------------------

Online shops can vary wildly, selling everything from turnips to concert tickets. Trying
to define a set of Django models capable for modelling all such scenarios is impossible -
customisation is what matters.
Online shops can vary wildly, selling everything from turnips to concert
tickets. Trying to define a set of Django models capable for modelling all such
scenarios is impossible - customisation is what matters.

One way to model your domain is to have enormous models that have fields for
every possible variation; however, this is unwieldy and ugly.
Expand All @@ -24,35 +24,38 @@ where all the fields are meaningful within any e-commerce domain. Oscar then
provides a mechanism for subclassing these models within your application so
domain-specific fields can be added.

Specifically, in each of oscar's apps, there is an ``abstract_models.py`` module which
Specifically, in many of oscar's apps, there is an ``abstract_models.py`` module which
defines these abstract classes. There is also an accompanying ``models.py`` which provides an
empty but concrete implementation of each abstract model.

Classes are loaded dynamically
------------------------------

To enable sub-apps to be overridden, oscar classes are loading generically
using a special ``import_module`` function. This looks at the
using a special ``get_class`` function. This looks at the
``INSTALLED_APPS`` tuple to determine the appropriate app to load a class from.

Within oscar itself, classes are imported using a special ``import_module`` function
which determines which app to load the specified classes from. Sample usage is::
Sample usage::

import_module('product.models', ['Item', 'ItemClass'], locals())
from oscar.core.loading import get_class

Repository = get_class('shipping.repository', 'Repository')

This will load the ``Item`` and ``ItemClass`` classes into the local namespace. It is
a replacement for the usual::
This is a replacement for the usual::

from oscar.apps.shipping.repository import Repository

from oscar.product.models import Item, ItemClass
It is effectively an extension of Django's ``django.db.models.get_model``
function to work with arbitrary classes.

The ``import_module`` looks through your ``INSTALLED_APPS`` for a matching module to
The ``get_class`` function looks through your ``INSTALLED_APPS`` for a matching module to
the one specified and will load the classes from there. If the matching module is
not from oscar's core, then it will also fall back to the equivalent module if the
class cannot be found.

This structure enables a project to create a local ``product.models`` module and
subclass and extend the core models from ``oscar.app.product.models``. When Oscar
tries to load the ``Item`` class, it will load the one from your local project.
This structure enables a project to create a local ``shipping.repository`` module and
subclass and extend the classes from ``oscar.app.shipping.repository``. When Oscar
tries to load the ``Repository`` class, it will load the one from your local project.

All views are class-based
-------------------------
Expand Down
15 changes: 15 additions & 0 deletions docs/source/getting_help.rst
@@ -0,0 +1,15 @@
============
Getting help
============

If you're stuck with a problem, try checking the `Google Groups archive`_ to see if
someone has encountered it before. If not, then try asking on the mailing list
django-oscar@googlegroups.com. If it's a common question, then we'll write up
the solution as a recipe.

.. _`Google Groups archive`: https://groups.google.com/forum/?fromgroups#!forum/django-oscar

If you find a bug, please report it in the `Github issue tracker`_

.. _`Github issue tracker`: https://github.com/tangentlabs/django-oscar/issues