cityofaustin / techstack

Project management for the City of Austin's new digital service delivery platform, Austin.gov.
11 stars 3 forks source link

We need revisions #4513

Closed Niicck closed 4 years ago

Niicck commented 4 years ago

For the sake of

Niicck commented 4 years ago

We have revisions.

Niicck commented 4 years ago

I manually ran this code in production to add revisions:

from django.shortcuts import get_object_or_404
from django.http.response import Http404
from wagtail.core.models import Page

import datetime
import pytz

UTC = pytz.timezone("UTC")
v2_data = [{'title': 'Get your bulk items collected', 'time': datetime.datetime(2020, 4, 27, 21, 31, 54, 512354, tzinfo=UTC)}, {'title': 'Get ready for curbside compost', 'time': datetime.datetime(2019, 9, 23, 21, 0, 30, 307068, tzinfo=UTC)}, {'title': 'Find free condoms and learn other ways to prevent HIV', 'time': datetime.datetime(2020, 1, 6, 22, 58, 18, 415735, tzinfo=UTC)}, {'title': 'Get immunizations for you and your family', 'time': datetime.datetime(2020, 1, 17, 21, 12, 40, 932337, tzinfo=UTC)}, {'title': 'Drop off household hazardous waste and other recyclables', 'time': datetime.datetime(2020, 4, 22, 17, 17, 37, 288093, tzinfo=UTC)}, {'title': 'Pick up free paint and other household items', 'time': datetime.datetime(2020, 4, 22, 16, 43, 47, 342520, tzinfo=UTC)}, {'title': 'Prepare for public health emergencies', 'time': datetime.datetime(2020, 1, 13, 18, 10, 7, 611284, tzinfo=UTC)}, {'title': 'Look up your trash, recycling, and compost pickup days', 'time': datetime.datetime(2020, 3, 2, 21, 21, 9, 162358, tzinfo=UTC)}, {'title': 'Set out your leaves, grass, and branches for pickup', 'time': datetime.datetime(2019, 5, 29, 15, 43, 46, 678884, tzinfo=UTC)}, {'title': 'How we store and use your data', 'time': datetime.datetime(2019, 12, 17, 18, 4, 46, 995585, tzinfo=UTC)}, {'title': 'Complaint investigation process', 'time': datetime.datetime(2019, 7, 23, 19, 54, 9, 110219, tzinfo=UTC)}, {'title': 'Crypto and other waterborne diseases', 'time': datetime.datetime(2020, 1, 7, 23, 52, 54, 601081, tzinfo=UTC)}, {'title': 'Flu prevention', 'time': datetime.datetime(2020, 1, 7, 23, 54, 36, 582345, tzinfo=UTC)}, {'title': 'Measles in Austin', 'time': datetime.datetime(2019, 10, 29, 17, 27, 18, 334986, tzinfo=UTC)}, {'title': 'Austin Resource Recovery', 'time': datetime.datetime(2019, 8, 19, 18, 52, 39, 662240, tzinfo=UTC)}, {'title': 'Privacy policy for Alpha.Austin.gov', 'time': datetime.datetime(2019, 9, 26, 14, 48, 58, 621044, tzinfo=UTC)}, {'title': 'Community Gardens ', 'time': datetime.datetime(2019, 7, 15, 17, 48, 59, 473110, tzinfo=UTC)}, {'title': 'Parks and Recreation ', 'time': datetime.datetime(2019, 7, 3, 12, 51, 8, 329201, tzinfo=UTC)}, {'title': 'Grow a Community Garden ', 'time': datetime.datetime(2019, 12, 10, 17, 26, 42, 290946, tzinfo=UTC)}, {'title': 'Health records and certificates', 'time': datetime.datetime(2019, 6, 24, 21, 36, 56, 969168, tzinfo=UTC)}, {'title': 'Birth and death certificates', 'time': datetime.datetime(2019, 10, 29, 8, 3, 9, 112779, tzinfo=UTC)}, {'title': 'Health and prevention', 'time': datetime.datetime(2020, 1, 15, 22, 33, 39, 918726, tzinfo=UTC)}, {'title': 'Disease prevention', 'time': datetime.datetime(2019, 12, 9, 16, 27, 39, 832237, tzinfo=UTC)}, {'title': 'Disaster and safety relief', 'time': datetime.datetime(2019, 6, 24, 21, 37, 18, 757882, tzinfo=UTC)}, {'title': 'Disaster preparedness', 'time': datetime.datetime(2019, 10, 29, 8, 5, 41, 572655, tzinfo=UTC)}, {'title': 'Recycling, trash, and compost', 'time': datetime.datetime(2019, 5, 29, 17, 44, 24, 467872, tzinfo=UTC)}, {'title': 'Household waste', 'time': datetime.datetime(2020, 2, 17, 20, 57, 11, 600429, tzinfo=UTC)}, {'title': 'Compost and food waste', 'time': datetime.datetime(2019, 10, 29, 7, 59, 43, 478698, tzinfo=UTC)}, {'title': 'Recycling and reuse', 'time': datetime.datetime(2019, 10, 29, 8, 1, 7, 975754, tzinfo=UTC)}, {'title': 'Get a mobile food vendor permit', 'time': datetime.datetime(2019, 5, 13, 18, 28, 18, 381302, tzinfo=UTC)}, {'title': 'Get a birth or death certificate', 'time': datetime.datetime(2020, 2, 26, 16, 41, 24, 971579, tzinfo=UTC)}, {'title': 'Chicken keeping ', 'time': datetime.datetime(2019, 7, 23, 19, 53, 58, 43916, tzinfo=UTC)}, {'title': 'Brownfields', 'time': datetime.datetime(2019, 6, 27, 17, 43, 31, 673209, tzinfo=UTC)}, {'title': 'Recycling Christmas trees', 'time': datetime.datetime(2019, 11, 25, 21, 38, 26, 643667, tzinfo=UTC)}, {'title': 'Street sweep ', 'time': datetime.datetime(2019, 7, 9, 15, 52, 14, 698694, tzinfo=UTC)}, {'title': 'Battery drop-off', 'time': datetime.datetime(2019, 10, 8, 19, 21, 6, 47364, tzinfo=UTC)}, {'title': 'Test your soil at the Soil Kitchen ', 'time': datetime.datetime(2019, 11, 15, 18, 7, 9, 301477, tzinfo=UTC)}, {'title': 'Pick up service page test (multiple options)', 'time': datetime.datetime(2019, 7, 10, 19, 33, 50, 906266, tzinfo=UTC)}, {'title': 'File a complaint about an Austin police officer', 'time': datetime.datetime(2020, 2, 10, 22, 43, 11, 346228, tzinfo=UTC)}, {'title': 'Get your home composting rebate ', 'time': datetime.datetime(2019, 10, 8, 18, 30, 22, 921016, tzinfo=UTC)}, {'title': 'Get your chicken keeping rebate ', 'time': datetime.datetime(2019, 7, 9, 20, 28, 57, 833624, tzinfo=UTC)}, {'title': 'Thank an Austin police officer', 'time': datetime.datetime(2020, 2, 10, 22, 43, 58, 513807, tzinfo=UTC)}, {'title': 'Get your zero waste rebate', 'time': datetime.datetime(2019, 7, 10, 17, 34, 27, 469950, tzinfo=UTC)}, {'title': 'Sustain your business', 'time': datetime.datetime(2019, 7, 6, 20, 59, 33, 869540, tzinfo=UTC)}, {'title': 'Request a composting class ', 'time': datetime.datetime(2019, 8, 24, 15, 7, 12, 914839, tzinfo=UTC)}, {'title': 'Reduce food waste at your business ', 'time': datetime.datetime(2019, 7, 10, 17, 4, 31, 299248, tzinfo=UTC)}, {'title': 'Police oversight', 'time': datetime.datetime(2019, 8, 6, 16, 20, 22, 456550, tzinfo=UTC)}, {'title': 'Police oversight and feedback', 'time': datetime.datetime(2020, 3, 5, 16, 54, 25, 401251, tzinfo=UTC)}, {'title': 'Plan your garden ', 'time': datetime.datetime(2019, 7, 26, 20, 32, 22, 858423, tzinfo=UTC)}, {'title': 'Real Estate Services ', 'time': datetime.datetime(2019, 8, 1, 15, 52, 56, 458505, tzinfo=UTC)}, {'title': 'Request a community garden license agreement ', 'time': datetime.datetime(2019, 9, 14, 16, 52, 56, 796090, tzinfo=UTC)}, {'title': 'Hire a day laborer', 'time': datetime.datetime(2020, 4, 22, 17, 20, 26, 521878, tzinfo=UTC)}, {'title': 'Find work as a day laborer', 'time': datetime.datetime(2020, 4, 22, 17, 20, 52, 622515, tzinfo=UTC)}, {'title': 'Austin Public Health', 'time': datetime.datetime(2019, 12, 18, 3, 0, 6, 24529, tzinfo=UTC)}, {'title': 'Mobile food vendor permit pre-application checklist', 'time': datetime.datetime(2019, 9, 26, 23, 51, 47, 62994, tzinfo=UTC)}, {'title': 'Mobile food vendor permit types and fees', 'time': datetime.datetime(2020, 3, 18, 16, 30, 4, 714367, tzinfo=UTC)}, {'title': 'Prepare your mobile food vendor permit application', 'time': datetime.datetime(2020, 3, 18, 15, 55, 59, 907304, tzinfo=UTC)}, {'title': 'Fire safety checklist for mobile food vendors', 'time': datetime.datetime(2020, 3, 18, 16, 6, 18, 699255, tzinfo=UTC)}, {'title': 'Find a new garden site checklist ', 'time': datetime.datetime(2019, 10, 9, 19, 39, 58, 468837, tzinfo=UTC)}, {'title': 'Official complaint and discipline documents', 'time': datetime.datetime(2020, 4, 30, 19, 50, 25, 827229, tzinfo=UTC)}, {'title': 'Community garden permitting guide ', 'time': datetime.datetime(2019, 10, 9, 18, 48, 21, 829117, tzinfo=UTC)}, {'title': 'Apply for a mobile food vendor operational permit', 'time': datetime.datetime(2020, 3, 18, 15, 56, 18, 553174, tzinfo=UTC)}, {'title': 'Bring your mobile food unit to your inspection appointment', 'time': datetime.datetime(2020, 3, 18, 16, 7, 34, 938155, tzinfo=UTC)}, {'title': 'Get a central preparation facility', 'time': datetime.datetime(2020, 3, 9, 21, 16, 5, 227871, tzinfo=UTC)}, {'title': 'Get food handler training and a food manager certificate', 'time': datetime.datetime(2020, 3, 18, 15, 47, 8, 561651, tzinfo=UTC)}, {'title': 'Keep your permit valid', 'time': datetime.datetime(2019, 9, 27, 0, 11, 14, 527831, tzinfo=UTC)}, {'title': 'Renew your mobile food vendor permit', 'time': datetime.datetime(2020, 3, 18, 16, 24, 19, 964816, tzinfo=UTC)}, {'title': 'Requirements to safely operate your mobile food business', 'time': datetime.datetime(2020, 3, 18, 16, 7, 56, 472086, tzinfo=UTC)}, {'title': 'Mobile food vendor permit guide', 'time': datetime.datetime(2020, 3, 18, 15, 36, 26, 779558, tzinfo=UTC)}, {'title': 'Is your garden eligible? ', 'time': datetime.datetime(2019, 9, 15, 16, 3, 27, 792764, tzinfo=UTC)}, {'title': 'Site plan ', 'time': datetime.datetime(2019, 9, 15, 17, 46, 30, 524986, tzinfo=UTC)}, {'title': 'Fund your neighborhood project ', 'time': datetime.datetime(2019, 9, 15, 21, 53, 33, 570894, tzinfo=UTC)}, {'title': 'Design Guidelines checklist', 'time': datetime.datetime(2019, 10, 7, 17, 56, 58, 761358, tzinfo=UTC)}, {'title': 'Get a water tap ', 'time': datetime.datetime(2019, 9, 16, 2, 4, 54, 180716, tzinfo=UTC)}, {'title': 'Community garden permit checklist ', 'time': datetime.datetime(2019, 9, 15, 23, 2, 12, 875428, tzinfo=UTC)}, {'title': "Track your garden permit's approval process", 'time': datetime.datetime(2019, 9, 15, 23, 52, 39, 102165, tzinfo=UTC)}, {'title': 'Mobile food vendor pre-application checklist', 'time': datetime.datetime(2020, 3, 18, 15, 55, 38, 369605, tzinfo=UTC)}, {'title': 'Basic services at neighborhood centers', 'time': datetime.datetime(2020, 3, 3, 20, 57, 46, 212310, tzinfo=UTC)}, {'title': 'Help with child care expenses', 'time': datetime.datetime(2020, 1, 2, 18, 16, 15, 714150, tzinfo=UTC)}, {'title': 'Chronic disease prevention', 'time': datetime.datetime(2019, 10, 17, 17, 45, 58, 595419, tzinfo=UTC)}, {'title': ' Free health services at neighborhood centers', 'time': datetime.datetime(2020, 3, 3, 20, 59, 17, 640533, tzinfo=UTC)}, {'title': 'Get free help to quit tobacco', 'time': datetime.datetime(2019, 12, 4, 21, 0, 15, 473950, tzinfo=UTC)}, {'title': 'Get a copy of your immunization record', 'time': datetime.datetime(2020, 3, 16, 19, 42, 35, 226049, tzinfo=UTC)}, {'title': 'Rent and utility payment help at neighborhood centers', 'time': datetime.datetime(2020, 3, 3, 20, 59, 5, 103629, tzinfo=UTC)}, {'title': 'Get tested for sexually transmitted infections ', 'time': datetime.datetime(2019, 10, 7, 14, 43, 51, 523823, tzinfo=UTC)}, {'title': 'WIC benefits', 'time': datetime.datetime(2019, 11, 25, 22, 16, 19, 303596, tzinfo=UTC)}, {'title': 'Take a tuberculosis (TB) test', 'time': datetime.datetime(2019, 10, 9, 19, 18, 49, 641205, tzinfo=UTC)}, {'title': 'Graffiti Removal', 'time': datetime.datetime(2019, 10, 7, 14, 46, 38, 201278, tzinfo=UTC)}, {'title': 'Help prevent diabetes in your community', 'time': datetime.datetime(2020, 4, 22, 19, 50, 4, 419982, tzinfo=UTC)}, {'title': ' Injury prevention', 'time': datetime.datetime(2019, 10, 3, 21, 57, 18, 502956, tzinfo=UTC)}, {'title': 'Job search help at neighborhood centers', 'time': datetime.datetime(2020, 3, 3, 20, 59, 35, 95235, tzinfo=UTC)}, {'title': 'Plan a smoke-free event', 'time': datetime.datetime(2020, 1, 2, 18, 33, 52, 200828, tzinfo=UTC)}, {'title': 'Smoking in public places', 'time': datetime.datetime(2020, 2, 12, 16, 59, 31, 648353, tzinfo=UTC)}, {'title': 'Participate in research with the City of Austin', 'time': datetime.datetime(2020, 4, 9, 15, 50, 43, 825492, tzinfo=UTC)}, {'title': 'Community support for a community garden', 'time': datetime.datetime(2019, 10, 16, 16, 45, 0, 991806, tzinfo=UTC)}, {'title': 'Business resources', 'time': datetime.datetime(2019, 10, 25, 21, 26, 17, 452385, tzinfo=UTC)}, {'title': 'Financial resources', 'time': datetime.datetime(2019, 12, 11, 19, 54, 37, 335637, tzinfo=UTC)}, {'title': 'test', 'time': datetime.datetime(2019, 10, 29, 18, 51, 7, 809435, tzinfo=UTC)}, {'title': 'Considerations when starting a community garden', 'time': datetime.datetime(2019, 10, 30, 2, 37, 37, 715592, tzinfo=UTC)}, {'title': 'Kids and family resources', 'time': datetime.datetime(2020, 1, 17, 22, 35, 36, 994790, tzinfo=UTC)}, {'title': 'Report changes to your mobile food business', 'time': datetime.datetime(2020, 3, 18, 15, 35, 16, 684484, tzinfo=UTC)}, {'title': 'Documents for mobile food vendors in Austin', 'time': datetime.datetime(2020, 3, 18, 15, 36, 56, 498619, tzinfo=UTC)}, {'title': 'WIC  benefits', 'time': datetime.datetime(2019, 11, 22, 18, 10, 9, 73224, tzinfo=UTC)}, {'title': 'Request a day laborer', 'time': datetime.datetime(2019, 11, 22, 14, 5, 30, 438168, tzinfo=UTC)}, {'title': 'test map padding', 'time': datetime.datetime(2019, 11, 6, 18, 52, 25, 863282, tzinfo=UTC)}, {'title': 'Know your rights when interacting with the police', 'time': datetime.datetime(2020, 4, 10, 20, 51, 23, 604222, tzinfo=UTC)}, {'title': 'Help finding work', 'time': datetime.datetime(2020, 1, 17, 22, 36, 21, 751983, tzinfo=UTC)}, {'title': 'Job resources', 'time': datetime.datetime(2019, 12, 11, 19, 56, 38, 823869, tzinfo=UTC)}, {'title': 'Health classes and resources', 'time': datetime.datetime(2019, 11, 25, 15, 42, 5, 673495, tzinfo=UTC)}, {'title': 'Workforce development and hiring', 'time': datetime.datetime(2019, 12, 9, 19, 34, 42, 867974, tzinfo=UTC)}, {'title': 'Business resources', 'time': datetime.datetime(2019, 12, 11, 19, 55, 30, 66311, tzinfo=UTC)}, {'title': 'Recycle your Christmas tree ', 'time': datetime.datetime(2019, 12, 2, 21, 19, 32, 892298, tzinfo=UTC)}, {'title': 'Municipal Court', 'time': datetime.datetime(2019, 12, 21, 14, 9, 20, 270293, tzinfo=UTC)}, {'title': 'Breastfeeding support', 'time': datetime.datetime(2020, 1, 8, 0, 2, 1, 852039, tzinfo=UTC)}, {'title': 'Community youth development in Dove Springs', 'time': datetime.datetime(2020, 1, 8, 0, 12, 39, 314085, tzinfo=UTC)}, {'title': 'Help prevent diabetes in your community', 'time': datetime.datetime(2019, 12, 9, 19, 33, 6, 523008, tzinfo=UTC)}, {'title': 'Funding, grants, and rebates', 'time': datetime.datetime(2019, 12, 10, 17, 7, 56, 37543, tzinfo=UTC)}, {'title': 'Opportunities for teens', 'time': datetime.datetime(2019, 12, 12, 17, 5, 58, 815455, tzinfo=UTC)}, {'title': 'Pay utility bills and rent', 'time': datetime.datetime(2020, 2, 24, 22, 11, 21, 596667, tzinfo=UTC)}, {'title': 'Get help paying bills', 'time': datetime.datetime(2020, 3, 9, 22, 5, 10, 972008, tzinfo=UTC)}, {'title': 'Serve on the Community Police Review Commission', 'time': datetime.datetime(2020, 4, 10, 21, 6, 8, 23086, tzinfo=UTC)}, {'title': 'Community Police Review Commission', 'time': datetime.datetime(2020, 1, 16, 23, 9, 41, 964020, tzinfo=UTC)}, {'title': 'Police oversight reports and recommendations', 'time': datetime.datetime(2020, 4, 30, 18, 41, 20, 192068, tzinfo=UTC)}, {'title': 'test', 'time': datetime.datetime(2019, 12, 19, 17, 30, 0, 283559, tzinfo=UTC)}, {'title': 'Businesses required to get a mobile food vendor permit', 'time': datetime.datetime(2020, 3, 18, 15, 46, 12, 387567, tzinfo=UTC)}, {'title': 'Business permits and licenses', 'time': datetime.datetime(2019, 12, 31, 2, 44, 44, 138519, tzinfo=UTC)}, {'title': 'Food business permits', 'time': datetime.datetime(2019, 12, 31, 2, 51, 44, 861422, tzinfo=UTC)}, {'title': 'Attend a fall prevention class', 'time': datetime.datetime(2020, 1, 6, 21, 46, 8, 424355, tzinfo=UTC)}, {'title': 'Apply to serve on the Community Police Review Commission', 'time': datetime.datetime(2020, 2, 28, 20, 31, 27, 432069, tzinfo=UTC)}, {'title': 'Recycle & Reuse Drop-off Center', 'time': datetime.datetime(2020, 2, 28, 17, 52, 30, 574002, tzinfo=UTC)}, {'title': 'Office of Vital Records', 'time': datetime.datetime(2020, 3, 16, 19, 20, 40, 238841, tzinfo=UTC)}, {'title': 'Far South Austin Clinic', 'time': datetime.datetime(2020, 3, 16, 19, 58, 10, 357957, tzinfo=UTC)}, {'title': 'St. John Community Center', 'time': datetime.datetime(2020, 3, 16, 19, 4, 58, 926203, tzinfo=UTC)}, {'title': "Mom's Place Lactation Support Center", 'time': datetime.datetime(2020, 2, 28, 21, 27, 32, 353852, tzinfo=UTC)}, {'title': 'Get free HIV testing', 'time': datetime.datetime(2020, 1, 15, 22, 26, 20, 876702, tzinfo=UTC)}, {'title': 'Rebekah Baines Johnson (RBJ) Health Center', 'time': datetime.datetime(2020, 3, 16, 19, 32, 3, 430442, tzinfo=UTC)}, {'title': 'Report smoking or vaping in a public place', 'time': datetime.datetime(2020, 2, 28, 21, 10, 51, 771112, tzinfo=UTC)}, {'title': 'Report smoking or vaping in a public place', 'time': datetime.datetime(2020, 3, 5, 15, 56, 0, 612396, tzinfo=UTC)}, {'title': 'Get breastfeeding support', 'time': datetime.datetime(2020, 2, 25, 0, 24, 37, 417274, tzinfo=UTC)}, {'title': 'Documents for the pool permitting process', 'time': datetime.datetime(2020, 1, 27, 21, 36, 50, 278247, tzinfo=UTC)}, {'title': 'Pool permit types and fees', 'time': datetime.datetime(2020, 1, 28, 16, 30, 20, 296398, tzinfo=UTC)}, {'title': 'Helpful services and tools for getting your pool permitted', 'time': datetime.datetime(2020, 2, 24, 20, 5, 54, 136797, tzinfo=UTC)}, {'title': 'Find your pool, spa, PIWFF or fountain’s jurisdiction', 'time': datetime.datetime(2020, 1, 21, 17, 37, 57, 598193, tzinfo=UTC)}, {'title': 'Main Courthouse, Austin Municipal Court', 'time': datetime.datetime(2020, 3, 16, 19, 31, 31, 813260, tzinfo=UTC)}, {'title': 'What to expect if your pool receives violations', 'time': datetime.datetime(2020, 2, 24, 20, 7, 55, 355415, tzinfo=UTC)}, {'title': 'Get a refund for your pool, spa, and PIWFF permitting fees', 'time': datetime.datetime(2020, 1, 21, 18, 51, 16, 791238, tzinfo=UTC)}, {'title': 'Jaime Padron Substation, Austin Municipal Court', 'time': datetime.datetime(2020, 3, 16, 19, 30, 12, 885, tzinfo=UTC)}, {'title': 'Pre-plan review checklist for new or remodeled pools, spas, and PIWFFs', 'time': datetime.datetime(2020, 3, 20, 19, 4, 5, 687244, tzinfo=UTC)}, {'title': 'Submit a plan review application for your new or remodeled pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 1, 27, 21, 40, 8, 164339, tzinfo=UTC)}, {'title': 'Get your pool plans reviewed by the Watershed, Development Services and Fire departments', 'time': datetime.datetime(2020, 1, 28, 17, 5, 4, 592160, tzinfo=UTC)}, {'title': 'Prepare operational permit application materials for your pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 1, 23, 17, 48, 23, 253503, tzinfo=UTC)}, {'title': 'Prepare for a certificate of occupancy inspection for your pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 1, 22, 21, 20, 43, 50685, tzinfo=UTC)}, {'title': 'Submit your operational permit and certificate of occupancy inspection applications for your pool', 'time': datetime.datetime(2020, 3, 20, 19, 8, 28, 279171, tzinfo=UTC)}, {'title': 'Schedule a pre-opening certificate of occupancy inspection for your pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 1, 22, 17, 32, 29, 76479, tzinfo=UTC)}, {'title': 'Requirements to safely operate your pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 1, 21, 17, 47, 28, 99101, tzinfo=UTC)}, {'title': 'Renew your pool, spa, public interactive water feature or fountain’s operational permit', 'time': datetime.datetime(2020, 4, 30, 6, 23, 23, 621133, tzinfo=UTC)}, {'title': 'Report changes to pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 4, 30, 22, 47, 44, 361849, tzinfo=UTC)}, {'title': 'Apply for a change of ownership inspection for your pool, spa, public interactive water feature or fountain', 'time': datetime.datetime(2020, 2, 24, 21, 23, 4, 311290, tzinfo=UTC)}, {'title': 'Pools, spas, public interactive water features and ', 'time': datetime.datetime(2020, 1, 22, 18, 13, 52, 888016, tzinfo=UTC)}, {'title': 'Request judicial records', 'time': datetime.datetime(2020, 2, 17, 19, 51, 32, 984846, tzinfo=UTC)}, {'title': 'Request judicial information', 'time': datetime.datetime(2020, 2, 20, 17, 8, 41, 764567, tzinfo=UTC)}, {'title': 'Create an event in production', 'time': datetime.datetime(2020, 1, 31, 23, 10, 2, 983303, tzinfo=UTC)}, {'title': 'East Austin Neighborhood Center', 'time': datetime.datetime(2020, 4, 30, 20, 13, 33, 402085, tzinfo=UTC)}, {'title': 'Montopolis Neighborhood Center', 'time': datetime.datetime(2020, 3, 6, 20, 56, 0, 841932, tzinfo=UTC)}, {'title': 'Blackland Neighborhood Center', 'time': datetime.datetime(2020, 3, 6, 20, 2, 45, 952742, tzinfo=UTC)}, {'title': 'Rosewood-Zaragosa Neighborhood Center', 'time': datetime.datetime(2020, 3, 12, 14, 36, 33, 226611, tzinfo=UTC)}, {'title': 'South Austin Neighborhood Center', 'time': datetime.datetime(2020, 3, 16, 15, 38, 17, 711200, tzinfo=UTC)}, {'title': 'First Workers Day Labor Center', 'time': datetime.datetime(2020, 3, 16, 19, 58, 57, 324320, tzinfo=UTC)}, {'title': 'Environmental Health Services Division', 'time': datetime.datetime(2020, 3, 16, 14, 36, 12, 160012, tzinfo=UTC)}, {'title': 'Get help with rent and utility payments', 'time': datetime.datetime(2020, 2, 13, 21, 54, 24, 755719, tzinfo=UTC)}, {'title': 'Population history', 'time': datetime.datetime(2020, 2, 15, 6, 40, 21, 479168, tzinfo=UTC)}, {'title': 'Testing', 'time': datetime.datetime(2020, 2, 18, 18, 53, 13, 20135, tzinfo=UTC)}, {'title': 'Court records and documents', 'time': datetime.datetime(2020, 2, 20, 16, 59, 17, 991533, tzinfo=UTC)}, {'title': 'Records and documents', 'time': datetime.datetime(2020, 2, 20, 17, 1, 40, 771115, tzinfo=UTC)}, {'title': 'Rules of municipal court', 'time': datetime.datetime(2020, 4, 30, 15, 26, 57, 197295, tzinfo=UTC)}, {'title': 'Downtown Austin Community Court', 'time': datetime.datetime(2020, 4, 16, 14, 22, 1, 33725, tzinfo=UTC)}, {'title': 'File a citizen complaint', 'time': datetime.datetime(2020, 2, 28, 20, 10, 38, 528476, tzinfo=UTC)}, {'title': 'Policing in Austin', 'time': datetime.datetime(2020, 3, 5, 16, 50, 36, 984274, tzinfo=UTC)}, {'title': 'Handle a parking ticket', 'time': datetime.datetime(2020, 3, 5, 16, 3, 25, 436014, tzinfo=UTC)}, {'title': 'Get basic services at neighborhood centers', 'time': datetime.datetime(2020, 3, 20, 16, 33, 5, 518433, tzinfo=UTC)}, {'title': 'Community Police Review Commission', 'time': datetime.datetime(2020, 4, 8, 4, 28, 36, 503916, tzinfo=UTC)}, {'title': 'About the Community Police Review Commission', 'time': datetime.datetime(2020, 4, 9, 15, 8, 15, 22224, tzinfo=UTC)}, {'title': 'Test out how to use a service page', 'time': datetime.datetime(2020, 4, 15, 18, 41, 12, 218887, tzinfo=UTC)}, {'title': 'Basic traffic deferral', 'time': datetime.datetime(2020, 4, 19, 21, 43, 17, 387797, tzinfo=UTC)}, {'title': 'Request an online municipal court hearing', 'time': datetime.datetime(2020, 4, 21, 14, 37, 44, 532748, tzinfo=UTC)}, {'title': 'Waive your right to a jury trial', 'time': datetime.datetime(2020, 4, 21, 21, 25, 15, 118535, tzinfo=UTC)}, {'title': 'Carver Branch Library', 'time': datetime.datetime(2020, 4, 22, 19, 43, 43, 853987, tzinfo=UTC)}, {'title': 'Online information session test', 'time': datetime.datetime(2020, 4, 29, 20, 27, 39, 21889, tzinfo=UTC)}, {'title': 'APH online clinic test', 'time': datetime.datetime(2020, 4, 29, 20, 31, 5, 733985, tzinfo=UTC)}, {'title': 'Water safety deferral form', 'time': datetime.datetime(2020, 4, 30, 14, 28, 10, 406221, tzinfo=UTC)}, {'title': 'Bicycle deferral form', 'time': datetime.datetime(2020, 4, 30, 14, 29, 53, 924649, tzinfo=UTC)}, {'title': 'Parking in a disabled space deferral form', 'time': datetime.datetime(2020, 4, 30, 14, 32, 0, 558496, tzinfo=UTC)}, {'title': 'Driving while using an electronic device deferral form', 'time': datetime.datetime(2020, 4, 30, 14, 33, 55, 498321, tzinfo=UTC)}, {'title': 'Driving without insurance deferral form', 'time': datetime.datetime(2020, 4, 30, 14, 35, 11, 361174, tzinfo=UTC)}, {'title': 'Misdemeanor deferral form', 'time': datetime.datetime(2020, 4, 30, 15, 19, 38, 37687, tzinfo=UTC)}, {'title': 'Misdemeanor domestic violence deferral form', 'time': datetime.datetime(2020, 4, 30, 15, 22, 27, 723047, tzinfo=UTC)}]

for v2 in v2_data:
    try:
        page = get_object_or_404(Page, title=v2["title"])
        if page and not page.get_latest_revision():
            page = page.specific
            page.save_revision()
            page.latest_revision_created_at = v2["time"]
            page.save(update_fields=['latest_revision_created_at'])
            print(f"### [{page.id}] updated just fine.")
    except Http404:
        print(f"## [{v2['title']}] does not exist here")
    except Page.MultipleObjectsReturned:
        print(f"# [{v2['title']}] has duplicates, do them manually")
    except Exception as error:
        print("hi")
        raise
Niicck commented 4 years ago

v2_data was extracted from our archival "joplin-pr-v2" instance.

Niicck commented 4 years ago

About 15 pages had to be updated manually without this script, due to duplicate titles or titles being changed since v2.

Niicck commented 4 years ago

It's good now.