from django.db import models
from django.conf import settings
from django.forms import Select

from eve_sde.models import Moon

# Create your models here.
class ScanResult(models.Model):
    owner = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        related_name='scans',
        db_index=True
    )

    moon = models.ForeignKey(
        Moon,
        related_name='scans',
        db_index=True
    )


ORE_CHOICES = (
    ('Standard Ores', (
        (1, 'PH1'),
        (2, 'PH2'),
    )),
    ('Moon Ores', (
        (3, 'PH3'),
        (4, 'PH4'),
    )),
)

class ScanResultOre(models.Model):
    scan = models.ForeignKey(
        ScanResult,
        related_name='constituents',
        db_index=True
    )

    ore = models.IntegerField(choices=ORE_CHOICES)

    percentage = models.PositiveSmallIntegerField()

    class Meta:
        default_permissions = ()

@@ -462,34 +462,432 @@
   (1
+8
 , 'P
-H1'),%0A        (2, 'PH2
+lagioclase'),%0A        (19, 'Spodumain'),%0A        (20, 'Kernite'),%0A        (21, 'Hedbergite'),%0A        (22, 'Arkonor'),%0A        (1223, 'Bistot'),%0A        (1224, 'Pyroxeres'),%0A        (1225, 'Crokite'),%0A        (1226, 'Jaspet'),%0A        (1227, 'Omber'),%0A        (1228, 'Scordite'),%0A        (1229, 'Gneiss'),%0A        (1230, 'Veldspar'),%0A        (1231, 'Hemorphite'),%0A        (1232, 'Dark Ochre'),%0A        (11396, 'Mercoxit
 '),%0A

Add all standard ore types with ID.