mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Compare commits
8 Commits
be5afaf644
...
misc
| Author | SHA1 | Date | |
|---|---|---|---|
|
eab031b3cb
|
|||
|
d274ea4606
|
|||
|
abf977b47e
|
|||
|
a1eb237f94
|
|||
|
805f573b7d
|
|||
|
2b0aa3e673
|
|||
|
0d9acc413b
|
|||
| 6dffaa4f21 |
@@ -1,6 +1,6 @@
|
|||||||
# TEC PA & Lighting - PyRIGS #
|
# TEC PA & Lighting - PyRIGS #
|
||||||
[](https://travis-ci.org/nottinghamtec/PyRIGS)
|
[](https://travis-ci.org/nottinghamtec/PyRIGS)
|
||||||
[](https://coveralls.io/github/nottinghamtec/PyRIGS)
|
[](https://coveralls.io/github/nottinghamtec/PyRIGS)
|
||||||
|
|
||||||
Welcome to TEC PA & Lightings PyRIGS program. This is a reimplementation of the existing Rig Information Gathering System (RIGS) that was developed using Ruby on Rails.
|
Welcome to TEC PA & Lightings PyRIGS program. This is a reimplementation of the existing Rig Information Gathering System (RIGS) that was developed using Ruby on Rails.
|
||||||
|
|
||||||
|
|||||||
@@ -486,6 +486,10 @@ class Event(models.Model, RevisionMixin):
|
|||||||
if startEndSameDay and hasStartAndEnd and self.start_time > self.end_time:
|
if startEndSameDay and hasStartAndEnd and self.start_time > self.end_time:
|
||||||
raise ValidationError('Unless you\'ve invented time travel, the event can\'t finish before it has started.')
|
raise ValidationError('Unless you\'ve invented time travel, the event can\'t finish before it has started.')
|
||||||
|
|
||||||
|
accessAndStartSameDay = self.access_at is not None and self.start_date == self.access_at.date()
|
||||||
|
if self.access_at.date() > self.start_date or (accessAndStartSameDay and self.access_at.time() > self.start_time):
|
||||||
|
raise ValidationError('Regardless of what some clients might think, access time cannot be after the event has started.')
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"""Call :meth:`full_clean` before saving."""
|
"""Call :meth:`full_clean` before saving."""
|
||||||
self.full_clean()
|
self.full_clean()
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ class EventDuplicate(EventUpdate):
|
|||||||
new = copy.copy(old) # Make a copy of the object in memory
|
new = copy.copy(old) # Make a copy of the object in memory
|
||||||
new.based_on = old # Make the new event based on the old event
|
new.based_on = old # Make the new event based on the old event
|
||||||
new.purchase_order = None # Remove old PO
|
new.purchase_order = None # Remove old PO
|
||||||
|
new.status = new.PROVISIONAL # Return status to provisional
|
||||||
|
|
||||||
# Clear checked in by if it's a dry hire
|
# Clear checked in by if it's a dry hire
|
||||||
if new.dry_hire is True:
|
if new.dry_hire is True:
|
||||||
|
|||||||
18
assets/migrations/0011_asset_nickname.py
Normal file
18
assets/migrations/0011_asset_nickname.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.0.13 on 2020-03-03 19:40
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0010_auto_20200207_1737'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='asset',
|
||||||
|
name='nickname',
|
||||||
|
field=models.CharField(blank=True, max_length=20, null=True, unique=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -82,6 +82,7 @@ class Asset(models.Model, RevisionMixin):
|
|||||||
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
|
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
|
||||||
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
|
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
|
||||||
serial_number = models.CharField(max_length=150, blank=True)
|
serial_number = models.CharField(max_length=150, blank=True)
|
||||||
|
nickname = models.CharField(max_length=20, blank=True, null=True, unique=True) # Null = true required because of the unique constraint
|
||||||
purchased_from = models.ForeignKey(to=Supplier, on_delete=models.CASCADE, blank=True, null=True, related_name="assets")
|
purchased_from = models.ForeignKey(to=Supplier, on_delete=models.CASCADE, blank=True, null=True, related_name="assets")
|
||||||
date_acquired = models.DateField()
|
date_acquired = models.DateField()
|
||||||
date_sold = models.DateField(blank=True, null=True)
|
date_sold = models.DateField(blank=True, null=True)
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
<label for="{{ form.serial_number.id_for_label }}">Serial Number</label>
|
<label for="{{ form.serial_number.id_for_label }}">Serial Number</label>
|
||||||
{% render_field form.serial_number|add_class:'form-control' value=object.serial_number %}
|
{% render_field form.serial_number|add_class:'form-control' value=object.serial_number %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="{{ form.nickname.id_for_label }}">Nickname</label>
|
||||||
|
{% render_field form.nickname|add_class:'form-control' value=object.nickname %}
|
||||||
|
</div>
|
||||||
<!---TODO: Lower default number of lines in comments box-->
|
<!---TODO: Lower default number of lines in comments box-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="{{ form.comments.id_for_label }}">Comments</label>
|
<label for="{{ form.comments.id_for_label }}">Comments</label>
|
||||||
@@ -53,6 +57,9 @@
|
|||||||
<dt>Serial Number</dt>
|
<dt>Serial Number</dt>
|
||||||
<dd>{{ object.serial_number|default:'-' }}</dd>
|
<dd>{{ object.serial_number|default:'-' }}</dd>
|
||||||
|
|
||||||
|
<dt>Nickname</dt>
|
||||||
|
<dd>{{ object.nickname|default:'-' }}</dd>
|
||||||
|
|
||||||
<dt>Comments</dt>
|
<dt>Comments</dt>
|
||||||
<dd style="overflow-wrap: break-word;">{{ object.comments|default:'-'|linebreaksbr }}</dd>
|
<dd style="overflow-wrap: break-word;">{{ object.comments|default:'-'|linebreaksbr }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user