django-garpix 0.1.2
Django modules by Garpix.
License: MIT
Keywords: django garpix

TODO: Move this to readthedocs.

Install
=======

::

    $ pip install django-garpix

Submodules
==========

-  helpers
-  blog
-  menu
-  seo
-  slider

and etc

Submodule “helpers”
===================

Usage
-----

ActiveManager
~~~~~~~~~~~~~

Get only active objects.

In your model:

::

    from garpix.helpers import ActiveModel

    class MyModel(ActiveModel):
        ...

Querieng:

::

    MyModel.active_objects.filter(...)

or

::

    MyModel.objects.filter(is_active=True)

Abstract Models
~~~~~~~~~~~~~~~

-  ActiveModel
-  CreatedUpdatedModel
-  ImageModel
-  ImageRequiredModel
-  TitleModel
-  TitleRequiredModel

See sources for explanation.

get\_file\_path
~~~~~~~~~~~~~~~

Slugified file names:

::

    /uploads/YEAR/MONTH/SLUGIFIED_FILENAME.EXTENSION

In your model:

::

    from garpix.helpers import get_file_path

    class MyModel(models.Model):
        ...
        image = models.ImageField(upload_to=get_file_path)

Submodule “blog”
================

Usage
-----

Add ‘garpix.blog’ to INSTALLED\_APPS in settings.py:

::

    INSTALLED_APPS = (
        ...
        'garpix.blog',
        ...
    )

Make migrate:

::

    $ python manage.py migrate

Enjoy!

As widget
~~~~~~~~~

Add to your template:

::

    {% load garpix_blog %}

    {% garpix_blog %}

As another pages
~~~~~~~~~~~~~~~~

Add to your urls.py:

::

    from django.conf.urls import url, include

    urlpatterns = [
        ...
        url(r'^blog/', include('garpix.blog.urls')),
        ...
    ]

Submodule “menu”
================

Usage
-----

Add ‘garpix.menu’ to INSTALLED\_APPS in settings.py:

::

    INSTALLED_APPS = (
        ...
        'garpix.menu',
        ...
    )

Make migrate:

::

    $ python manage.py migrate

Enjoy!

As widget
~~~~~~~~~

1. Add to your base template:

   {% load garpix\_menu %}

   {% garpix\_menu\_css %} {% garpix\_menu\_js %}

2. Add some Menu and MenuItem in admin panel. Set some *code* (for
   example - ‘demo’) for your Menu.

3. Include slider on your page in your template:

   {% garpix\_menu ‘demo’ %}

Submodule “seo”
===============

Usage
-----

Add ‘garpix.seo’ to INSTALLED\_APPS in settings.py:

::

    INSTALLED_APPS = (
        ...
        'garpix.seo',
        ...
    )

Make migrate:

::

    $ python manage.py migrate

Enjoy!

As widget
~~~~~~~~~

Add to your base template:

::

    {% load garpix_seo %}

If you extends some model (``from garpix.seo.models import SeoModel``):

::

    {% garpix_seo element=element %}

If you want default values:

::

    {% garpix_seo %}

Submodule “slider”
==================

Usage
-----

Add ‘garpix.slider’ to INSTALLED\_APPS in settings.py:

::

    INSTALLED_APPS = (
        ...
        'garpix.slider',
        ...
    )

Make migrate:

::

    $ python manage.py migrate

Enjoy!

As widget
~~~~~~~~~

1. Add to your base template:

   {% load garpix\_slider %}

   {% garpix\_slider\_css %} {% garpix\_slider\_js %}

2. Add some Slider and SliderItem in admin panel. Set some *code* (for
   example - ‘my\_slider’) for your Slider.

3. Include slider on your page in your template:

   {% garpix\_slider ‘my\_slider’ images\_count=6 images\_in\_row=3
   show\_arrows=True %}

Repository
==========

[https://github.com/Garpix/django-garpix](https://github.com/Garpix/django-garpix

License
=======

MIT