Spaces:
Running
Running
Download api/models/projects.py from Dayozoe/harvestconnect-api: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/models/projects.py
- Command line
-
hf download hf://spaces/Dayozoe/harvestconnect-api/api/models/projects.py
-
curl -L -o projects.py https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/models/projects.py
1.43 kB
| from django.db import models | |
| from django.contrib.auth.models import User | |
| class Project(models.Model): | |
| """Tradesman/Artisan project management""" | |
| STATUS_CHOICES = [ | |
| ('inquiry', 'Inquiry'), | |
| ('quote_sent', 'Quote Sent'), | |
| ('in_progress', 'In Progress'), | |
| ('completed', 'Completed'), | |
| ('cancelled', 'Cancelled'), | |
| ] | |
| PRIORITY_CHOICES = [ | |
| ('low', 'Low'), | |
| ('medium', 'Medium'), | |
| ('high', 'High'), | |
| ] | |
| tradesman = models.ForeignKey(User, on_delete=models.CASCADE, related_name='projects_managed') | |
| client = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name='projects_requested') | |
| title = models.CharField(max_length=255) | |
| description = models.TextField() | |
| status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='inquiry') | |
| priority = models.CharField(max_length=10, choices=PRIORITY_CHOICES, default='medium') | |
| budget = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) | |
| start_date = models.DateField(null=True, blank=True) | |
| end_date = models.DateField(null=True, blank=True) | |
| images = models.JSONField(default=list, blank=True) | |
| created_at = models.DateTimeField(auto_now_add=True) | |
| updated_at = models.DateTimeField(auto_now=True) | |
| def __str__(self): | |
| return f"{self.title} ({self.status})" | |
| class Meta: | |
| ordering = ['-created_at'] | |