Add BJCP guidelines to the database.

This commit is contained in:
Chris Giacofei 2024-06-27 09:56:09 -04:00
parent 53b7a1b128
commit b39bfdd267
12 changed files with 12757 additions and 14852 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 5.0.6 on 2024-06-26 19:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0017_alter_equipmentprofile_batch_volume_and_more'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='bjcp_category_id',
field=models.CharField(default='1', max_length=3),
),
migrations.AddField(
model_name='recipe',
name='bjcp_style_id',
field=models.CharField(default='1A', max_length=3),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-26 19:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0018_recipe_bjcp_category_id_recipe_bjcp_style_id'),
]
operations = [
migrations.AlterField(
model_name='recipe',
name='bjcp_style_id',
field=models.CharField(choices=[('1A', 'American Light Lager'), ('1B', 'American Lager'), ('1C', 'Cream Ale'), ('1D', 'American Wheat Beer'), ('2A', 'International Pale Lager'), ('2B', 'International Amber Lager'), ('2C', 'International Dark Lager'), ('3A', 'Czech Pale Lager'), ('3B', 'Czech Premium Pale Lager'), ('3C', 'Czech Amber Lager'), ('3D', 'Czech Dark Lager'), ('4A', 'Munich Helles'), ('4B', 'Festbier'), ('4C', 'Helles Bock'), ('5A', 'German Leichtbier'), ('5B', 'Kölsch'), ('5C', 'German Helles Exportbier'), ('5D', 'German Pils'), ('6A', 'Märzen'), ('6B', 'Rauchbier'), ('6C', 'Dunkles Bock'), ('7A', 'Vienna Lager'), ('7B', 'Altbier'), ('8A', 'Munich Dunkel'), ('8B', 'Schwarzbier'), ('9A', 'Doppelbock'), ('9B', 'Eisbock'), ('9C', 'Baltic Porter'), ('10A', 'Weissbier'), ('10B', 'Dunkles Weissbier'), ('10C', 'Weizenbock'), ('11A', 'Ordinary Bitter'), ('11B', 'Best Bitter'), ('11C', 'Strong Bitter'), ('12A', 'British Golden Ale'), ('12B', 'Australian Sparkling Ale'), ('12C', 'English IPA'), ('13A', 'Dark Mild'), ('13B', 'British Brown Ale'), ('13C', 'English Porter'), ('14A', 'Scottish Light'), ('14B', 'Scottish Heavy'), ('14C', 'Scottish Export'), ('15A', 'Irish Red Ale'), ('15B', 'Irish Stout'), ('15C', 'Irish Extra Stout'), ('16A', 'Sweet Stout'), ('16B', 'Oatmeal Stout'), ('16C', 'Tropical Stout'), ('16D', 'Foreign Extra Stout'), ('17A', 'British Strong Ale'), ('17B', 'Old Ale'), ('17C', 'Wee Heavy'), ('17D', 'English Barley Wine'), ('18A', 'Blonde Ale'), ('18B', 'American Pale Ale'), ('19A', 'American Amber Ale'), ('19B', 'California Common'), ('19C', 'American Brown Ale'), ('20A', 'American Porter'), ('20B', 'American Stout'), ('20C', 'Imperial Stout'), ('21A', 'American IPA'), ('21B', 'Specialty IPA'), ('21C', 'Hazy IPA'), ('22A', 'Double IPA'), ('22B', 'American Strong Ale'), ('22C', 'American Barleywine'), ('22D', 'Wheatwine'), ('23A', 'Berliner Weisse'), ('23B', 'Flanders Red Ale'), ('23C', 'Oud Bruin'), ('23D', 'Lambic'), ('23E', 'Gueuze'), ('23F', 'Fruit Lambic'), ('23G', 'Gose'), ('24A', 'Witbier'), ('24B', 'Belgian Pale Ale'), ('24C', 'Bière de Garde'), ('25A', 'Belgian Blond Ale'), ('25B', 'Saison'), ('25C', 'Belgian Golden Strong Ale'), ('26A', 'Belgian Single'), ('26B', 'Belgian Dubbel'), ('26C', 'Belgian Tripel'), ('26D', 'Belgian Dark Strong Ale'), ('28A', 'Brett Beer'), ('28B', 'Mixed-Fermentation Sour Beer'), ('28C', 'Wild Specialty Beer'), ('28D', 'Straight Sour Beer'), ('29A', 'Fruit Beer'), ('29B', 'Fruit and Spice Beer'), ('29C', 'Specialty Fruit Beer'), ('29D', 'Grape Ale'), ('30A', 'Spice, Herb, or Vegetable Beer'), ('30B', 'Autumn Seasonal Beer'), ('30C', 'Winter Seasonal Beer'), ('30D', 'Specialty Spice Beer'), ('31A', 'Alternative Grain Beer'), ('31B', 'Alternative Sugar Beer'), ('32A', 'Classic Style Smoked Beer'), ('32B', 'Specialty Smoked Beer'), ('34A', 'Commercial Specialty Beer'), ('34B', 'Mixed-Style Beer'), ('34C', 'Experimental Beer'), ('X1', 'Dorada Pampeana'), ('X2', 'IPA Argenta'), ('X3', 'Italian Grape Ale'), ('X4', 'Catharina Sour'), ('X5', 'New Zealand Pilsner')], default='1A', max_length=3),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-26 19:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0019_alter_recipe_bjcp_style_id'),
]
operations = [
migrations.AlterField(
model_name='recipe',
name='bjcp_style_id',
field=models.CharField(choices=[('1A', '1A: American Light Lager'), ('1B', '1B: American Lager'), ('1C', '1C: Cream Ale'), ('1D', '1D: American Wheat Beer'), ('2A', '2A: International Pale Lager'), ('2B', '2B: International Amber Lager'), ('2C', '2C: International Dark Lager'), ('3A', '3A: Czech Pale Lager'), ('3B', '3B: Czech Premium Pale Lager'), ('3C', '3C: Czech Amber Lager'), ('3D', '3D: Czech Dark Lager'), ('4A', '4A: Munich Helles'), ('4B', '4B: Festbier'), ('4C', '4C: Helles Bock'), ('5A', '5A: German Leichtbier'), ('5B', '5B: Kölsch'), ('5C', '5C: German Helles Exportbier'), ('5D', '5D: German Pils'), ('6A', '6A: Märzen'), ('6B', '6B: Rauchbier'), ('6C', '6C: Dunkles Bock'), ('7A', '7A: Vienna Lager'), ('7B', '7B: Altbier'), ('8A', '8A: Munich Dunkel'), ('8B', '8B: Schwarzbier'), ('9A', '9A: Doppelbock'), ('9B', '9B: Eisbock'), ('9C', '9C: Baltic Porter'), ('10A', '10A: Weissbier'), ('10B', '10B: Dunkles Weissbier'), ('10C', '10C: Weizenbock'), ('11A', '11A: Ordinary Bitter'), ('11B', '11B: Best Bitter'), ('11C', '11C: Strong Bitter'), ('12A', '12A: British Golden Ale'), ('12B', '12B: Australian Sparkling Ale'), ('12C', '12C: English IPA'), ('13A', '13A: Dark Mild'), ('13B', '13B: British Brown Ale'), ('13C', '13C: English Porter'), ('14A', '14A: Scottish Light'), ('14B', '14B: Scottish Heavy'), ('14C', '14C: Scottish Export'), ('15A', '15A: Irish Red Ale'), ('15B', '15B: Irish Stout'), ('15C', '15C: Irish Extra Stout'), ('16A', '16A: Sweet Stout'), ('16B', '16B: Oatmeal Stout'), ('16C', '16C: Tropical Stout'), ('16D', '16D: Foreign Extra Stout'), ('17A', '17A: British Strong Ale'), ('17B', '17B: Old Ale'), ('17C', '17C: Wee Heavy'), ('17D', '17D: English Barley Wine'), ('18A', '18A: Blonde Ale'), ('18B', '18B: American Pale Ale'), ('19A', '19A: American Amber Ale'), ('19B', '19B: California Common'), ('19C', '19C: American Brown Ale'), ('20A', '20A: American Porter'), ('20B', '20B: American Stout'), ('20C', '20C: Imperial Stout'), ('21A', '21A: American IPA'), ('21B', '21B: Specialty IPA'), ('21C', '21C: Hazy IPA'), ('22A', '22A: Double IPA'), ('22B', '22B: American Strong Ale'), ('22C', '22C: American Barleywine'), ('22D', '22D: Wheatwine'), ('23A', '23A: Berliner Weisse'), ('23B', '23B: Flanders Red Ale'), ('23C', '23C: Oud Bruin'), ('23D', '23D: Lambic'), ('23E', '23E: Gueuze'), ('23F', '23F: Fruit Lambic'), ('23G', '23G: Gose'), ('24A', '24A: Witbier'), ('24B', '24B: Belgian Pale Ale'), ('24C', '24C: Bière de Garde'), ('25A', '25A: Belgian Blond Ale'), ('25B', '25B: Saison'), ('25C', '25C: Belgian Golden Strong Ale'), ('26A', '26A: Belgian Single'), ('26B', '26B: Belgian Dubbel'), ('26C', '26C: Belgian Tripel'), ('26D', '26D: Belgian Dark Strong Ale'), ('28A', '28A: Brett Beer'), ('28B', '28B: Mixed-Fermentation Sour Beer'), ('28C', '28C: Wild Specialty Beer'), ('28D', '28D: Straight Sour Beer'), ('29A', '29A: Fruit Beer'), ('29B', '29B: Fruit and Spice Beer'), ('29C', '29C: Specialty Fruit Beer'), ('29D', '29D: Grape Ale'), ('30A', '30A: Spice, Herb, or Vegetable Beer'), ('30B', '30B: Autumn Seasonal Beer'), ('30C', '30C: Winter Seasonal Beer'), ('30D', '30D: Specialty Spice Beer'), ('31A', '31A: Alternative Grain Beer'), ('31B', '31B: Alternative Sugar Beer'), ('32A', '32A: Classic Style Smoked Beer'), ('32B', '32B: Specialty Smoked Beer'), ('34A', '34A: Commercial Specialty Beer'), ('34B', '34B: Mixed-Style Beer'), ('34C', '34C: Experimental Beer'), ('X1', 'X1: Dorada Pampeana'), ('X2', 'X2: IPA Argenta'), ('X3', 'X3: Italian Grape Ale'), ('X4', 'X4: Catharina Sour'), ('X5', 'X5: New Zealand Pilsner')], default='1A', max_length=3),
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 5.0.6 on 2024-06-26 19:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('beer', '0020_alter_recipe_bjcp_style_id'),
]
operations = [
migrations.RemoveField(
model_name='recipe',
name='bjcp_category_id',
),
]

View File

@ -0,0 +1,72 @@
# Generated by Django 5.0.6 on 2024-06-27 13:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0021_remove_recipe_bjcp_category_id'),
]
operations = [
migrations.CreateModel(
name='BjcpStyle',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField(blank=True, null=True)),
('category', models.TextField(blank=True, null=True)),
('category_id', models.TextField(blank=True, null=True)),
('style_id', models.TextField(blank=True, null=True)),
('category_description', models.TextField(blank=True, null=True)),
('overall_impression', models.TextField(blank=True, null=True)),
('aroma', models.TextField(blank=True, null=True)),
('appearance', models.TextField(blank=True, null=True)),
('flavor', models.TextField(blank=True, null=True)),
('mouthfeel', models.TextField(blank=True, null=True)),
('comments', models.TextField(blank=True, null=True)),
('history', models.TextField(blank=True, null=True)),
('style_comparison', models.TextField(blank=True, null=True)),
('tags', models.TextField(blank=True, null=True)),
('original_gravity_minimum_unit', models.TextField(blank=True, null=True)),
('original_gravity_minimum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('original_gravity_maximum_unit', models.TextField(blank=True, null=True)),
('original_gravity_maximum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('international_bitterness_units_minimum_unit', models.TextField(blank=True, null=True)),
('international_bitterness_units_minimum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('international_bitterness_units_maximum_unit', models.TextField(blank=True, null=True)),
('international_bitterness_units_maximum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('final_gravity_minimum_unit', models.TextField(blank=True, null=True)),
('final_gravity_minimum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('final_gravity_maximum_unit', models.TextField(blank=True, null=True)),
('final_gravity_maximum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('alcohol_by_volume_minimum_unit', models.TextField(blank=True, null=True)),
('alcohol_by_volume_minimum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('alcohol_by_volume_maximum_unit', models.TextField(blank=True, null=True)),
('alcohol_by_volume_maximum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('color_minimum_unit', models.TextField(blank=True, null=True)),
('color_minimum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('color_maximum_unit', models.TextField(blank=True, null=True)),
('color_maximum_value', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)),
('ingredients', models.TextField(blank=True, null=True)),
('examples', models.TextField(blank=True, null=True)),
('style_guide', models.TextField(blank=True, null=True)),
('type', models.TextField(blank=True, null=True)),
('entry_instructions', models.TextField(blank=True, null=True)),
('notes', models.TextField(blank=True, null=True)),
('currently_defined_types', models.TextField(blank=True, null=True)),
('strength_classifications', models.TextField(blank=True, null=True)),
('vital_statistics', models.TextField(blank=True, null=True)),
('profile', models.TextField(blank=True, null=True)),
('comparison', models.TextField(blank=True, null=True)),
],
options={
'db_table': 'beer_bjcp',
},
),
migrations.AlterField(
model_name='recipe',
name='bjcp_style_id',
field=models.CharField(choices=[('1A', '1A: American Light Lager'), ('1B', '1B: American Lager'), ('1C', '1C: Cream Ale'), ('1D', '1D: American Wheat Beer'), ('2A', '2A: International Pale Lager'), ('2B', '2B: International Amber Lager'), ('2C', '2C: International Dark Lager'), ('3A', '3A: Czech Pale Lager'), ('3B', '3B: Czech Premium Pale Lager'), ('3C', '3C: Czech Amber Lager'), ('3D', '3D: Czech Dark Lager'), ('4A', '4A: Munich Helles'), ('4B', '4B: Festbier'), ('4C', '4C: Helles Bock'), ('5A', '5A: German Leichtbier'), ('5B', '5B: Kölsch'), ('5C', '5C: German Helles Exportbier'), ('5D', '5D: German Pils'), ('6A', '6A: Märzen'), ('6B', '6B: Rauchbier'), ('6C', '6C: Dunkles Bock'), ('7A', '7A: Vienna Lager'), ('7B', '7B: Altbier'), ('8A', '8A: Munich Dunkel'), ('8B', '8B: Schwarzbier'), ('9A', '9A: Doppelbock'), ('9B', '9B: Eisbock'), ('9C', '9C: Baltic Porter'), ('10A', '10A: Weissbier'), ('10B', '10B: Dunkles Weissbier'), ('10C', '10C: Weizenbock'), ('11A', '11A: Ordinary Bitter'), ('11B', '11B: Best Bitter'), ('11C', '11C: Strong Bitter'), ('12A', '12A: British Golden Ale'), ('12B', '12B: Australian Sparkling Ale'), ('12C', '12C: English IPA'), ('13A', '13A: Dark Mild'), ('13B', '13B: British Brown Ale'), ('13C', '13C: English Porter'), ('14A', '14A: Scottish Light'), ('14B', '14B: Scottish Heavy'), ('14C', '14C: Scottish Export'), ('15A', '15A: Irish Red Ale'), ('15B', '15B: Irish Stout'), ('15C', '15C: Irish Extra Stout'), ('16A', '16A: Sweet Stout'), ('16B', '16B: Oatmeal Stout'), ('16C', '16C: Tropical Stout'), ('16D', '16D: Foreign Extra Stout'), ('17A', '17A: British Strong Ale'), ('17B', '17B: Old Ale'), ('17C', '17C: Wee Heavy'), ('17D', '17D: English Barley Wine'), ('18A', '18A: Blonde Ale'), ('18B', '18B: American Pale Ale'), ('19A', '19A: American Amber Ale'), ('19B', '19B: California Common'), ('19C', '19C: American Brown Ale'), ('20A', '20A: American Porter'), ('20B', '20B: American Stout'), ('20C', '20C: Imperial Stout'), ('21A', '21A: American IPA'), ('21B', '21B: Specialty IPA'), ('21C', '21C: Hazy IPA'), ('22A', '22A: Double IPA'), ('22B', '22B: American Strong Ale'), ('22C', '22C: American Barleywine'), ('22D', '22D: Wheatwine'), ('23A', '23A: Berliner Weisse'), ('23B', '23B: Flanders Red Ale'), ('23C', '23C: Oud Bruin'), ('23D', '23D: Lambic'), ('23E', '23E: Gueuze'), ('23F', '23F: Fruit Lambic'), ('23G', '23G: Gose'), ('24A', '24A: Witbier'), ('24B', '24B: Belgian Pale Ale'), ('24C', '24C: Bière de Garde'), ('25A', '25A: Belgian Blond Ale'), ('25B', '25B: Saison'), ('25C', '25C: Belgian Golden Strong Ale'), ('26A', '26A: Belgian Single'), ('26B', '26B: Belgian Dubbel'), ('26C', '26C: Belgian Tripel'), ('26D', '26D: Belgian Dark Strong Ale'), ('28A', '28A: Brett Beer'), ('28B', '28B: Mixed-Fermentation Sour Beer'), ('28C', '28C: Wild Specialty Beer'), ('28D', '28D: Straight Sour Beer'), ('29A', '29A: Fruit Beer'), ('29B', '29B: Fruit and Spice Beer'), ('29C', '29C: Specialty Fruit Beer'), ('29D', '29D: Grape Ale'), ('30A', '30A: Spice, Herb, or Vegetable Beer'), ('30B', '30B: Autumn Seasonal Beer'), ('30C', '30C: Winter Seasonal Beer'), ('30D', '30D: Specialty Spice Beer'), ('31A', '31A: Alternative Grain Beer'), ('31B', '31B: Alternative Sugar Beer'), ('32A', '32A: Classic Style Smoked Beer'), ('32B', '32B: Specialty Smoked Beer'), ('34A', '34A: Commercial Specialty Beer'), ('34B', '34B: Mixed-Style Beer'), ('34C', '34C: Experimental Beer'), ('X5', 'X5: New Zealand Pilsner')], default='1A', max_length=3),
),
]

View File

@ -0,0 +1,88 @@
# Generated by Django 5.0.6 on 2024-06-27 13:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0022_bjcpstyle_alter_recipe_bjcp_style_id'),
]
operations = [
migrations.AlterField(
model_name='bjcpstyle',
name='alcohol_by_volume_maximum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='alcohol_by_volume_minimum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='category',
field=models.TextField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='category_id',
field=models.TextField(blank=True, max_length=5, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='color_maximum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='color_minimum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='final_gravity_maximum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='final_gravity_minimum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='international_bitterness_units_maximum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='international_bitterness_units_minimum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='name',
field=models.TextField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='original_gravity_maximum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='original_gravity_minimum_unit',
field=models.TextField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='style_guide',
field=models.TextField(blank=True, max_length=20, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='style_id',
field=models.TextField(blank=True, max_length=5, null=True),
),
]

View File

@ -0,0 +1,88 @@
# Generated by Django 5.0.6 on 2024-06-27 13:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beer', '0023_alter_bjcpstyle_alcohol_by_volume_maximum_unit_and_more'),
]
operations = [
migrations.AlterField(
model_name='bjcpstyle',
name='alcohol_by_volume_maximum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='alcohol_by_volume_minimum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='category',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='category_id',
field=models.CharField(blank=True, max_length=5, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='color_maximum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='color_minimum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='final_gravity_maximum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='final_gravity_minimum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='international_bitterness_units_maximum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='international_bitterness_units_minimum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='name',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='original_gravity_maximum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='original_gravity_minimum_unit',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='style_guide',
field=models.CharField(blank=True, max_length=20, null=True),
),
migrations.AlterField(
model_name='bjcpstyle',
name='style_id',
field=models.CharField(blank=True, max_length=5, null=True),
),
]

View File

@ -1,5 +1,6 @@
from django.db import models
from django.db.models import Sum, Q
from django.contrib.staticfiles import finders
from django.utils import timezone
from django_cryptography.fields import encrypt
from django.core.validators import MinValueValidator
@ -8,6 +9,7 @@ from config.extras import BREWFATHER_APP_ROOT
from beer.extras import sg_plato, plato_sg, kg_extract, convert
from django.conf import settings
import json
import logging
logger = logging.getLogger('django')
@ -188,10 +190,25 @@ class Recipe(CustomModel):
fermentables = models.ManyToManyField(
'Fermentable', through='RecipeFermentable')
with open(finders.find('bjcp/2021.json'), encoding='utf-8', errors="ignore") as bjcp_file:
bjcp = json.load(bjcp_file)
styles = bjcp['styles']
style_ids = dict([
(x['style_id'], '{}: {}'.format(x['style_id'], x['name']))
for x in styles
])
bjcp_style_id = models.CharField(
max_length=3, choices=style_ids, default='1A')
class Meta:
verbose_name = 'Recipe'
verbose_name_plural = 'Recipes'
@property
def batch_size_display(self):
return convert(self.batch_size, 'l', 'gal')
@property
def fw_max(self):
potential = 0
@ -205,6 +222,10 @@ class Recipe(CustomModel):
ratio = float(self.equipment.mash_ratio)
return 100*e_grain / (ratio+e_grain)
@property
def total_fermentable_display(self):
return convert(self.fermentable_weight_kg, 'kg', 'lb')
@property
def fermentable_weight_kg(self):
"""Weight of all fermentables attached to recipe."""
@ -224,10 +245,18 @@ class Recipe(CustomModel):
return extract
@property
def hop_weight(self):
def total_hop_display(self):
return convert(self.hop_weight_g, 'g', 'oz')
@property
def hop_weight_g(self):
"""Weight of all fermentables attached to recipe."""
aggregate = self.recipehop_set.all().aggregate(Sum('quantity'))
return float(aggregate['quantity__sum']) * 0.0352739619
if aggregate['quantity__sum']:
return aggregate['quantity__sum']
else:
return 0
@property
def final_volume(self):
@ -625,3 +654,60 @@ class EquipmentProfile(CustomModel):
class Meta:
db_table_comment = 'Volumes in liters and weights in kg.'
class BjcpStyle(models.Model):
name = models.CharField(max_length=50, blank=True, null=True)
category = models.CharField(max_length=50, blank=True, null=True)
category_id = models.CharField(max_length=5, blank=True, null=True)
style_id = models.CharField(max_length=5, blank=True, null=True)
category_description = models.TextField(blank=True, null=True)
overall_impression = models.TextField(blank=True, null=True)
aroma = models.TextField(blank=True, null=True)
appearance = models.TextField(blank=True, null=True)
flavor = models.TextField(blank=True, null=True)
mouthfeel = models.TextField(blank=True, null=True)
comments = models.TextField(blank=True, null=True)
history = models.TextField(blank=True, null=True)
style_comparison = models.TextField(blank=True, null=True)
tags = models.TextField(blank=True, null=True)
original_gravity_minimum_unit = models.CharField(max_length=10, blank=True, null=True)
original_gravity_minimum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
original_gravity_maximum_unit = models.CharField(max_length=10, blank=True, null=True)
original_gravity_maximum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
international_bitterness_units_minimum_unit = models.CharField(max_length=10, blank=True, null=True)
international_bitterness_units_minimum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
international_bitterness_units_maximum_unit = models.CharField(max_length=10, blank=True, null=True)
international_bitterness_units_maximum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
final_gravity_minimum_unit = models.CharField(max_length=10, blank=True, null=True)
final_gravity_minimum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
final_gravity_maximum_unit = models.CharField(max_length=10, blank=True, null=True)
final_gravity_maximum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
alcohol_by_volume_minimum_unit = models.CharField(max_length=10, blank=True, null=True)
alcohol_by_volume_minimum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
alcohol_by_volume_maximum_unit = models.CharField(max_length=10, blank=True, null=True)
alcohol_by_volume_maximum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
color_minimum_unit = models.CharField(max_length=10, blank=True, null=True)
color_minimum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
color_maximum_unit = models.CharField(max_length=10, blank=True, null=True)
color_maximum_value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float
ingredients = models.TextField(blank=True, null=True)
examples = models.TextField(blank=True, null=True)
style_guide = models.CharField(max_length=20, blank=True, null=True)
type = models.TextField(blank=True, null=True)
entry_instructions = models.TextField(blank=True, null=True)
notes = models.TextField(blank=True, null=True)
currently_defined_types = models.TextField(blank=True, null=True)
strength_classifications = models.TextField(blank=True, null=True)
vital_statistics = models.TextField(blank=True, null=True)
profile = models.TextField(blank=True, null=True)
comparison = models.TextField(blank=True, null=True)
def __str__(self):
return '{} {}: {}'.format(
self.category,
self.style_id,
self.name
)
class Meta:
db_table = 'beer_bjcp'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
from django.urls import path, re_path
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from .views import home, view_recipe, view_batch, update_ferm, update_hop

12344
fixtures/bjcp.json Normal file

File diff suppressed because it is too large Load Diff