1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
|
%global _empty_manifest_terminate_build 0
Name: python-django-controlled-vocabulary
Version: 0.12
Release: 1
Summary: Link your data to authority lists or your own controlled lists
License: MIT
URL: https://github.com/kingsdigitallab/django-controlled-vocabulary
Source0: https://mirrors.aliyun.com/pypi/web/packages/34/9a/1d490b15a81d7dbf838df7e3157ca2ef2e7aaba0eff3fc453d1a47a9b776/django-controlled-vocabulary-0.12.tar.gz
BuildArch: noarch
Requires: python3-django
Requires: python3-urllib3
Requires: python3-tox
Requires: python3-coverage
%description
[](https://badge.fury.io/py/django-controlled-vocabulary) [](https://travis-ci.org/kingsdigitallab/django-controlled-vocabulary)
[Advanced topics (Wiki)](https://github.com/kingsdigitallab/django-controlled-vocabulary/wiki)
# Django Controlled Vocabulary
This app provides models and admin interface to link your data to standard vocabularies (e.g. ISO language codes, Wikidata). Benefits: increases the consistency and understandability of your project data.
Requirements: Python 3.5+, Django 2.2+
Development Status: **Beta**
<img src="docs/img/controlled-term-widget.png" />
_A ControlledTerm field in the Django admin interface. The user selects the vocabulary (here: Wikidata), then starts typing a term in the text box. Suggestions are brought from Wikidata. When the user saves the changes, information about the selected term is copied into the database (url, identifier, label)._
# Features
* create your own controlled lists of terms (i.e. a **local** lists, project-specific)
* look up terms from **standard vocabularies** (i.e. **authority files** maintained by other organisations)
* extensible **plug-in architecture** for lookups into particular vocabularies (see table below for built-in plugins)
* **stores** used terms from remote vocabularies into your database:
* space efficient (doesn't clutter the database with unused terms)
* self-contained (i.e. can still works offline & DB always 'semantically' complete)
* **autocomplete** widget for Django admin; reusable ControlledTermField for your models
* **command line tool** to download vocabulary files from authoritative sources
* [TODO] possibility to store additional **metadata** (e.g. geographic coordinates)
* [TODO] simple **rest API** to publish your own terms
## Standard vocabularies included
Built-in plugins for the following authority files:
| Vocabulary | Description |
| ------------- | ------------- |
| [Schema.org](https://schema.org/) | High-level categories of content |
| [Wikidata](https://www.wikidata.org) | High level concepts or specific instances (e.g. places, people) |
| [ISO 639-2](http://id.loc.gov/vocabulary/iso639-2.html) | Language codes |
| [DCMI Type](https://www.dublincore.org/specifications/dublin-core/dcmi-type-vocabulary/#section-7-dcmi-type-vocabulary) | Dublin Core Format Type |
| [MIME](https://www.iana.org/assignments/media-types/media-types.xhtml) | Media/File types |
| [FAST Topics](https://www.oclc.org/research/themes/data-science/fast.html) | Topic categorisation |
| [FAST Forms and Genres](https://www.oclc.org/research/themes/data-science/fast.html) | Genres of a piece of work |
| [VIAF](https://www.oclc.org/en/viaf.html) | Various: regions, people, companies, ... |
# Data Model & Software Design
## Django models
| Vocabularies | Terms |
| ------------- | ------------- |
| <img src="docs/img/controlled-vocabulary-list.png" width="400" /> | <img src="docs/img/controlled-term-list.png" width="400" /> |
* **ControlledVocabulary**
* prefix: the vocabulary standard prefix, see http://prefix.cc/wikidata
* label: the short name of the vocabulary
* base_url: the url used as a base for all terms in the vocabulary
* concept: the type of terms this vocabulary represents (e.g. language, people)
* description: a longer description
* **ControlledTerm**
* termid: a unique code for the term within a vocabulary, it is case sensitive
* label: standard name for the term, as provided by the authority
* vocabulary: a reference to the ControlledVocabulary this term belongs to
Conventions:
* joining base_url (e.g. http://schema.org) with termid (e.g. Movie) **must** give the exact standard/canonical URI for the term, e.g. http://schema.org/Movie
## Vocabulary plug-ins / managers
A Vocabulary **plug-in** / **manager** is a python class that provides services for a vocabulary:
* autocomplete terms from local or remote datasets (see ControlledTermField)
* supplies metadata for the vocabulary (see ControlledVocabulary)
Managers can provide terms from a CSV file downloaded from an authoritative source.
Some vocabularies can contain thousands of terms or more. A plugin will
only insert the terms used by your application. The rest will be accessed on
demand from a file on disk or in a third-party server. This approach saves
database space and keeps your application data self-contained.
This project comes with built-in plugins such a Wikidata or Schema.org. Those plugins are **enabled** by default; see below how to selectively enable them.
This architecture allows third-party plugins to be supplied via separate
python packages.
# Limitations
* **controlled list** rather than fully fledged vocabularies, (i.e. just a bag of terms with unique IDs/URIs, no support for taxonomic relationships among terms like broader, narrower, synonyms, ...)
* no notion of granularity (e.g. geonames country, region, city, street are all treated as part of the same vocabulary)
# Setup
## Installation
Install into your environment:
```Shell
pip install django-controlled-vocabulary
```
Add the app to the INSTALLED_APPS list in your Django settings file:
```Python
INSTALLED_APPS = [
...
'controlled_vocabulary',
...
]
```
Add the following path to your project urls.py:
```Python
from django.urls import path, include
...
urlpatterns = [
...
path('vocabularies/', include('controlled_vocabulary.urls')),
...
]
```
Run the migrations:
```Shell
./manage.py migrate
```
Download vocabulary data and add metadata to the database:
```Shell
./manage.py vocab init
```
## Configuration
### Enabling specific vocabulary plug-ins (optional)
Currently all built-in plugins / managers are enabled by default. Add the following code in your settings.py to enable **only** specific vocabularies based on the import path of their classes. You can also use this to enable your own or third-party plugins.
```Python
# List of import paths to vocabularies lookup classes
CONTROLLED_VOCABULARY_VOCABULARIES = [
'controlled_vocabulary.vocabularies.iso639_2',
'controlled_vocabulary.vocabularies.dcmitype',
]
```
After enabling a new plug-in / manager, always run `./manage.py vocab init`.
### ControlledTerm(s)Field
Use the **ControlledTermField** field to define a field with an **autocomplete** to controlled terms in your Django Model:
```Python
from controlled_vocabulary.models import ControlledTermField
...
class MyModel(models.Model):
...
language_code = ControlledTermField(
'iso639-2',
null=True, blank=True
)
```
Where `iso639-2` is the prefix of a controlled vocabulary in your database.
ControlledTermField is essentially syntactic sugar for a [ForeignKeyField](https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.ForeignKey) with an adapted [Select](https://docs.djangoproject.com/en/3.0/ref/forms/widgets/#select) widget.
For multiple values, you can use **ControlledTermsField** (note the '*s*' in the name), which inherits from ManyToManyField with an adapted SelectMultiple widget. The useage is identical but obviously `null=True` should be omitted.
By default the widget proposes the given vocabulary to the end user, but they can use the dropdown to switch to any other available vocabulary (see screenshot at the top of this page). To **lock** the selection to a single vocabulary, use this expression instead:
```Python
language_code = ControlledTermField(
['iso639-2'],
null=True, blank=True
)
```
You can have more than one prefix in that list if you want. The first item is always the one proposed by default on page load.
# vocab (command line tool)
vocab is a django command line tool that lets you manipulate the vocabularies
and the plugins. To find out more use the help:
```Shell
./manage vocab help
```
%package -n python3-django-controlled-vocabulary
Summary: Link your data to authority lists or your own controlled lists
Provides: python-django-controlled-vocabulary
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-django-controlled-vocabulary
[](https://badge.fury.io/py/django-controlled-vocabulary) [](https://travis-ci.org/kingsdigitallab/django-controlled-vocabulary)
[Advanced topics (Wiki)](https://github.com/kingsdigitallab/django-controlled-vocabulary/wiki)
# Django Controlled Vocabulary
This app provides models and admin interface to link your data to standard vocabularies (e.g. ISO language codes, Wikidata). Benefits: increases the consistency and understandability of your project data.
Requirements: Python 3.5+, Django 2.2+
Development Status: **Beta**
<img src="docs/img/controlled-term-widget.png" />
_A ControlledTerm field in the Django admin interface. The user selects the vocabulary (here: Wikidata), then starts typing a term in the text box. Suggestions are brought from Wikidata. When the user saves the changes, information about the selected term is copied into the database (url, identifier, label)._
# Features
* create your own controlled lists of terms (i.e. a **local** lists, project-specific)
* look up terms from **standard vocabularies** (i.e. **authority files** maintained by other organisations)
* extensible **plug-in architecture** for lookups into particular vocabularies (see table below for built-in plugins)
* **stores** used terms from remote vocabularies into your database:
* space efficient (doesn't clutter the database with unused terms)
* self-contained (i.e. can still works offline & DB always 'semantically' complete)
* **autocomplete** widget for Django admin; reusable ControlledTermField for your models
* **command line tool** to download vocabulary files from authoritative sources
* [TODO] possibility to store additional **metadata** (e.g. geographic coordinates)
* [TODO] simple **rest API** to publish your own terms
## Standard vocabularies included
Built-in plugins for the following authority files:
| Vocabulary | Description |
| ------------- | ------------- |
| [Schema.org](https://schema.org/) | High-level categories of content |
| [Wikidata](https://www.wikidata.org) | High level concepts or specific instances (e.g. places, people) |
| [ISO 639-2](http://id.loc.gov/vocabulary/iso639-2.html) | Language codes |
| [DCMI Type](https://www.dublincore.org/specifications/dublin-core/dcmi-type-vocabulary/#section-7-dcmi-type-vocabulary) | Dublin Core Format Type |
| [MIME](https://www.iana.org/assignments/media-types/media-types.xhtml) | Media/File types |
| [FAST Topics](https://www.oclc.org/research/themes/data-science/fast.html) | Topic categorisation |
| [FAST Forms and Genres](https://www.oclc.org/research/themes/data-science/fast.html) | Genres of a piece of work |
| [VIAF](https://www.oclc.org/en/viaf.html) | Various: regions, people, companies, ... |
# Data Model & Software Design
## Django models
| Vocabularies | Terms |
| ------------- | ------------- |
| <img src="docs/img/controlled-vocabulary-list.png" width="400" /> | <img src="docs/img/controlled-term-list.png" width="400" /> |
* **ControlledVocabulary**
* prefix: the vocabulary standard prefix, see http://prefix.cc/wikidata
* label: the short name of the vocabulary
* base_url: the url used as a base for all terms in the vocabulary
* concept: the type of terms this vocabulary represents (e.g. language, people)
* description: a longer description
* **ControlledTerm**
* termid: a unique code for the term within a vocabulary, it is case sensitive
* label: standard name for the term, as provided by the authority
* vocabulary: a reference to the ControlledVocabulary this term belongs to
Conventions:
* joining base_url (e.g. http://schema.org) with termid (e.g. Movie) **must** give the exact standard/canonical URI for the term, e.g. http://schema.org/Movie
## Vocabulary plug-ins / managers
A Vocabulary **plug-in** / **manager** is a python class that provides services for a vocabulary:
* autocomplete terms from local or remote datasets (see ControlledTermField)
* supplies metadata for the vocabulary (see ControlledVocabulary)
Managers can provide terms from a CSV file downloaded from an authoritative source.
Some vocabularies can contain thousands of terms or more. A plugin will
only insert the terms used by your application. The rest will be accessed on
demand from a file on disk or in a third-party server. This approach saves
database space and keeps your application data self-contained.
This project comes with built-in plugins such a Wikidata or Schema.org. Those plugins are **enabled** by default; see below how to selectively enable them.
This architecture allows third-party plugins to be supplied via separate
python packages.
# Limitations
* **controlled list** rather than fully fledged vocabularies, (i.e. just a bag of terms with unique IDs/URIs, no support for taxonomic relationships among terms like broader, narrower, synonyms, ...)
* no notion of granularity (e.g. geonames country, region, city, street are all treated as part of the same vocabulary)
# Setup
## Installation
Install into your environment:
```Shell
pip install django-controlled-vocabulary
```
Add the app to the INSTALLED_APPS list in your Django settings file:
```Python
INSTALLED_APPS = [
...
'controlled_vocabulary',
...
]
```
Add the following path to your project urls.py:
```Python
from django.urls import path, include
...
urlpatterns = [
...
path('vocabularies/', include('controlled_vocabulary.urls')),
...
]
```
Run the migrations:
```Shell
./manage.py migrate
```
Download vocabulary data and add metadata to the database:
```Shell
./manage.py vocab init
```
## Configuration
### Enabling specific vocabulary plug-ins (optional)
Currently all built-in plugins / managers are enabled by default. Add the following code in your settings.py to enable **only** specific vocabularies based on the import path of their classes. You can also use this to enable your own or third-party plugins.
```Python
# List of import paths to vocabularies lookup classes
CONTROLLED_VOCABULARY_VOCABULARIES = [
'controlled_vocabulary.vocabularies.iso639_2',
'controlled_vocabulary.vocabularies.dcmitype',
]
```
After enabling a new plug-in / manager, always run `./manage.py vocab init`.
### ControlledTerm(s)Field
Use the **ControlledTermField** field to define a field with an **autocomplete** to controlled terms in your Django Model:
```Python
from controlled_vocabulary.models import ControlledTermField
...
class MyModel(models.Model):
...
language_code = ControlledTermField(
'iso639-2',
null=True, blank=True
)
```
Where `iso639-2` is the prefix of a controlled vocabulary in your database.
ControlledTermField is essentially syntactic sugar for a [ForeignKeyField](https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.ForeignKey) with an adapted [Select](https://docs.djangoproject.com/en/3.0/ref/forms/widgets/#select) widget.
For multiple values, you can use **ControlledTermsField** (note the '*s*' in the name), which inherits from ManyToManyField with an adapted SelectMultiple widget. The useage is identical but obviously `null=True` should be omitted.
By default the widget proposes the given vocabulary to the end user, but they can use the dropdown to switch to any other available vocabulary (see screenshot at the top of this page). To **lock** the selection to a single vocabulary, use this expression instead:
```Python
language_code = ControlledTermField(
['iso639-2'],
null=True, blank=True
)
```
You can have more than one prefix in that list if you want. The first item is always the one proposed by default on page load.
# vocab (command line tool)
vocab is a django command line tool that lets you manipulate the vocabularies
and the plugins. To find out more use the help:
```Shell
./manage vocab help
```
%package help
Summary: Development documents and examples for django-controlled-vocabulary
Provides: python3-django-controlled-vocabulary-doc
%description help
[](https://badge.fury.io/py/django-controlled-vocabulary) [](https://travis-ci.org/kingsdigitallab/django-controlled-vocabulary)
[Advanced topics (Wiki)](https://github.com/kingsdigitallab/django-controlled-vocabulary/wiki)
# Django Controlled Vocabulary
This app provides models and admin interface to link your data to standard vocabularies (e.g. ISO language codes, Wikidata). Benefits: increases the consistency and understandability of your project data.
Requirements: Python 3.5+, Django 2.2+
Development Status: **Beta**
<img src="docs/img/controlled-term-widget.png" />
_A ControlledTerm field in the Django admin interface. The user selects the vocabulary (here: Wikidata), then starts typing a term in the text box. Suggestions are brought from Wikidata. When the user saves the changes, information about the selected term is copied into the database (url, identifier, label)._
# Features
* create your own controlled lists of terms (i.e. a **local** lists, project-specific)
* look up terms from **standard vocabularies** (i.e. **authority files** maintained by other organisations)
* extensible **plug-in architecture** for lookups into particular vocabularies (see table below for built-in plugins)
* **stores** used terms from remote vocabularies into your database:
* space efficient (doesn't clutter the database with unused terms)
* self-contained (i.e. can still works offline & DB always 'semantically' complete)
* **autocomplete** widget for Django admin; reusable ControlledTermField for your models
* **command line tool** to download vocabulary files from authoritative sources
* [TODO] possibility to store additional **metadata** (e.g. geographic coordinates)
* [TODO] simple **rest API** to publish your own terms
## Standard vocabularies included
Built-in plugins for the following authority files:
| Vocabulary | Description |
| ------------- | ------------- |
| [Schema.org](https://schema.org/) | High-level categories of content |
| [Wikidata](https://www.wikidata.org) | High level concepts or specific instances (e.g. places, people) |
| [ISO 639-2](http://id.loc.gov/vocabulary/iso639-2.html) | Language codes |
| [DCMI Type](https://www.dublincore.org/specifications/dublin-core/dcmi-type-vocabulary/#section-7-dcmi-type-vocabulary) | Dublin Core Format Type |
| [MIME](https://www.iana.org/assignments/media-types/media-types.xhtml) | Media/File types |
| [FAST Topics](https://www.oclc.org/research/themes/data-science/fast.html) | Topic categorisation |
| [FAST Forms and Genres](https://www.oclc.org/research/themes/data-science/fast.html) | Genres of a piece of work |
| [VIAF](https://www.oclc.org/en/viaf.html) | Various: regions, people, companies, ... |
# Data Model & Software Design
## Django models
| Vocabularies | Terms |
| ------------- | ------------- |
| <img src="docs/img/controlled-vocabulary-list.png" width="400" /> | <img src="docs/img/controlled-term-list.png" width="400" /> |
* **ControlledVocabulary**
* prefix: the vocabulary standard prefix, see http://prefix.cc/wikidata
* label: the short name of the vocabulary
* base_url: the url used as a base for all terms in the vocabulary
* concept: the type of terms this vocabulary represents (e.g. language, people)
* description: a longer description
* **ControlledTerm**
* termid: a unique code for the term within a vocabulary, it is case sensitive
* label: standard name for the term, as provided by the authority
* vocabulary: a reference to the ControlledVocabulary this term belongs to
Conventions:
* joining base_url (e.g. http://schema.org) with termid (e.g. Movie) **must** give the exact standard/canonical URI for the term, e.g. http://schema.org/Movie
## Vocabulary plug-ins / managers
A Vocabulary **plug-in** / **manager** is a python class that provides services for a vocabulary:
* autocomplete terms from local or remote datasets (see ControlledTermField)
* supplies metadata for the vocabulary (see ControlledVocabulary)
Managers can provide terms from a CSV file downloaded from an authoritative source.
Some vocabularies can contain thousands of terms or more. A plugin will
only insert the terms used by your application. The rest will be accessed on
demand from a file on disk or in a third-party server. This approach saves
database space and keeps your application data self-contained.
This project comes with built-in plugins such a Wikidata or Schema.org. Those plugins are **enabled** by default; see below how to selectively enable them.
This architecture allows third-party plugins to be supplied via separate
python packages.
# Limitations
* **controlled list** rather than fully fledged vocabularies, (i.e. just a bag of terms with unique IDs/URIs, no support for taxonomic relationships among terms like broader, narrower, synonyms, ...)
* no notion of granularity (e.g. geonames country, region, city, street are all treated as part of the same vocabulary)
# Setup
## Installation
Install into your environment:
```Shell
pip install django-controlled-vocabulary
```
Add the app to the INSTALLED_APPS list in your Django settings file:
```Python
INSTALLED_APPS = [
...
'controlled_vocabulary',
...
]
```
Add the following path to your project urls.py:
```Python
from django.urls import path, include
...
urlpatterns = [
...
path('vocabularies/', include('controlled_vocabulary.urls')),
...
]
```
Run the migrations:
```Shell
./manage.py migrate
```
Download vocabulary data and add metadata to the database:
```Shell
./manage.py vocab init
```
## Configuration
### Enabling specific vocabulary plug-ins (optional)
Currently all built-in plugins / managers are enabled by default. Add the following code in your settings.py to enable **only** specific vocabularies based on the import path of their classes. You can also use this to enable your own or third-party plugins.
```Python
# List of import paths to vocabularies lookup classes
CONTROLLED_VOCABULARY_VOCABULARIES = [
'controlled_vocabulary.vocabularies.iso639_2',
'controlled_vocabulary.vocabularies.dcmitype',
]
```
After enabling a new plug-in / manager, always run `./manage.py vocab init`.
### ControlledTerm(s)Field
Use the **ControlledTermField** field to define a field with an **autocomplete** to controlled terms in your Django Model:
```Python
from controlled_vocabulary.models import ControlledTermField
...
class MyModel(models.Model):
...
language_code = ControlledTermField(
'iso639-2',
null=True, blank=True
)
```
Where `iso639-2` is the prefix of a controlled vocabulary in your database.
ControlledTermField is essentially syntactic sugar for a [ForeignKeyField](https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.ForeignKey) with an adapted [Select](https://docs.djangoproject.com/en/3.0/ref/forms/widgets/#select) widget.
For multiple values, you can use **ControlledTermsField** (note the '*s*' in the name), which inherits from ManyToManyField with an adapted SelectMultiple widget. The useage is identical but obviously `null=True` should be omitted.
By default the widget proposes the given vocabulary to the end user, but they can use the dropdown to switch to any other available vocabulary (see screenshot at the top of this page). To **lock** the selection to a single vocabulary, use this expression instead:
```Python
language_code = ControlledTermField(
['iso639-2'],
null=True, blank=True
)
```
You can have more than one prefix in that list if you want. The first item is always the one proposed by default on page load.
# vocab (command line tool)
vocab is a django command line tool that lets you manipulate the vocabularies
and the plugins. To find out more use the help:
```Shell
./manage vocab help
```
%prep
%autosetup -n django-controlled-vocabulary-0.12
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-django-controlled-vocabulary -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.12-1
- Package Spec generated
|