django-fast-treenode 1.1.3__py3-none-any.whl → 2.0.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. {django_fast_treenode-1.1.3.dist-info → django_fast_treenode-2.0.0.dist-info}/METADATA +156 -46
  2. django_fast_treenode-2.0.0.dist-info/RECORD +41 -0
  3. {django_fast_treenode-1.1.3.dist-info → django_fast_treenode-2.0.0.dist-info}/WHEEL +1 -1
  4. treenode/__init__.py +0 -7
  5. treenode/admin.py +327 -82
  6. treenode/apps.py +20 -3
  7. treenode/cache.py +231 -0
  8. treenode/docs/Documentation +130 -54
  9. treenode/forms.py +75 -19
  10. treenode/managers.py +260 -48
  11. treenode/models/__init__.py +7 -0
  12. treenode/models/classproperty.py +24 -0
  13. treenode/models/closure.py +168 -0
  14. treenode/models/factory.py +71 -0
  15. treenode/models/proxy.py +650 -0
  16. treenode/static/treenode/css/tree_widget.css +62 -0
  17. treenode/static/treenode/css/treenode_admin.css +106 -0
  18. treenode/static/treenode/js/tree_widget.js +161 -0
  19. treenode/static/treenode/js/treenode_admin.js +171 -0
  20. treenode/templates/admin/export_success.html +26 -0
  21. treenode/templates/admin/tree_node_changelist.html +11 -0
  22. treenode/templates/admin/tree_node_export.html +27 -0
  23. treenode/templates/admin/tree_node_import.html +27 -0
  24. treenode/templates/widgets/tree_widget.css +23 -0
  25. treenode/templates/widgets/tree_widget.html +21 -0
  26. treenode/urls.py +34 -0
  27. treenode/utils/__init__.py +4 -0
  28. treenode/utils/base36.py +35 -0
  29. treenode/utils/exporter.py +141 -0
  30. treenode/utils/importer.py +296 -0
  31. treenode/version.py +11 -1
  32. treenode/views.py +102 -2
  33. treenode/widgets.py +49 -27
  34. django_fast_treenode-1.1.3.dist-info/RECORD +0 -33
  35. treenode/compat.py +0 -8
  36. treenode/factory.py +0 -68
  37. treenode/models.py +0 -668
  38. treenode/static/select2tree/.gitkeep +0 -1
  39. treenode/static/select2tree/select2tree.css +0 -176
  40. treenode/static/select2tree/select2tree.js +0 -181
  41. treenode/static/treenode/css/treenode.css +0 -85
  42. treenode/static/treenode/js/treenode.js +0 -201
  43. treenode/templates/widgets/.gitkeep +0 -1
  44. treenode/templates/widgets/attrs.html +0 -7
  45. treenode/templates/widgets/options.html +0 -1
  46. treenode/templates/widgets/select2tree.html +0 -22
  47. treenode/tests.py +0 -3
  48. {django_fast_treenode-1.1.3.dist-info → django_fast_treenode-2.0.0.dist-info}/LICENSE +0 -0
  49. {django_fast_treenode-1.1.3.dist-info → django_fast_treenode-2.0.0.dist-info}/top_level.txt +0 -0
  50. /treenode/{docs → templates/admin}/.gitkeep +0 -0
@@ -1,33 +0,0 @@
1
- treenode/__init__.py,sha256=qoJ0W8NXR4MlBQwyQIr6q4RWdc266vn6ysYtbgLNJ2w,171
2
- treenode/admin.py,sha256=xAp4UZ7GQdGMhNoEiZOBwcXr36K6Miohphrg2FAfswY,5510
3
- treenode/apps.py,sha256=RCcPtrf0IJDgPBiccA11w-JSxH1arw4CfENq-5UAZlc,154
4
- treenode/compat.py,sha256=ujFPQL0j5qXC0clEDXU4EKRN0sgXNKeZrRBYnQ-qgCc,193
5
- treenode/factory.py,sha256=jSKgWDDEyTfhr4042VIzmeeUZ4UuhAyeO-2j7BK4wCI,1942
6
- treenode/forms.py,sha256=16XkxtVVxNCqLlLvankPVuFoWpOvFPW4UnRsQEjldso,939
7
- treenode/managers.py,sha256=yqPHozxK-P9kUQ98xVVmc-rkNf9ON8ROAIJm_rUDOwk,2210
8
- treenode/models.py,sha256=TwAJgFAT61slbGqXWjGyKGyU2j9kQhapIe185wm-2lE,20769
9
- treenode/tests.py,sha256=2uDafv3Ns6f7Vy1ekUtgYxCZEi1KRyesZDTAFhYcX-E,63
10
- treenode/version.py,sha256=9d8boLVLA0TTCu5doEbpgUL3T-FjcNU-fvLyhw_CJyk,50
11
- treenode/views.py,sha256=u0FhL7RT5byf5IlcnZEMrcH2TOnQkdfRQU2SjtA26m0,66
12
- treenode/widgets.py,sha256=T6L9NgKBGbMJmzxqJUuk7rxpZmpRI41NFkzhWYUDHFM,1189
13
- treenode/docs/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
14
- treenode/docs/Documentation,sha256=R3ZVxs_3MRqZDKLsXgxValiTHAYyNATI_1l0_hUdR3Y,16817
15
- treenode/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- treenode/static/select2tree/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
17
- treenode/static/select2tree/select2tree.css,sha256=HnKj-gTghI_GqdfEQNzPrEAaQvOJRlH1ScS7AGR-AHY,4234
18
- treenode/static/select2tree/select2tree.js,sha256=-6uneUO7L1QQ2GUL0MlqZfahP-P89Dy3tLc-kpeCdyg,6295
19
- treenode/static/treenode/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
20
- treenode/static/treenode/css/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
21
- treenode/static/treenode/css/treenode.css,sha256=a7PYJGVBz5tbMqHDRnWDvQisDB5q5PKMOup4AIaG2h0,1721
22
- treenode/static/treenode/js/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
23
- treenode/static/treenode/js/treenode.js,sha256=yBz2T3uhdSkpuEPB8iuWSrLuXFhRwCTc1ENTbaRyb4I,7998
24
- treenode/templates/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
25
- treenode/templates/widgets/.gitkeep,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
26
- treenode/templates/widgets/attrs.html,sha256=hsfr8ZOSQS0zrH13AdPa79d1xer3FFw_IrMl0nf_NRQ,217
27
- treenode/templates/widgets/options.html,sha256=_17HCTTTQfsu4fiONflDnbLCB-XICN491at_g-diXyU,288
28
- treenode/templates/widgets/select2tree.html,sha256=oNiHiYaJpfHBRcQxHt7rIaoKlAYifoIzoMeN0VZHPjo,675
29
- django_fast_treenode-1.1.3.dist-info/LICENSE,sha256=GiiEe4Y9oOCbn9eGuNew1mMYHU_bJWaCK9zOusnKvvU,1091
30
- django_fast_treenode-1.1.3.dist-info/METADATA,sha256=56VD71x6zNwlj8mnLFvDWCe9sz_NA9evISCs8YArSPQ,17400
31
- django_fast_treenode-1.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
32
- django_fast_treenode-1.1.3.dist-info/top_level.txt,sha256=fmgxHbXyx1O2MPi_9kjx8aL9L-8TmV0gre4Go8XgqFk,9
33
- django_fast_treenode-1.1.3.dist-info/RECORD,,
treenode/compat.py DELETED
@@ -1,8 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- import django
4
-
5
- if django.VERSION >= (3, 0):
6
- from django.utils.encoding import force_str
7
- else:
8
- from django.utils.encoding import force_text as force_str
treenode/factory.py DELETED
@@ -1,68 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Model Factory Module
4
-
5
- """
6
-
7
- import sys
8
- from django.db import models
9
- from django.db.models.base import ModelBase
10
-
11
-
12
- class TreeFactory(ModelBase):
13
- """Metaclass for creating a Closure Table"""
14
-
15
- def __init__(cls, name, bases, dct):
16
- """Init"""
17
-
18
- super().__init__(name, bases, dct)
19
-
20
- if not (cls._meta.get_parent_list() or cls._meta.abstract):
21
- setattr(
22
- sys.modules[cls._meta.app_label],
23
- '%sClosureModel' % cls._meta.object_name,
24
- cls.create_closure_model()
25
- )
26
-
27
- def create_closure_model(cls):
28
- """
29
- Creates a <Model>ClosureModel model in the same module as the model.
30
- """
31
-
32
- if hasattr(cls, 'closure_model') and not cls.closure_model is None:
33
- return cls.closure_model
34
-
35
- model_name = '%sClosureModel' % cls._meta.object_name
36
-
37
- meta_dict = dict(
38
- app_label=cls._meta.app_label,
39
- unique_together=(('parent', 'child',),),
40
- indexes=[
41
- models.Index(fields=['parent', 'child']),
42
- models.Index(fields=['parent']),
43
- models.Index(fields=['child']),
44
- ]
45
- )
46
-
47
- fields = dict(
48
- parent=models.ForeignKey(
49
- cls._meta.object_name,
50
- on_delete=models.CASCADE,
51
- related_name='children_set',
52
- ),
53
-
54
- child=models.ForeignKey(
55
- cls._meta.object_name,
56
- on_delete=models.CASCADE,
57
- related_name='parents_set',
58
- ),
59
-
60
- depth=models.IntegerField(),
61
- __module__=cls._meta.app_label,
62
- Meta=type('Meta', (object,), meta_dict),
63
- )
64
-
65
- model = type(model_name, (models.Model,), fields)
66
-
67
- setattr(cls, 'closure_model', model)
68
- return model