~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/models.py

[r=abentley][bug=][author=adeuring] show downloads in past 7, 30, 180 days on the charm details page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
 
227
227
        # Provided by the charm store job.
228
228
        'downloads': 0,
 
229
        'downloads_in_past_7_days': 0,
229
230
        'downloads_in_past_30_days': 0,
 
231
        'downloads_in_past_half_year': 0,
230
232
        'store_data': {},
231
233
        'store_url': '',
232
234
 
444
446
        return self._representation['downloads']
445
447
 
446
448
    @property
 
449
    def downloads_in_past_7_days(self):
 
450
        """The number of times the charm was downloaded in the past 7 days.
 
451
 
 
452
        The number comes from the store. It does not equate to deploys."""
 
453
        return self._representation['downloads_in_past_7_days']
 
454
 
 
455
    @property
447
456
    def downloads_in_past_30_days(self):
448
457
        """The number of times the charm was downloaded in the past 30 days.
449
458
 
451
460
        return self._representation['downloads_in_past_30_days']
452
461
 
453
462
    @property
 
463
    def downloads_in_past_half_year(self):
 
464
        """The number of times the charm was downloaded in the past half year.
 
465
 
 
466
        The number comes from the store. It does not equate to deploys."""
 
467
        return self._representation['downloads_in_past_half_year']
 
468
 
 
469
    @property
454
470
    def proof(self):
455
471
        """The dict charm's proof warnings and errors."""
456
472
        return self._representation['proof']