Skip to main content

dj-services

Build Status Coverage Status PEP8 Documentation Status

Thanks to this library, you can build your business logic in beautiful services, not in huge views and fat models.

Getting Started

Install this library using pip

$ pip install dj-services

Create services.py module in your Django app and create your first service

# services.py
from djservices import CRUDService

from .models import MyModel
from .forms import MyForm


class MyService(CRUDService):
    model = MyModel
    form = MyForm

After that you can use this service in views.py

# views.py
from django.shortcuts import render

from .services import MyService


def list_entries(request):
    service = MyService()
    entries = service.get_all()
    return render(request, 'some_template.html', {'entries': entries})

That's all. Now you can add business logic in your service. Let's go!

Documentation

You can read documentation in this repository wiki

Running the tests

If you want to run the tests you need to run the following command:

$ ./manage.py test

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the GNU General Public License v3.0

Metadata

Release files for dj-services 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dj-services 2.0.0
File Size Uploaded
dj-services-2.0.0.tar.gz 4.9 kB Details

Release files / dj-services-2.0.0.tar.gz

Download URL dj-services-2.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4033274bf8a4d292ea3e5a110eb62a408376aee29fbad3b91831eefb06892187
BLAKE2b-256 checksum
How to use checksums
28741db82f497b3510d659bd6106e4f40001bd3b0effa84e89ab504df73dd94d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.2.0

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page