Skip to content

Commit a78f7ab

Browse files
committed
initial release, 0.0.1, SoftDeletableModel
1 parent 60ee5a7 commit a78f7ab

8 files changed

+117
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
tab_width = 4

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
# django-ckc
22
tools, utilities, etc. we use across projects @ ckc
3+
4+
5+
# distributing
6+
7+
```bash
8+
$ ./setup.py sdist
9+
$ twine upload dist/*
10+
```

ckc/__init__.py

Whitespace-only changes.

ckc/models.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from django.db import models
2+
3+
4+
class SoftDeleteModelManager(models.Manager):
5+
def get_queryset(self):
6+
return super().get_queryset().exclude(deleted=True)
7+
8+
def all_objects(self):
9+
return super().get_queryset()
10+
11+
12+
class SoftDeletableModel(models.Model):
13+
deleted = models.BooleanField(default=False)
14+
15+
objects = SoftDeleteModelManager()
16+
17+
class Meta:
18+
abstract = True
19+
20+
def delete(self, *args, **kwargs):
21+
self.deleted = True
22+
self.save()

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
twine==3.1.1

setup.cfg

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[flake8]
2+
ignore = E501,F405,W605,W504
3+
4+
# Flake plugins:
5+
inline-quotes = single
6+
accept-encodings = utf-8
7+
isort-show-traceback = True
8+
9+
# Docs: https://github.com/snoack/flake8-per-file-ignores
10+
# You can completely or partially disable our custom checks,
11+
# to do so you have to ignore `Z` letter for all python files:
12+
per-file-ignores =
13+
./wsgi.py: E402
14+
./settings/*.py: F403
15+
16+
# Ignore pass strings like "()[]{}|\`~!@#$%^&*_-+=;:'\",<>./?"
17+
./apps/profiles/password_validators.py: W605
18+
19+
# Ignore Key:
20+
# E501 -- line too long
21+
# F405 -- name may be undefined, or defined from star imports
22+
# F403 -- unable to detect undefined name
23+
# W605 -- invalid escape sequence
24+
# W504 -- line break after binary operator
25+
26+
27+
[tool:pytest]
28+
addopts = --reuse-db --ds=settings.test
29+
python_files =
30+
tests/integration/*.py
31+
tests/functional/*.py
32+
test_paths =
33+
tests/
34+
35+
[metadata]
36+
name = django-ckc
37+
author = Eric Carmichael
38+
author_email = [email protected]
39+
description = tools, utilities, etc. we use across projects @ ckc
40+
version = 0.0.1
41+
url = https://github.com/ckcollab/django-ckc
42+
keywords =
43+
django
44+
classifiers =
45+
Development Status :: 4 - Beta
46+
Intended Audience :: Developers
47+
Programming Language :: Python :: 3.6
48+
Programming Language :: Python :: 3.7
49+
Programming Language :: Python :: 3.8
50+
Topic :: Software Development
51+
long_description = file: README.md
52+
long_description_content_type = text/markdown
53+
license_files =
54+
LICENSE
55+
56+
[options]
57+
python_requires = >= 3.6
58+
packages = find:
59+
zip_safe: False
60+
;scripts =
61+
;# joesprint.py
62+
;install_requires =
63+
;# colorama
64+
65+
[options.extras_require]
66+
tests =
67+
pytest
68+
flake8
69+
70+
;[options.entry_points]
71+
;console_scripts =
72+
;# joesprint = joesprint:main

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python
2+
from setuptools import setup
3+
4+
5+
setup()

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)