Coverage for src/crawler/models/source.py: 82%

11 statements  

« prev     ^ index     » next       coverage.py v7.7.0, created at 2025-04-03 12:36 +0000

1from django.db import models 

2 

3 

4class Source(models.Model): 

5 domain = models.CharField(max_length=150) 

6 website = models.CharField(max_length=250, null=True) 

7 name = models.CharField(max_length=300) 

8 

9 def natural_key(self): 

10 return (self.name,) 

11 

12 def __str__(self): 

13 return f"{self.domain}" 

14 

15 class Meta: 

16 ordering = ["name"]