Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Commit

Permalink
add more fields to buys
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrlly committed Dec 8, 2016
1 parent 8c82314 commit b074062
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 20 deletions.
50 changes: 50 additions & 0 deletions projects/migrations/0002_auto_20161208_1623.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-08 16:23
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('projects', '0001_squashed_0038_openmarket_software'),
]

operations = [
migrations.AddField(
model_name='agilebpa',
name='amount_of_competition',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='agilebpa',
name='competition_strategy',
field=models.CharField(blank=True, choices=[('A/E Procedures', 'A/E Procedures'), ('Competed under SAP', 'Competed under SAP'), ('Competitive Delivery Order Fair Opportunity Provided', 'Competitive Delivery Order Fair Opportunity Provided'), ('Competitive Schedule Buy', 'Competitive Schedule Buy'), ('Fair Opportunity', 'Fair Opportunity'), ('Follow On to Competed Action (FAR 6.302-1)', 'Follow On to Competed Action (FAR 6.302-1)'), ('Follow On to Competed Action', 'Follow On to Competed Action'), ('Full and Open after exclusion of sources (competitive small business set-asides, competitive 8a)', 'Full and Open after exclusion of sources (competitive small business set-asides, competitive 8a)'), ('Full and Open Competition Unrestricted', 'Full and Open Competition Unrestricted'), ('Full and Open Competition', 'Full and Open Competition'), ('Limited Sources FSS Order', 'Limited Sources FSS Order'), ('Limited Sources', 'Limited Sources'), ('Non-Competitive Delivery Order', 'Non-Competitive Delivery Order'), ('Not Available for Competition (e.g., 8a sole source, HUBZone & SDVOSB sole source, Ability One, all > SAT)', 'Not Available for Competition (e.g., 8a sole source, HUBZone & SDVOSB sole source, Ability One, all > SAT)'), ('Not Competed (e.g., sole source, urgency, etc., all > SAT)', 'Not Competed (e.g., sole source, urgency, etc., all > SAT)'), ('Not Competed under SAP (e.g., Urgent, Sole source, Logical Follow-On, 8a, HUBZone & SDVOSB sole source, all < SAT)', 'Not Competed under SAP (e.g., Urgent, Sole source, Logical Follow-On, 8a, HUBZone & SDVOSB sole source, all < SAT)'), ('Partial Small Business Set-Aside', 'Partial Small Business Set-Aside'), ('Set-Aside', 'Set-Aside'), ('Sole Source', 'Sole Source')], max_length=200, null=True),
),
migrations.AddField(
model_name='agilebpa',
name='naics_code',
field=models.IntegerField(blank=True, null=True, verbose_name='NAICS Code'),
),
migrations.AddField(
model_name='micropurchase',
name='amount_of_competition',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='openmarket',
name='amount_of_competition',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='software',
name='amount_of_competition',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='project',
name='description',
field=models.TextField(),
),
]
96 changes: 76 additions & 20 deletions projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,57 @@ def name(self):
class Meta:
pass

COMPETITION_STRATEGY_CHOICES = (
("A/E Procedures", "A/E Procedures"),
("Competed under SAP", "Competed under SAP"),
("Competitive Delivery Order Fair Opportunity Provided",
"Competitive Delivery Order Fair Opportunity Provided"),
("Competitive Schedule Buy", "Competitive Schedule Buy"),
("Fair Opportunity", "Fair Opportunity"),
("Follow On to Competed Action (FAR 6.302-1)",
"Follow On to Competed Action (FAR 6.302-1)"),
("Follow On to Competed Action", "Follow On to Competed Action"),
("Full and Open after exclusion of sources (competitive small business \
set-asides, competitive 8a)",
"Full and Open after exclusion of sources (competitive small \
business set-asides, competitive 8a)"),
("Full and Open Competition Unrestricted",
"Full and Open Competition Unrestricted"),
("Full and Open Competition", "Full and Open Competition"),
("Limited Sources FSS Order", "Limited Sources FSS Order"),
("Limited Sources", "Limited Sources"),
("Non-Competitive Delivery Order", "Non-Competitive Delivery Order"),
("Not Available for Competition (e.g., 8a sole source, HUBZone & \
SDVOSB sole source, Ability One, all > SAT)",
"Not Available for Competition (e.g., 8a sole source, HUBZone & \
SDVOSB sole source, Ability One, all > SAT)"),
("Not Competed (e.g., sole source, urgency, etc., all > SAT)",
"Not Competed (e.g., sole source, urgency, etc., all > SAT)"),
("Not Competed under SAP (e.g., Urgent, Sole source, Logical \
Follow-On, 8a, HUBZone & SDVOSB sole source, all < SAT)",
"Not Competed under SAP (e.g., Urgent, Sole source, Logical \
Follow-On, 8a, HUBZone & SDVOSB sole source, all < SAT)"),
("Partial Small Business Set-Aside",
"Partial Small Business Set-Aside"),
("Set-Aside", "Set-Aside"),
("Sole Source", "Sole Source"),
)

