Installation
-
pip install sam-djtools -
Add
sam_djtoolsin installed apps insettings.pyof django projectINSTALLED_APPS = [ 'sam_djtools', # ... ] (at the top)
Description
It adds Next and Prev buttons to the top of each edit form of django admin site
for all the models of all the apps in your project, without need to do anything
except installing the module with pip plus adding to the top of INSTALLED_APPS in settings.py
Instructions to run the sample usage
-
git clone https://github.com/humblesami/sam-djtools.git -
cd sample_usage -
pip install -r requirements.txt -
python manage.py resetdb- This step will delete db (if engine is sqlite or posgtgresql)
- will make makemigrations and migrate
- will create db
- create a super user
admin@localhostwith password123 - Will create three records of
ModelWithUpdateLog
-
python manage.py runsever
Features
- You can import and use
GeneralUtils, EmailUtils, DbUtilshaving variety of methods which we commonly would need to write in django project - Form navigation => while changing/reading records in form, you n=can navigate to next/prev records
- You can use python manage.py resetdb if during development you need, also you can set
FIXTURES_PATH = str(BASE_DIR) + '/fixtures.json'to your existing data so all can be reset using a single command - The sample app contains a model (as following) inherited from
SamModeland theSamModelis set to maintain all the update logs automatically
from django.db import models
from sam_djtools.admin_models import SamModel
class ModelWithUpdateLog(SamModel):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
and an admin as
from django.contrib import admin
from sam_djtools.admin_models import SamAdmin
from .models import ModelWithUpdateLog
class ModelUpdateLogAdmin(SamAdmin):
pass
admin.site.register(ModelWithUpdateLog, ModelUpdateLogAdmin)
This admin will show all record update logs in form because we have set
ADMIN_UPDATE_LOGS = True
in settings.py
Open following url in your browser and login with given username admin@localhost and password 123
http://localhost:8000/admin/sample_app/modelwithupdatelog/1/change/
to explore the update logs and navigation feature
Metadata
Release files for sam-djtools 1.2.42
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 | Actions |
|---|---|---|---|---|
| sam_djtools-1.2.42.tar.gz | 16.5 kB | Without provenance | Details for sam_djtools-1.2.42.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sam_djtools-1.2.42-py3-none-any.whl | Python 3 | none | any | Details for sam_djtools-1.2.42-py3-none-any.whl |
Total release size: 27.6 kB
Release files / sam_djtools-1.2.42.tar.gz
| Download URL | sam_djtools-1.2.42.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
448bd28c6543c702d933df5990bfb920c38dd1a0d044f788b823f533f0ca77da
|
|
BLAKE2b-256 checksum How to use checksums |
d6446902cfe73483e52c393d76518a9fe3773c97b9dfeda5bb1036c3f290a4bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Release files / sam_djtools-1.2.42-py3-none-any.whl
| Download URL | sam_djtools-1.2.42-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60dc50d665f12e882ff96a50de7ec7e56d5f74be208a3511434f4d5074eaa128
|
|
BLAKE2b-256 checksum How to use checksums |
ff5ec9752f748f534843e5f0c28bcb1c24da5f9f31a90fd9d08aa167503de6fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Security for sam-djtools 1.2.42
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.