Skip to content

Commit

Permalink
Cross-gen in submit form works better
Browse files Browse the repository at this point in the history
  • Loading branch information
evinjaff committed Jul 14, 2024
1 parent a4dce72 commit b5898d7
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.6 on 2024-07-13 23:33

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('pokepoll', '0014_alter_pokemon_pokemon_intended_generation'),
]

operations = [
migrations.RemoveField(
model_name='pokemon',
name='pokemon_compatible_generations',
),
]
1 change: 0 additions & 1 deletion server/pokepoll/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Pokemon(models.Model):
pokemon_held_item = models.IntegerField(default=0)
pokemon_is_shiny = models.BooleanField(default=False)
pokemon_intended_generation = models.IntegerField(default=4, choices=[(1, "Gen 1"), (2, "Gen 2"), (3, "Gen 3"), (4, "Gen 4"), (5, "Gen 5"), (6, "Gen 6"), (7, "Gen 7"), (8, "Gen 8")])
pokemon_compatible_generations = models.JSONField(default=list([4]))


pub_date = models.DateTimeField("date published")
Expand Down
10 changes: 9 additions & 1 deletion server/pokepoll/static/pokepoll/autocomplete_form_ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

function autocomplete(inp, arr) {
function autocomplete(inp, arr, selectionCallback) {
// selectionCallback is a lambda that should be called when a selection is made

/*the autocomplete function takes two arguments,
the text field element and an array of possible autocompleted values:*/
var currentFocus;
Expand Down Expand Up @@ -34,6 +36,12 @@ function autocomplete(inp, arr) {
/*close the list of autocompleted values,
(or any other open lists of autocompleted values:*/
closeAllLists();
if (selectionCallback){
selectionCallback();
}
else {
console.log("No selection callback provided");
}
});
a.appendChild(b);
}
Expand Down
323 changes: 323 additions & 0 deletions server/pokepoll/static/pokepoll/held_items_to_id_gen_5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
{
"None": 0,
"Master Ball": 1,
"Ultra Ball": 2,
"Great Ball": 3,
"Poké Ball": 4,
"Safari Ball": 5,
"Net Ball": 6,
"Dive Ball": 7,
"Nest Ball": 8,
"Repeat Ball": 9,
"Timer Ball": 10,
"Luxury Ball": 11,
"Premier Ball": 12,
"Dusk Ball": 13,
"Heal Ball": 14,
"Quick Ball": 15,
"Cherish Ball": 16,
"Potion": 17,
"Antidote": 18,
"Burn Heal": 19,
"Ice Heal": 20,
"Awakening": 21,
"Parlyz Heal": 22,
"Full Restore": 23,
"Max Potion": 24,
"Hyper Potion": 25,
"Super Potion": 26,
"Full Heal": 27,
"Revive": 28,
"Max Revive": 29,
"Fresh Water": 30,
"Soda Pop": 31,
"Lemonade": 32,
"Moomoo Milk": 33,
"EnergyPowder": 34,
"Energy Root": 35,
"Heal Powder": 36,
"Revival Herb": 37,
"Ether": 38,
"Max Ether": 39,
"Elixir": 40,
"Max Elixir": 41,
"Lava Cookie": 42,
"Berry Juice": 43,
"Sacred Ash": 44,
"HP Up": 45,
"Protein": 46,
"Iron": 47,
"Carbos": 48,
"Calcium": 49,
"Rare Candy": 50,
"PP Up": 51,
"Zinc": 52,
"PP Max": 53,
"Old Gateau": 54,
"Guard Spec.": 55,
"Dire Hit": 56,
"X Attack": 57,
"X Defense": 58,
"X Speed": 59,
"X Accuracy": 60,
"X Sp. Atk": 61,
"X Sp. Def": 62,
"Poké Doll": 63,
"Fluffy Tail": 64,
"Blue Flute": 65,
"Yellow Flute": 66,
"Red Flute": 67,
"Black Flute": 68,
"White Flute": 69,
"Shoal Salt": 70,
"Shoal Shell": 71,
"Red Shard": 72,
"Blue Shard": 73,
"Yellow Shard": 74,
"Green Shard": 75,
"Super Repel": 76,
"Max Repel": 77,
"Escape Rope": 78,
"Repel": 79,
"Sun Stone": 80,
"Moon Stone": 81,
"Fire Stone": 82,
"Thunder Stone": 83,
"Water Stone": 84,
"Leaf Stone": 85,
"TinyMushroom": 86,
"Big Mushroom": 87,
"Pearl": 88,
"Big Pearl": 89,
"Stardust": 90,
"Star Piece": 91,
"Nugget": 92,
"Heart Scale": 93,
"Honey": 94,
"Growth Mulch": 95,
"Damp Mulch": 96,
"Stable Mulch": 97,
"Gooey Mulch": 98,
"Root Fossil": 99,
"Claw Fossil": 100,
"Helix Fossil": 101,
"Dome Fossil": 102,
"Old Amber": 103,
"Armor Fossil": 104,
"Skull Fossil": 105,
"Rare Bone": 106,
"Shiny Stone": 107,
"Dusk Stone": 108,
"Dawn Stone": 109,
"Oval Stone": 110,
"Odd Keystone": 111,
"Griseous Orb": 112,
"Douse Drive": 116,
"Shock Drive": 117,
"Burn Drive": 118,
"Chill Drive": 119,
"Sweet Heart": 134,
"Adamant Orb": 135,
"Lustrous Orb": 136,
"Greet Mail": 137,
"Favored Mail": 138,
"RSVP Mail": 139,
"Thanks Mail": 140,
"Inquiry Mail": 141,
"Like Mail": 142,
"Reply Mail": 143,
"BridgeMail S": 144,
"BridgeMail D": 145,
"BridgeMail T": 146,
"BridgeMail V": 147,
"BridgeMail M": 148,
"Cheri Berry": 149,
"Chesto Berry": 150,
"Pecha Berry": 151,
"Rawst Berry": 152,
"Aspear Berry": 153,
"Leppa Berry": 154,
"Oran Berry": 155,
"Persim Berry": 156,
"Lum Berry": 157,
"Sitrus Berry": 158,
"Figy Berry": 159,
"Wiki Berry": 160,
"Mago Berry": 161,
"Aguav Berry": 162,
"Iapapa Berry": 163,
"Razz Berry": 164,
"Bluk Berry": 165,
"Nanab Berry": 166,
"Wepear Berry": 167,
"Pinap Berry": 168,
"Pomeg Berry": 169,
"Kelpsy Berry": 170,
"Qualot Berry": 171,
"Hondew Berry": 172,
"Grepa Berry": 173,
"Tamato Berry": 174,
"Cornn Berry": 175,
"Magost Berry": 176,
"Rabuta Berry": 177,
"Nomel Berry": 178,
"Spelon Berry": 179,
"Pamtre Berry": 180,
"Watmel Berry": 181,
"Durin Berry": 182,
"Belue Berry": 183,
"Occa Berry": 184,
"Passho Berry": 185,
"Wacan Berry": 186,
"Rindo Berry": 187,
"Yache Berry": 188,
"Chople Berry": 189,
"Kebia Berry": 190,
"Shuca Berry": 191,
"Coba Berry": 192,
"Payapa Berry": 193,
"Tanga Berry": 194,
"Charti Berry": 195,
"Kasib Berry": 196,
"Haban Berry": 197,
"Colbur Berry": 198,
"Babiri Berry": 199,
"Chilan Berry": 200,
"Liechi Berry": 201,
"Ganlon Berry": 202,
"Salac Berry": 203,
"Petaya Berry": 204,
"Apicot Berry": 205,
"Lansat Berry": 206,
"Starf Berry": 207,
"Enigma Berry": 208,
"Micle Berry": 209,
"Custap Berry": 210,
"Jaboca Berry": 211,
"Rowap Berry": 212,
"BrightPowder": 213,
"White Herb": 214,
"Macho Brace": 215,
"Exp. Share": 216,
"Quick Claw": 217,
"Soothe Bell": 218,
"Mental Herb": 219,
"Choice Band": 220,
"King's Rock": 221,
"Silver Powder": 222,
"Amulet Coin": 223,
"Cleanse Tag": 224,
"Soul Dew": 225,
"DeepSeaTooth": 226,
"DeepSeaScale": 227,
"Smoke Ball": 228,
"Everstone": 229,
"Focus Band": 230,
"Lucky Egg": 231,
"Scope Lens": 232,
"Metal Coat": 233,
"Leftovers": 234,
"Dragon Scale": 235,
"Light Ball": 236,
"Soft Sand": 237,
"Hard Stone": 238,
"Miracle Seed": 239,
"Black Glasses": 240,
"Black Belt": 241,
"Magnet": 242,
"Mystic Water": 243,
"Sharp Beak": 244,
"Poison Barb": 245,
"NeverMeltIce": 246,
"Spell Tag": 247,
"TwistedSpoon": 248,
"Charcoal": 249,
"Dragon Fang": 250,
"Silk Scarf": 251,
"Up-Grade": 252,
"Shell Bell": 253,
"Sea Incense": 254,
"Lax Incense": 255,
"Lucky Punch": 256,
"Metal Powder": 257,
"Thick Club": 258,
"Stick": 259,
"Red Scarf": 260,
"Blue Scarf": 261,
"Pink Scarf": 262,
"Green Scarf": 263,
"Yellow Scarf": 264,
"Wide Lens": 265,
"Muscle Band": 266,
"Wise Glasses": 267,
"Expert Belt": 268,
"Light Clay": 269,
"Life Orb": 270,
"Power Herb": 271,
"Toxic Orb": 272,
"Flame Orb": 273,
"Quick Powder": 274,
"Focus Sash": 275,
"Zoom Lens": 276,
"Metronome": 277,
"Iron Ball": 278,
"Lagging Tail": 279,
"Destiny Knot": 280,
"Black Sludge": 281,
"Icy Rock": 282,
"Smooth Rock": 283,
"Heat Rock": 284,
"Damp Rock": 285,
"Grip Claw": 286,
"Choice Scarf": 287,
"Sticky Barb": 288,
"Power Bracer": 289,
"Power Belt": 290,
"Power Lens": 291,
"Power Band": 292,
"Power Anklet": 293,
"Power Weight": 294,
"Shed Shell": 295,
"Big Root": 296,
"Choice Specs": 297,
"Flame Plate": 298,
"Splash Plate": 299,
"Zap Plate": 300,
"Meadow Plate": 301,
"Icicle Plate": 302,
"Fist Plate": 303,
"Toxic Plate": 304,
"Earth Plate": 305,
"Sky Plate": 306,
"Mind Plate": 307,
"Insect Plate": 308,
"Stone Plate": 309,
"Spooky Plate": 310,
"Draco Plate": 311,
"Dread Plate": 312,
"Iron Plate": 313,
"Odd Incense": 314,
"Rock Incense": 315,
"Full Incense": 316,
"Wave Incense": 317,
"Rose Incense": 318,
"Luck Incense": 319,
"Pure Incense": 320,
"Protector": 321,
"Electirizer": 322,
"Magmarizer": 323,
"Dubious Disc": 324,
"Reaper Cloth": 325,
"Razor Claw": 326,
"Razor Fang": 327,
"TM01": 328,
"TM02": 329,
"TM03": 330,
"TM04": 331,
"TM05": 332,
"TM06": 333




}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"None": 0, "Stench": 1, "Drizzle": 2, "Speed Boost": 3, "Battle Armor": 4, "Sturdy": 5, "Damp": 6, "Limber": 7, "Sand Veil": 8, "Static": 9, "Volt Absorb": 10, "Water Absorb": 11, "Oblivious": 12, "Cloud Nine": 13, "Compound Eyes": 14, "Insomnia": 15, "Color Change": 16, "Immunity": 17, "Flash Fire": 18, "Shield Dust": 19, "Own Tempo": 20, "Suction Cups": 21, "Intimidate": 22, "Shadow Tag": 23, "Rough Skin": 24, "Wonder Guard": 25, "Levitate": 26, "Effect Spore": 27, "Synchronize": 28, "Clear Body": 29, "Natural Cure": 30, "Lightning Rod": 31, "Serene Grace": 32, "Swift Swim": 33, "Chlorophyll": 34, "Illuminate": 35, "Trace": 36, "Huge Power": 37, "Poison Point": 38, "Inner Focus": 39, "Magma Armor": 40, "Water Veil": 41, "Magnet Pull": 42, "Soundproof": 43, "Rain Dish": 44, "Sand Stream": 45, "Pressure": 46, "Thick Fat": 47, "Early Bird": 48, "Flame Body": 49, "Run Away": 50, "Keen Eye": 51, "Hyper Cutter": 52, "Pickup": 53, "Truant": 54, "Hustle": 55, "Cute Charm": 56, "Plus": 57, "Minus": 58, "Forecast": 59, "Sticky Hold": 60, "Shed Skin": 61, "Guts": 62, "Marvel Scale": 63, "Liquid Ooze": 64, "Overgrow": 65, "Blaze": 66, "Torrent": 67, "Swarm": 68, "Rock Head": 69, "Drought": 70, "Arena Trap": 71, "Vital Spirit": 72, "White Smoke": 73, "Pure Power": 74, "Shell Armor": 75, "Air Lock": 76, "Tangled Feet": 77, "Motor Drive": 78, "Rivalry": 79, "Steadfast": 80, "Snow Cloak": 81, "Gluttony": 82, "Anger Point": 83, "Unburden": 84, "Heatproof": 85, "Simple": 86, "Dry Skin": 87, "Download": 88, "Iron Fist": 89, "Poison Heal": 90, "Adaptability": 91, "Skill Link": 92, "Hydration": 93, "Solar Power": 94, "Quick Feet": 95, "Normalize": 96, "Sniper": 97, "Magic Guard": 98, "No Guard": 99, "Stall": 100, "Technician": 101, "Leaf Guard": 102, "Klutz": 103, "Mold Breaker": 104, "Super Luck": 105, "Aftermath": 106, "Anticipation": 107, "Forewarn": 108, "Unaware": 109, "Tinted Lens": 110, "Filter": 111, "Slow Start": 112, "Scrappy": 113, "Storm Drain": 114, "Ice Body": 115, "Solid Rock": 116, "Snow Warning": 117, "Honey Gather": 118, "Frisk": 119, "Reckless": 120, "Multitype": 121, "Flower Gift": 122, "Bad Dreams": 123, "Pickpocket": 124, "Sheer Force": 125, "Contrary": 126, "Unnerve": 127, "Defiant": 128, "Defeatist": 129, "Cursed Body": 130, "Healer": 131, "Friend Guard": 132, "Weak Armor": 133, "Heavy Metal": 134, "Light Metal": 135, "Multiscale": 136, "Toxic Boost": 137, "Flare Boost": 138, "Harvest": 139, "Telepathy": 140, "Moody": 141, "Overcoat": 142, "Poison Touch": 143, "Regenerator": 144, "Big Pecks": 145, "Sand Rush": 146, "Wonder Skin": 147, "Analytic": 148, "Illusion": 149, "Imposter": 150, "Infiltrator": 151, "Mummy": 152, "Moxie": 153, "Justified": 154, "Rattled": 155, "Magic Bounce": 156, "Sap Sipper": 157, "Prankster": 158, "Sand Force": 159, "Iron Barbs": 160, "Zen Mode": 161, "Victory Star": 162, "Turboblaze": 163}
{"None": 0, "Stench": 1, "Drizzle": 2, "Speed Boost": 3, "Battle Armor": 4, "Sturdy": 5, "Damp": 6, "Limber": 7, "Sand Veil": 8, "Static": 9, "Volt Absorb": 10, "Water Absorb": 11, "Oblivious": 12, "Cloud Nine": 13, "Compound Eyes": 14, "Insomnia": 15, "Color Change": 16, "Immunity": 17, "Flash Fire": 18, "Shield Dust": 19, "Own Tempo": 20, "Suction Cups": 21, "Intimidate": 22, "Shadow Tag": 23, "Rough Skin": 24, "Wonder Guard": 25, "Levitate": 26, "Effect Spore": 27, "Synchronize": 28, "Clear Body": 29, "Natural Cure": 30, "Lightning Rod": 31, "Serene Grace": 32, "Swift Swim": 33, "Chlorophyll": 34, "Illuminate": 35, "Trace": 36, "Huge Power": 37, "Poison Point": 38, "Inner Focus": 39, "Magma Armor": 40, "Water Veil": 41, "Magnet Pull": 42, "Soundproof": 43, "Rain Dish": 44, "Sand Stream": 45, "Pressure": 46, "Thick Fat": 47, "Early Bird": 48, "Flame Body": 49, "Run Away": 50, "Keen Eye": 51, "Hyper Cutter": 52, "Pickup": 53, "Truant": 54, "Hustle": 55, "Cute Charm": 56, "Plus": 57, "Minus": 58, "Forecast": 59, "Sticky Hold": 60, "Shed Skin": 61, "Guts": 62, "Marvel Scale": 63, "Liquid Ooze": 64, "Overgrow": 65, "Blaze": 66, "Torrent": 67, "Swarm": 68, "Rock Head": 69, "Drought": 70, "Arena Trap": 71, "Vital Spirit": 72, "White Smoke": 73, "Pure Power": 74, "Shell Armor": 75, "Air Lock": 76, "Tangled Feet": 77, "Motor Drive": 78, "Rivalry": 79, "Steadfast": 80, "Snow Cloak": 81, "Gluttony": 82, "Anger Point": 83, "Unburden": 84, "Heatproof": 85, "Simple": 86, "Dry Skin": 87, "Download": 88, "Iron Fist": 89, "Poison Heal": 90, "Adaptability": 91, "Skill Link": 92, "Hydration": 93, "Solar Power": 94, "Quick Feet": 95, "Normalize": 96, "Sniper": 97, "Magic Guard": 98, "No Guard": 99, "Stall": 100, "Technician": 101, "Leaf Guard": 102, "Klutz": 103, "Mold Breaker": 104, "Super Luck": 105, "Aftermath": 106, "Anticipation": 107, "Forewarn": 108, "Unaware": 109, "Tinted Lens": 110, "Filter": 111, "Slow Start": 112, "Scrappy": 113, "Storm Drain": 114, "Ice Body": 115, "Solid Rock": 116, "Snow Warning": 117, "Honey Gather": 118, "Frisk": 119, "Reckless": 120, "Multitype": 121, "Flower Gift": 122, "Bad Dreams": 123, "Pickpocket": 124, "Sheer Force": 125, "Contrary": 126, "Unnerve": 127, "Defiant": 128, "Defeatist": 129, "Cursed Body": 130, "Healer": 131, "Friend Guard": 132, "Weak Armor": 133, "Heavy Metal": 134, "Light Metal": 135, "Multiscale": 136, "Toxic Boost": 137, "Flare Boost": 138, "Harvest": 139, "Telepathy": 140, "Moody": 141, "Overcoat": 142, "Poison Touch": 143, "Regenerator": 144, "Big Pecks": 145, "Sand Rush": 146, "Wonder Skin": 147, "Analytic": 148, "Illusion": 149, "Imposter": 150, "Infiltrator": 151, "Mummy": 152, "Moxie": 153, "Justified": 154, "Rattled": 155, "Magic Bounce": 156, "Sap Sipper": 157, "Prankster": 158, "Sand Force": 159, "Iron Barbs": 160, "Zen Mode": 161, "Victory Star": 162, "Turboblaze": 163, "Teravolt": 164}
2 changes: 1 addition & 1 deletion server/pokepoll/support/cachedconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
MAX_ABILITY_DICT = {
3: 75,
4: 124,
5: 164,
5: 165,
6: 191,
7: 233,
8: 267,
Expand Down
Loading

0 comments on commit b5898d7

Please sign in to comment.