SET_ASIDE_CHOICES = (
("AbilityOne", "AbilityOne"),
("HUBZone Small Business", "HUBZone Small Business"),
("Multiple Small Business Categories",
"Multiple Small Business Categories"),
("Other Than Small", "Other Than Small"),
("Service Disabled Veteran-owned Small Business",
"Service Disabled Veteran-owned Small Business"),
("Small Business", "Small Business"),
("Small Disadvantaged Business (includes Section 8a)",
"Small Disadvantaged Business (includes Section 8a)"),
("Veteran-Owned Small Business", "Veteran-Owned Small Business"),
("Woman-Owned Small Business", "Woman-Owned Small Business"),
)


class Buy(models.Model):
name = models.CharField(
Expand All @@ -297,6 +348,10 @@ class Buy(models.Model):
public = models.BooleanField(
default=False,
)
amount_of_competition = models.IntegerField(
blank=True,
null=True,
)

# Milestone dates
issue_date = models.DateField(
Expand All @@ -313,21 +368,6 @@ class Meta:


class AgileBPA(Buy):
SET_ASIDE_CHOICES = (
("AbilityOne", "AbilityOne"),
("HUBZone Small Business", "HUBZone Small Business"),
("Multiple Small Business Categories",
"Multiple Small Business Categories"),
("Other Than Small", "Other Than Small"),
("Service Disabled Veteran-owned Small Business",
"Service Disabled Veteran-owned Small Business"),
("Small Business", "Small Business"),
("Small Disadvantaged Business (includes Section 8a)",
"Small Disadvantaged Business (includes Section 8a)"),
("Veteran-Owned Small Business", "Veteran-Owned Small Business"),
("Woman-Owned Small Business", "Woman-Owned Small Business"),
)

contractual_history = models.TextField(
blank=False,
null=False,
Expand All @@ -348,6 +388,11 @@ class AgileBPA(Buy):
blank=True,
null=True,
)
naics_code = models.IntegerField(
blank=True,
null=True,
verbose_name="NAICS Code"
)
procurement_method = models.CharField(
max_length=200,
default="Agile Development Services BPA Order",
Expand All @@ -362,6 +407,12 @@ class AgileBPA(Buy):
null=True,
verbose_name='Set-aside Status'
)
competition_strategy = models.CharField(
max_length=200,
choices=COMPETITION_STRATEGY_CHOICES,
blank=True,
null=True,
)
rfq_id = models.CharField(
max_length=20,
blank=True,
Expand Down Expand Up @@ -535,7 +586,7 @@ def all_nda_signed(self):
else:
return True

def required_fields(self):
def ready_to_issue(self):
required_fields = [
self.name,
self.description,
Expand All @@ -555,12 +606,10 @@ def required_fields(self):
self.rfq_id,
self.procurement_method,
self.set_aside_status,
self.competition_strategy,
self.github_repository,
]
return required_fields

def ready_to_issue(self):
if None in self.required_fields() or not self.all_nda_signed():
if None in required_fields or not self.all_nda_signed():
return False
else:
return True
Expand Down Expand Up @@ -631,6 +680,13 @@ def clean(self):
'award_date': 'Please set an issue date first'
})

# Check NAICS Code
if self.naics_code:
if len(self.naics_code) != 6:
raise ValidationError({
'naics_code': 'NAICS Code must be six digits'
})

class Meta:
verbose_name = 'Agile BPA Order'

Expand Down
1 change: 1 addition & 0 deletions projects/tests/test_field_locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def buy_plus(self, buy):
buy.dollars = 1234
buy.public = True
buy.rfq_id = 'abc12345678'
buy.naics = 4444444
buy.procurement_method = 'Agile BPA'
buy.set_aside_status = 'Small Business'
buy.github_repository = 'https://github.com/18f/wow_such_repo/'
Expand Down
21 changes: 21 additions & 0 deletions team/migrations/0002_auto_20161208_1623.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-08 16:23
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('team', '0001_squashed_0011_auto_20161105_2006'),
]

operations = [
migrations.AlterField(
model_name='teammate',
name='role',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='team.Role'),
),
]

0 comments on commit b074062

Please sign in to comment.