Technical docs
Views#
Django views.
PeerReviewView#
View for the reviewer role of the Open Peer Review process.
Bases: LoginRequiredMixin, View
A view handling the peer review of metadata. This view supports loading, parsing, sorting metadata, and handling GET and POST requests for peer review.
Source code in dataedit/views.py
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 | |
get(request, table, review_id=None)
#
Handle GET requests for peer review. Loads necessary data and renders the review template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The incoming HTTP GET request. |
required |
table
|
str
|
The name of the table. |
required |
review_id
|
int
|
The ID of the review. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
HttpResponse |
HttpResponse
|
Rendered HTML response. |
Source code in dataedit/views.py
1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 | |
load_json(table, review_id=None)
#
Load JSON metadata from the database. If the review_id is available then load the metadata form the peer review instance and not from the table. This avoids changes to the metadata that is or was reviewed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
The name of the table. |
required |
review_id
|
int
|
Id of a peer review in the django database |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Loaded oemetadata. |
Source code in dataedit/views.py
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 | |
load_json_schema()
#
Load the JSON schema used for validating metadata.
Note
Update this method if a new oemetadata version is released.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
JSON schema. |
Source code in dataedit/views.py
1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 | |
post(request, table, review_id=None)
#
Handle POST requests for submitting reviews by the reviewer.
This method: - Creates (or saves) reviews in the PeerReview table. - Updates the review finished attribute in the dataedit.Tables table, indicating that the table can be moved from the model draft topic.
Missing parts: - once the opr is finished (all field reviews agreed on) - merge field review results to metadata on table - awarde a badge - is field filled in? - calculate the badge by comparing filled fields and the badges form metadata schema
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The incoming HTTP POST request. |
required |
table
|
str
|
The name of the table. |
required |
review_id
|
int
|
The ID of the review. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
HttpResponse |
HttpResponse
|
Rendered HTML response for the review. |
Raises:
| Type | Description |
|---|---|
JsonResponse
|
If any error occurs, a JsonResponse containing the |
Note
- There are some missing parts in this method. Once the review process is finished (all field reviews agreed on), it should merge field review results to metadata on the table and award a badge based on certain criteria.
- A notification should be sent to the user if he/she can't review tables for which he/she is the table holder (TODO).
- After a review is finished, the table's metadata is updated, and the table can be moved to a different topic (TODO).
Source code in dataedit/views.py
1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 | |
PeerReviewContributorView#
View for the contributor role of the Open Peer Review process.
Bases: TablePeerReviewView
A view handling the contributor's side of the peer review process. This view supports rendering the review template and handling GET and POST requests for contributor's review.
Source code in dataedit/views.py
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 | |
get(request, table, review_id)
#
Handle GET requests for contributor's review. Loads necessary data and renders the contributor review template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The incoming HTTP GET request. |
required |
table
|
str
|
The name of the table. |
required |
review_id
|
int
|
The ID of the review. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
HttpResponse |
HttpResponse
|
Rendered HTML response for contributor review. |
Source code in dataedit/views.py
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 | |
post(request, table, review_id)
#
Handle POST requests for contributor's review. Merges and updates the review data in the PeerReview table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
HttpRequest
|
The incoming HTTP POST request. |
required |
table
|
str
|
The name of the table. |
required |
review_id
|
int
|
The ID of the review. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
HttpResponse |
HttpResponse
|
Rendered HTML response for contributor review. |
Source code in dataedit/views.py
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 | |
Helper Functions#
Separated functionality that can be imported in other modules. It contains several functions that help with recurring tasks in the peer review system.
Provide helper functionality for views to reduce code lines in views.py make the codebase more modular.
SPDX-FileCopyrightText: 2025 Christian Winger https://github.com/wingechr © Öko-Institut e.V. SPDX-FileCopyrightText: 2025 Daryna Barabanova https://github.com/Darynarli © Reiner Lemoine Institut SPDX-FileCopyrightText: 2025 Jonas Huber https://github.com/jh-RLI © Reiner Lemoine Institut SPDX-FileCopyrightText: 2025 Jonas Huber https://github.com/jh-RLI © Reiner Lemoine Institut SPDX-FileCopyrightText: 2025 Jonas Huber https://github.com/jh-RLI © Reiner Lemoine Institut SPDX-FileCopyrightText: 2025 user https://github.com/Darynarli © Reiner Lemoine Institut SPDX-License-Identifier: AGPL-3.0-or-later
add_tag(name, color)
#
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
max 40 character tag text |
required |
color
|
str
|
hexadecimal color code, eg #aaf0f0 |
required |
Raises:
| Type | Description |
|---|---|
IntegrityError
|
if a tag with that normalised name already exists. |
force_insert is load-bearing, not decoration. A tag's primary key is its
normalised name, and a save() on a model whose pk is already set and has
no default makes Django try an UPDATE first -- so creating "Wind Onshore"
where wind_onshore existed silently OVERWROTE that tag's display name and
colour, platform-wide, on every table and factsheet carrying it, and the
caller's duplicate-name guard never fired because nothing raised. Forcing
the INSERT lets the database's own unique constraint answer, which is also
the only answer that is safe against a concurrent create.
Source code in dataedit/helper.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
change_requests(table_obj)
#
Loads the dataedit admin interface :param request: :return:
Source code in dataedit/helper.py
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 | |
delete_peer_review(review_id)
#
Remove Peer Review by review_id.
Source code in dataedit/helper.py
267 268 269 270 271 272 273 274 275 276 277 | |
edit_tag(id, name, color)
#
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
int
|
tag id |
required |
name
|
str
|
max 40 character tag text |
required |
color
|
str
|
hexadecimal color code, eg #aaf0f0 |
required |
Source code in dataedit/helper.py
491 492 493 494 495 496 497 498 499 500 501 502 | |
find_tables(topic_name=None, query_string=None, tag_ids=None)
#
find tables given search criteria
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic_name
|
str
|
only tables in this topic |
None
|
query_string
|
str
|
user search term |
None
|
tag_ids
|
list
|
list of tag ids |
None
|
Returns:
| Type | Description |
|---|---|
QuerySet[Table]
|
QuerySet of Table objetcs |
Source code in dataedit/helper.py
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 | |
get_all_tags(table_name=None)
#
Load all tags of a specific table :param table: Name of a table :return:
Source code in dataedit/helper.py
292 293 294 295 296 297 298 299 300 301 302 303 | |
get_all_tags_with_usage()
#
Every tag, annotated with what actually points at it.
tag_usage counts both consumers -- database tables and factsheets --
because the vocabulary is shared and every list of it governs both.
Deliberately NOT Tag.usage_count: that field is incremented only by
table search in this app and never by factsheets, so ordering a tag list
by it looks apt and ranks an unrelated quantity.
Source code in dataedit/helper.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | |
get_review_for_key(key, review_data)
#
Retrieve the review for a specific key from the review data.
Source code in dataedit/helper.py
89 90 91 92 93 94 95 | |
merge_field_reviews(current_json, new_json)
#
Merge reviews from contributors and reviewers into a single JSON object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_json
|
dict
|
The current JSON object containing reviewer's reviews. |
required |
new_json
|
dict
|
The new JSON object containing contributor's reviews. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
The merged JSON object containing both contributor's and reviewer's reviews. |
Note
If the same key is present in both the contributor's and reviewer's reviews, the function will merge the field evaluations. Otherwise, it will create a new entry in the Review-Dict.
Source code in dataedit/helper.py
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 | |
process_review_data(review_data, metadata, categories)
#
Attach reviewer fields (suggestions/comments/newValue) to metadata items.
The metadata[category] structures may be nested (dict/list) and can contain
non-dict leaf values (e.g. strings). We therefore walk the structure
recursively and only mutate leaf dicts that represent a field item.
Source code in dataedit/helper.py
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 | |
recursive_update(metadata, review_data)
#
Recursively updates metadata with new values from review_data.
Skips or removes fields with status 'rejected'.
Source code in dataedit/helper.py
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 | |
set_nested_value(metadata, keys, value)
#
Set a nested value in a dictionary given a sequence of keys.
Source code in dataedit/helper.py
168 169 170 171 172 173 174 175 176 177 178 | |
update_keywords_from_tags(table)
#
synchronize keywords in metadata with tags
Source code in dataedit/helper.py
530 531 532 533 534 535 536 537 538 | |
Metadata Functions#
Provide functionality that is related to retrieving and updating the oemetadata resource from the database. The oemetadata is the object of a review.
Save Metadata to Database#
Save updated metadata for a specific table in the OEP database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
The name of the table in the OEP. |
required |
updated_metadata
|
dict
|
The updated metadata dictionary. |
required |
Note
This function loads the table object from the database, updates its metadata field, and then saves the updated table object back to the database.
Source code in dataedit/metadata/__init__.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
Load Metadata from Database#
Load metadata for a specific table from the OEP database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
The name of the table in the OEP. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The loaded metadata dictionary. |
Note
The function currently loads metadata from the Table.oemetadata field. There is a consideration to change this function to use a different approach or keep the old functionality (TODO).
Source code in dataedit/metadata/__init__.py
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 | |
Models#
Django models.
PeerReview#
The model of the Open Peer Review defines what data is stored in the django database about each existing review. Next to the review itself it stores additional data about the the reviewer and contributor user and more. It is used in the PeerReviewManger.
Note
This model also provides functionality that is directly related to the model. It is up to discussion if we want to keep the functionality inside the model.
Bases: Model
Represents a peer review in the database.
Attributes:
| Name | Type | Description |
|---|---|---|
table |
CharField
|
Name of the table being reviewed. |
reviewer |
ForeignKey
|
The user who reviews. |
contributor |
ForeignKey
|
The user who contributes. |
is_finished |
BooleanField
|
Whether the review is finished. |
date_started |
DateTimeField
|
When the review started. |
date_submitted |
DateTimeField
|
When the review was submitted. |
date_finished |
DateTimeField
|
When the review finished. |
review |
JSONField
|
The review data in JSON format. |
Source code in dataedit/models.py
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 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | |
delete(*args, **kwargs)
#
Custom delete method to remove related PeerReviewManager entries.
Source code in dataedit/models.py
692 693 694 695 696 697 698 699 | |
get_prev_and_next_reviews(table)
#
Sets the prev_review and next_review fields based on the date_started field of the PeerReview objects associated with the same table.
Source code in dataedit/models.py
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 | |
load(table)
classmethod
#
Load the current reviewer user. The current review is review is determened by the latest date started.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
string
|
Table name |
required |
Returns:
| Name | Type | Description |
|---|---|---|
opr |
PeerReview
|
PeerReview object related to the latest |
Union[PeerReview, None]
|
date started. |
Source code in dataedit/models.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | |
set_version_of_metadata_for_review(table, *args, **kwargs)
#
Once the peer review is started, we save the current version of the oemetadata that is present on the table to the peer review instance to be able to do the review to a fixed state of the metadata.
A started review means a reviewer saves / submits or finishes (in case the review is completed in one go) a review.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Table name |
required |
Returns:
| Name | Type | Description |
|---|---|---|
State |
tuple
|
Bool value that indicates weather there is already |
|
a version of oemetadata available for this review & readable |
||
|
status message. |
Source code in dataedit/models.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | |
update(*args, **kwargs)
#
Update the peer review if the latest peer review is not finished yet but either saved or submitted.
Source code in dataedit/models.py
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
PeerReviewManager#
The Manager is introduced to be able to store additional information about the peer review process and separate it from the PeerReview model. The process is started by submitting a review and the manager maintains the order of which user has to take the next action to be able to hold and activate the process.
Note
This model also provides functionality that is directly related to the model. It is up to discussion if we want to keep the functionality inside the model.
Bases: Model
Manages peer review processes.
This model handles the 1:n relation between table and open peer reviews. It tracks the days open for the peer review and its state. It determines who is next in the process between reviewer and contributor. It provides information about the previous and next review. It offers several methods that provide generic filters for the peer reviews.
Attributes:
| Name | Type | Description |
|---|---|---|
opr |
ForeignKey
|
The associated peer review. |
current_reviewer |
CharField
|
The current reviewer. |
status |
CharField
|
The current status of the review. |
is_open_since |
CharField
|
How long the review has been open. |
Source code in dataedit/models.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | |
filter_latest_open_opr_by_contributor(contributor_user)
staticmethod
#
Get the last open peer review for the given contributor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
contributor_user
|
User
|
The contributor user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PeerReview |
Last open peer review or None if not found. |
Source code in dataedit/models.py
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 | |
filter_latest_open_opr_by_reviewer(reviewer_user)
staticmethod
#
Get the last open peer review for the given contributor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
contributor_user
|
User
|
The contributor user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PeerReview |
Last open peer review or None if not found. |
Source code in dataedit/models.py
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 | |
filter_opr_by_contributor(contributor_user)
staticmethod
#
Filter peer reviews by contributor, excluding those with current peer is reviewer and the data status "SAVED" in the peer review manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
contributor_user
|
User
|
The contributor user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuerySet |
Filtered peer reviews. |
Source code in dataedit/models.py
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | |
filter_opr_by_reviewer(reviewer_user)
staticmethod
#
Filter peer reviews by reviewer, excluding those with current peer is contributor and the data status "SAVED" in the peer review manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reviewer_user
|
User
|
The reviewer user. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuerySet |
Filtered peer reviews. |
Source code in dataedit/models.py
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | |
filter_opr_by_table(table)
staticmethod
#
Filter peer reviews by table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Table name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuerySet |
QuerySet[PeerReview]
|
Filtered peer reviews. |
Source code in dataedit/models.py
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 | |
load(opr)
classmethod
#
Load the peer review manager associated with the given peer review.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opr
|
PeerReview
|
The peer review. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PeerReviewManager |
The peer review manager. |
Source code in dataedit/models.py
828 829 830 831 832 833 834 835 836 837 838 839 840 | |
load_contributor(table)
staticmethod
#
Get the contributor for the table a review is started.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Table name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
User |
The contributor user. |
Source code in dataedit/models.py
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 | |
load_reviewer(table)
staticmethod
#
Get the reviewer for the table a review is started.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
Table name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
User |
The reviewer user. |
Source code in dataedit/models.py
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 | |
save(*args, **kwargs)
#
Override the save method to perform additional logic before saving the peer review manager.
Source code in dataedit/models.py
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | |
set_next_reviewer()
#
Set the order on which peer will be required to perform a action to continue with the process.
Source code in dataedit/models.py
881 882 883 884 885 886 887 888 889 890 891 | |
update_open_since(opr=None, *args, **kwargs)
classmethod
#
Update the "is_open_since" field of the peer review manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
opr
|
PeerReview
|
The peer review. |
None
|
Source code in dataedit/models.py
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 | |
whos_turn()
#
Get the user and role (contributor or reviewer) whose turn it is.
Returns:
| Type | Description |
|---|---|
|
Tuple[str, User]: The role and user. |
Source code in dataedit/models.py
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | |