Filter list with db model
This commit is contained in:
717
project/main/migrations/0002_example_data.py
Normal file
717
project/main/migrations/0002_example_data.py
Normal file
@ -0,0 +1,717 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@dataclass
|
||||
class Breed:
|
||||
name: str
|
||||
country: str
|
||||
origin: str
|
||||
coat: str
|
||||
pattern: str
|
||||
|
||||
|
||||
cat_breeds = [
|
||||
Breed(
|
||||
name="Abyssinian",
|
||||
country="Ethiopia",
|
||||
origin="Natural/Standard",
|
||||
coat="Short",
|
||||
pattern="Ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Aegean",
|
||||
country="Greece",
|
||||
origin="Natural/Standard",
|
||||
coat="Semi-long",
|
||||
pattern="Bi- or tri-colored",
|
||||
),
|
||||
Breed(
|
||||
name="American Curl",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="Short/Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="American Bobtail",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="Short/Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="American Shorthair",
|
||||
country="United States",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="American Wirehair",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Arabian Mau",
|
||||
country="Arabian Peninsula",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Australian Mist",
|
||||
country="Australia",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Spotted and Classic tabby",
|
||||
),
|
||||
Breed(
|
||||
name="Asian",
|
||||
country="United Kingdom",
|
||||
origin="",
|
||||
coat="Short",
|
||||
pattern="Evenly solid",
|
||||
),
|
||||
Breed(
|
||||
name="Asian Semi-longhair",
|
||||
country="United Kingdom",
|
||||
origin="Crossbreed",
|
||||
coat="Semi-long",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Balinese",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Bambino",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Hairless/Furry down",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Bengal",
|
||||
country="United States",
|
||||
origin="Hybrid",
|
||||
coat="Short",
|
||||
pattern="Spotted/Marbled",
|
||||
),
|
||||
Breed(
|
||||
name="Birman",
|
||||
country="France",
|
||||
origin="Natural",
|
||||
coat="Semi Long",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Bombay",
|
||||
country="United States",
|
||||
origin="Crossbred",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Brazilian Shorthair",
|
||||
country="Brazil",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="British Semi-longhair",
|
||||
country="United Kingdom",
|
||||
origin="",
|
||||
coat="Medium",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="British Shorthair",
|
||||
country="United Kingdom",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="British Longhair",
|
||||
country="United Kingdom",
|
||||
origin="",
|
||||
coat="Long",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Burmese",
|
||||
country="Burma and Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Burmilla",
|
||||
country="United Kingdom",
|
||||
origin="Crossbreed",
|
||||
coat="Short/Long",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="California Spangled",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Chantilly-Tiffany",
|
||||
country="United States",
|
||||
origin="",
|
||||
coat="",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Chartreux",
|
||||
country="France",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Chausie",
|
||||
country="France",
|
||||
origin="Hybrid",
|
||||
coat="Short",
|
||||
pattern="Ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Cheetoh",
|
||||
country="United States",
|
||||
origin="Hybrid Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Cornish Rex",
|
||||
country="United Kingdom",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Cymric or Manx Longhair",
|
||||
country="United Kingdom",
|
||||
origin="Natural/Mutation",
|
||||
coat="Long",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Cyprus",
|
||||
country="Cyprus",
|
||||
origin="Natural",
|
||||
coat="All",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Devon Rex",
|
||||
country="United Kingdom",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Donskoy, or Don Sphynx",
|
||||
country="Russia",
|
||||
origin="",
|
||||
coat="Hairless",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Dragon Li",
|
||||
country="China",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Striped tabby",
|
||||
),
|
||||
Breed(
|
||||
name="Dwarf cat, or Dwelf",
|
||||
country="",
|
||||
origin="Crossbreed",
|
||||
coat="",
|
||||
pattern="Hairless",
|
||||
),
|
||||
Breed(
|
||||
name="Egyptian Mau",
|
||||
country="Egypt",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="European Shorthair",
|
||||
country="Finland and Sweden",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Exotic Shorthair",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Foldex[4]",
|
||||
country="Canada",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="German Rex",
|
||||
country="East Germany",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Havana Brown",
|
||||
country="United Kingdom",
|
||||
origin="",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Highlander",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short/Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Himalayan, or Colorpoint Persian",
|
||||
country="United States/United Kingdom",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Japanese Bobtail",
|
||||
country="Japan",
|
||||
origin="Natural",
|
||||
coat="Short/Long",
|
||||
pattern="All but colorpoint and ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Javanese",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Long/Short",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Karelian Bobtail",
|
||||
country="Western Russia",
|
||||
origin="Natural",
|
||||
coat="",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Khao Manee",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Korat",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Korean Bobtail",
|
||||
country="Korea",
|
||||
origin="Natural",
|
||||
coat="Short/Long",
|
||||
pattern="Colorprint",
|
||||
),
|
||||
Breed(
|
||||
name="Korn Ja",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short/Hairless",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Kurilian Bobtail, or Kuril Islands Bobtail",
|
||||
country="Eastern Russia,Japan",
|
||||
origin="Natural",
|
||||
coat="Short/Long",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="LaPerm",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Lykoi",
|
||||
country="United States",
|
||||
origin="Natural/Mutation",
|
||||
coat="Partly Hairless",
|
||||
pattern="Ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Maine Coon",
|
||||
country="United States",
|
||||
origin="Natural",
|
||||
coat="Long",
|
||||
pattern="All but colorpoint and ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Manx",
|
||||
country="United Kingdom",
|
||||
origin="Mutation",
|
||||
coat="Short/Long",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Mekong Bobtail",
|
||||
country="Russia",
|
||||
origin="Natural/Mutation",
|
||||
coat="Short",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Minskin",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short/Hairless",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Munchkin",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Nebelung",
|
||||
country="United States",
|
||||
origin="",
|
||||
coat="Semi-long",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Napoleon",
|
||||
country="",
|
||||
origin="",
|
||||
coat="Long/short",
|
||||
pattern="Varied",
|
||||
),
|
||||
Breed(
|
||||
name="Norwegian Forest cat",
|
||||
country="Norway",
|
||||
origin="Natural",
|
||||
coat="Long",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Ocicat",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Ojos Azules",
|
||||
country="United States",
|
||||
origin="",
|
||||
coat="",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Oregon Rex",
|
||||
country="United States",
|
||||
origin="Mutation",
|
||||
coat="Rex",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Oriental Bicolor",
|
||||
country="",
|
||||
origin="",
|
||||
coat="",
|
||||
pattern="Bicolor",
|
||||
),
|
||||
Breed(
|
||||
name="Oriental Shorthair",
|
||||
country="",
|
||||
origin="",
|
||||
coat="Short",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Oriental Longhair",
|
||||
country="",
|
||||
origin="",
|
||||
coat="Semi-long",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="PerFoldæ(Experimental Breed - WCF),",
|
||||
country="Europe",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Persian (Modern Persian Cat),",
|
||||
country="Iran (Persia),",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Persian (Traditional Persian Cat),",
|
||||
country="Greater Iran",
|
||||
origin="Natural",
|
||||
coat="Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Peterbald",
|
||||
country="Russia",
|
||||
origin="Crossbreed",
|
||||
coat="Hairless",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Pixie-bob",
|
||||
country="United States",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Raas",
|
||||
country="Indonesia",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Ragamuffin",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Ragdoll",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Long",
|
||||
pattern="Colorpoint/Mitted/Bicolor",
|
||||
),
|
||||
Breed(
|
||||
name="Russian Blue",
|
||||
country="Russia",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Russian White, Black and Tabby",
|
||||
country="Australia",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Sam Sawet",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Savannah",
|
||||
country="United States",
|
||||
origin="Hybrid",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Scottish Fold",
|
||||
country="United Kingdom",
|
||||
origin="Natural/Mutation",
|
||||
coat="Short/Long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Selkirk Rex",
|
||||
country="United States",
|
||||
origin="Mutation/Cross",
|
||||
coat="Rex (Short/Long),",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Serengeti",
|
||||
country="United States",
|
||||
origin="Hybrid Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Spotted",
|
||||
),
|
||||
Breed(
|
||||
name="Serrade petit",
|
||||
country="France",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="Siamese",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Siberian",
|
||||
country="Russia",
|
||||
origin="Natural",
|
||||
coat="Semi-long",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Singapura",
|
||||
country="Singapore",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Snowshoe",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Sokoke",
|
||||
country="Kenya",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Classic tabby with ticking",
|
||||
),
|
||||
Breed(
|
||||
name="Somali",
|
||||
country="Somalia",
|
||||
origin="Mutation",
|
||||
coat="Long",
|
||||
pattern="Ticked",
|
||||
),
|
||||
Breed(
|
||||
name="Sphynx",
|
||||
country="Canada",
|
||||
origin="Mutation",
|
||||
coat="Hairless",
|
||||
pattern="All",
|
||||
),
|
||||
Breed(
|
||||
name="Suphalak",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Thai",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Thai Lilac",
|
||||
country="Thailand",
|
||||
origin="Natural",
|
||||
coat="Short",
|
||||
pattern="Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Tonkinese",
|
||||
country="Canada",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Colorpoint/Mink/Solid",
|
||||
),
|
||||
Breed(
|
||||
name="Toyger",
|
||||
country="United States",
|
||||
origin="Crossbreed",
|
||||
coat="Short",
|
||||
pattern="Mackerel",
|
||||
),
|
||||
Breed(
|
||||
name="Turkish Angora",
|
||||
country="Turkey",
|
||||
origin="Natural",
|
||||
coat="Semi-long",
|
||||
pattern="All but colorpoint",
|
||||
),
|
||||
Breed(
|
||||
name="Ukrainian Levkoy",
|
||||
country="Ukraine",
|
||||
origin="",
|
||||
coat="Hairless",
|
||||
pattern="",
|
||||
),
|
||||
Breed(
|
||||
name="York Chocolate",
|
||||
country="United States",
|
||||
origin="Natural",
|
||||
coat="Long",
|
||||
pattern="Solid",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def create_cat_breeds(apps, schema_editor):
|
||||
CatBreed = apps.get_model("main", "CatBreed")
|
||||
|
||||
bulk = []
|
||||
|
||||
for cat_breed in cat_breeds:
|
||||
bulk.append(
|
||||
CatBreed(
|
||||
name=cat_breed.name,
|
||||
country=cat_breed.country,
|
||||
origin=cat_breed.origin,
|
||||
coat=cat_breed.coat,
|
||||
pattern=cat_breed.pattern,
|
||||
)
|
||||
)
|
||||
|
||||
CatBreed.objects.bulk_create(bulk)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("main", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(create_cat_breeds),
|
||||
]
|
||||
Reference in New Issue
Block a user