diff options
author | luxagraf <sng@luxagraf.net> | 2025-01-03 18:46:40 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2025-01-03 18:46:40 -0600 |
commit | fe7d43f308bbc3953d4a88480b8088d12cbcb0b6 (patch) | |
tree | 3aa10d1ac8e041ad2b78a5acf6b29febad6a5fe3 /app/resume/models.py | |
parent | df3bc581e496412ef8c263dbf1cfe00f184e4e59 (diff) |
archived old not used apps
Diffstat (limited to 'app/resume/models.py')
-rw-r--r-- | app/resume/models.py | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/app/resume/models.py b/app/resume/models.py deleted file mode 100644 index bac3115..0000000 --- a/app/resume/models.py +++ /dev/null @@ -1,98 +0,0 @@ -from django.db import models -from django.utils.encoding import force_str -from django.urls import reverse -from django.template.defaultfilters import slugify - -from utils.util import markdown_to_html - - -class Publisher(models.Model): - name = models.CharField(max_length=200) - slug = models.SlugField(max_length=50) - body_markdown = models.TextField(null=True, blank=True) - body_html = models.TextField(null=True, blank=True) - url = models.CharField(max_length=200, blank=True, null=True) - payment_time = models.DecimalField(max_digits=2, decimal_places=0) - order = models.DecimalField(max_digits=1, decimal_places=0) - - class Meta: - ordering = ('order',) - - def __str__(self): - return self.name - - def save(self, *args, **kwargs): - if self.body_markdown: - self.body_html = markdown_to_html(self.body_markdown) - super(Publisher, self).save() - - -class PubItem(models.Model): - title = models.CharField(max_length=200) - slug = models.CharField(max_length=50) - body_markdown = models.TextField(null=True, blank=True) - body_html = models.TextField(null=True, blank=True) - url = models.CharField(max_length=200, blank=True, null=True) - pub_date = models.DateTimeField('Date published') - publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) - - class Meta: - ordering = ('-pub_date',) - - def __str__(self): - return self.title - - def get_absolute_url(self): - return reverse("resume:detail", kwargs={"publisher": self.publisher.slug, "slug": self.slug}) - - def admin_link(self): - return force_str('<a href="%s">Visit Site</a>' % (self.url)) - admin_link.allow_tags = True - admin_link.short_description = 'Live Article' - - def save(self, *args, **kwargs): - if self.body_markdown: - self.body_html = markdown_to_html(self.body_markdown) - super(PubItem, self).save() - - -class Job(models.Model): - title = models.CharField(max_length=200) - employer = models.CharField(max_length=200, blank=True) - date_start = models.DateField('Date Start') - date_end = models.DateField('Date End', null=True, blank=True) - body_markdown = models.TextField(blank=True) - body_html = models.TextField(blank=True) - - class Meta: - ordering = ('-date_end',) - - def __str__(self): - return '{} - {}'.format(self.title, self.employer) # py3.1+ only - - def save(self, *args, **kwargs): - if self.body_markdown: - self.body_html = markdown_to_html(self.body_markdown) - super(Job, self).save() - - -class Resume(models.Model): - title = models.CharField(max_length=200) - slug = models.CharField(max_length=50, blank=True) - profile = models.TextField() - profile_html = models.TextField(blank=True) - skills = models.TextField() - skills_html = models.TextField(blank=True) - jobs = models.ManyToManyField(Job) - - def __str__(self): - return self.title - - def save(self, *args, **kwargs): - if self._state.adding and not self.slug: - self.slug = slugify(self.title) - if self.skills: - self.skills_html = markdown_to_html(self.skills) - if self.profile: - self.profile_html = markdown_to_html(self.profile) - super(Resume, self).save() |