Django Endless Pagination Angular
=================================
.. image:: https://coveralls.io/repos/mapeveri/django-endless-pagination-angular/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/mapeveri/django-endless-pagination-angular?branch=master
.. image:: https://travis-ci.org/mapeveri/django-endless-pagination-angular.svg?branch=master
:target: https://travis-ci.org/mapeveri/django-endless-pagination-angular
.. image:: https://badge.fury.io/py/django-endless-pagination-angular.svg
:target: http://badge.fury.io/py/django-endless-pagination-angular
.. image:: https://img.shields.io/pypi/dm/django-endless-pagination-angular.svg
:target: https://pypi.python.org/pypi/django-endless-pagination-angular
Django Endless Pagination Angular is a fork of the excellent application django-endless-pagination created by Francesco Banconi.
This application get all code of version 2.0 and update for working in django >= 1.7 in addition to migration code jquery to angular.js.
Django Endless Pagination Angular can be used to provide Twitter-style or Digg-style pagination, with optional Ajax support and other features
like multiple or lazy pagination.
Documentation
-------------
**Documentation** is `avaliable online
<http://django-endless-pagination-angular.readthedocs.org/>`_, or in the **doc*
directory of the project.
Installation
------------
Via pip::
pip install django-endless-pagination-angular
Quick start
-----------
1. Add application 'endless_pagination' to INSTALLED_APPS.
2. Add this lines in settings.py::
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
)
Getting started
---------------
In this example it will be implemented twitter style pagination
Base.html::
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<title>{% block title %}Testing project{% endblock %} - Django Endless Pagination Angular</title>
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ STATIC_URL }}pagination.css" rel="stylesheet">
</head>
<body ng-app="EndlessPagination">
<div class="container">
<div class="page-header">
<h1>Django Endless Pagination Angular <small>Twitter Style</small></h1>
</div>
</div>
<div class="row">
{% block content %}{% endblock %}
</div>
</div>
{% block js %}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="{{ STATIC_URL }}endless_pagination/js/module.endless.js"></script>
{% endblock %}
</body>
</html>
Index.html::
{% extends "base.html" %}
{% block content %}
<div class="endless_page_template span12" endless-pagination="{'paginateOnScroll': true}">
{% include myapp/page_template.html %}
</div>
{% endblock %}
Page_template.html::
{% load endless %}
{% paginate objects %}
{% for object in objects %}
<div class="well object">
<h4>{{ object.title }}</h4>
{{ object.contents }}
</div>
{% endfor %}
{% show_more "More results" %}
In the views.py::
class TwitterView(View):
def get(self, request, forum, *args, **kwargs):
template_name = "myapp/index.html"
page_template = "myapp/page_template.html"
objects = MyModel.objects.all()
data = {
'objects': objects,
}
if request.is_ajax():
template_name = page_template
return render(request, template_name, data)
In the urls.py::
url(r'^twitter/$', TwitterView.as_view(), name='twitter'),
Run server::
python manage.py runserver
Visit: 127.0.0.1:800/twitter/
If you have already declared an angular module all you have to do is inject the module EndlessPagination. As follow::
'use strict';
angular.module('TestApp', ['EndlessPagination']);
This way you will be able to use the directive endless-pagination. For more examples check the official repository:
https://github.com/mapeveri/django-endless-pagination-angular/tree/master/tests
Metadata
Release files for django-endless-pagination-angular 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-endless-pagination-angular-1.2.tar.gz | 38.3 kB | Without provenance | Details |
Release files / django-endless-pagination-angular-1.2.tar.gz
| Download URL | django-endless-pagination-angular-1.2.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df320c36ccd2750819337f6c1a45b0957e65298b212e3af72517ab3e8ee008e6
|
|
BLAKE2b-256 checksum How to use checksums |
24d64e91753080daa182a490c98fae5c05e6f2feef968baf37966113563cbe64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-endless-pagination-angular 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.