-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transcribe the API endpoints from Webapp2 to Django (#143)
* API for check NGO URL * API for getting all NGOs * WIP API webhooks * Move some URLs back to TODO
- Loading branch information
Showing
6 changed files
with
129 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .main import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from django.db import models | ||
from django.utils import timezone | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .main import Ngo | ||
from users.models import User | ||
|
||
|
||
class Job(models.Model): | ||
"""Keep track for download jobs""" | ||
|
||
ngo = models.ForeignKey(Ngo, verbose_name=_("NGO"), on_delete=models.CASCADE, db_index=True) | ||
owner = models.ForeignKey(User, verbose_name=_("owner"), on_delete=models.CASCADE, db_index=True) | ||
status = models.CharField( | ||
verbose_name=_("status"), | ||
blank=False, | ||
null=False, | ||
default="new", | ||
choices=("new", "error", "done"), | ||
max_length=5, | ||
db_index=True, | ||
) | ||
url = models.URLField(verbose_name=_("URL"), blank=True, null=False, default="", max_length=255) | ||
date_created = models.DateTimeField(verbose_name=_("date created"), db_index=True, auto_now_add=timezone.now) | ||
|
||
def __str__(self): | ||
return f"{self.owner} {self.ngo} {self.status}" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters