• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

saritasa-nest / django-import-export-extensions / 6955835944

22 Nov 2023 10:14AM UTC coverage: 78.478% (+0.4%) from 78.121%
6955835944

Pull #25

github

web-flow
Merge 82e75b45f into a3aa8ce29
Pull Request #25: Add force-import feature

57 of 70 new or added lines in 8 files covered. (81.43%)

12 existing lines in 1 file now uncovered.

1134 of 1445 relevant lines covered (78.48%)

9.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/import_export_extensions/admin/widgets.py
1

2
from django import forms
12✔
3

4

5
class ProgressBarWidget(forms.Widget):
12✔
6
    """Widget for progress bar field.
7

8
    Value for `progress_bar` element is changed using JS code.
9

10
    """
11

12
    def __init__(self, *args, **kwargs):
12✔
13
        """Get ``ImportJob`` or ``ExportJob`` instance from kwargs.
14

15
        ``ImportJob`` or ``ExportJob`` instance is used
16
        to render hidden element in `render` method.
17

18
        """
19
        self.job = kwargs.pop("job")
×
20
        self.url = kwargs.pop("url")
×
21
        super().__init__(*args, **kwargs)
×
22

23
    def render(self, *args, **kwargs) -> str:
12✔
24
        """Render HTML5 `progress` element.
25

26
        Additionally, method provides hidden `import_job_url` and
27
        `export_job_url` value that is used in `js/admin/progress_bar.js`
28
        to send GET requests.
29

30
        """
31
        progress_bar = f"""
×
32
            <progress
33
                value="0"
34
                max="100"
35
                id="progress-bar"
36
                data-url="{self.url}">
37
            </progress>
38
        """
39

40
        return progress_bar
×
41

42
    class Media:
12✔
43
        """Class with custom assets for widget."""
44

45
        css = dict(
12✔
46
            all=("import_export_extensions/css/widgets/progress_bar.css",),
47
        )
48
        js = (
12✔
49
            "admin/js/jquery.init.js",
50
            "import_export_extensions/js/widgets/progress_bar.js",
51
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc