File diff dfcd2acc7466 → 539fa2dfdd2b
pinaxcon/registrasion/management/commands/populate_inventory.py
Show inline comments
...
 
@@ -52,25 +52,25 @@ class Command(BaseCommand):
 
            name="Pre-purchase",
 
        )
 

	
 
    def populate_inventory(self):
 
        # Categories
 

	
 
        self.ticket = self.find_or_make(
 
            inv.Category,
 
            ("name",),
 
            name="Ticket",
 
            description="Each type of ticket has different included products. "
 
                        "For details of what products are included, see our "
 
                        "<a href='https://linux.conf.au/attend/tickets/'>registration page</a>",
 
                        "<a href='https://linux.conf.au/attend/tickets/'>registration page</a>.",
 
            required=True,
 
            render_type=inv.Category.RENDER_TYPE_RADIO,
 
            limit_per_user=1,
 
            order=1,
 
        )
 
        self.terms = self.find_or_make(
 
            inv.Category,
 
            ("name",),
 
            name="Terms, Conditions, and Code of Conduct Acceptance",
 
            description="I agree to the "
 
                        "<a href=\"https://linux.conf.au/attend/terms-and-conditions\"> "
 
                        "terms and conditions of attendance</a>, and I have read, "
...
 
@@ -92,54 +92,53 @@ class Command(BaseCommand):
 
                        "included in your conference ticket price.",
 
            required=False,
 
            render_type=inv.Category.RENDER_TYPE_QUANTITY,
 
            limit_per_user=10,
 
            order=20,
 
        )
 
        self.speakers_dinner_ticket = self.find_or_make(
 
            inv.Category,
 
            ("name",),
 
            name="Speakers' Dinner Ticket",
 
            description="Tickets to our exclusive Speakers' Dinner on the "
 
                        "evening of "
 
                        f"{settings.SPEAKER_DINNER_TICKET_DATE: %A %d %B}. "
 
                        "You may purchase up "
 
                        "to 5 tickets in total, for significant others and "
 
                        "family members.",
 
                        f"{settings.SPEAKER_DINNER_TICKET_DATE: %A %d %B}.",
 
            required=False,
 
            render_type=inv.Category.RENDER_TYPE_QUANTITY,
 
            limit_per_user=5,
 
            limit_per_user=1,
 
            order=30,
 
        )
 
        self.pdns_category = self.find_or_make(
 
            inv.Category,
 
            ("name",),
 
            name="Professional Delegates Networking Session Ticket",
 
            description="Tickets to our Professional Delegates Networking session. "
 
                        "This event will be held on the evening of "
 
                        f"{settings.PDNS_TICKET_DATE: %A %d %B} "
 
                        "and is restricted to Professional Ticket "
 
                        "holders, speakers, miniconf organisers, and invited "
 
                        "guests.",
 
            required=False,
 
            render_type=inv.Category.RENDER_TYPE_RADIO,
 
            limit_per_user=1,
 
            order=40,
 
        )
 
        self.t_shirt = self.find_or_make(
 
            inv.Category,
 
            ("name",),
 
            name="Shirt",
 
            description="Commemorative conference polo shirts, featuring the "
 
                        f"linux.conf.au {settings.LCA_START.year} artwork.",
 
            description="Commemorative conference shirts, featuring the "
 
                        f"linux.conf.au {settings.LCA_START.year} artwork. "
 
                        "View the <a href=\"https://linux.conf.au/attend/shirts\">"
 
                        "sizing guide</a>.",
 
            required=False,
 
            render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY,
 
            order=50,
 
        )
 
        # self.accommodation = self.find_or_make(
 
        #     inv.Category,
 
        #     ("name",),
 
        #     name="Accommodation at University of Tasmania",
 
        #     description="Accommodation at the University of Tasmania colleges "
 
        #                 "and apartments. You can come back and book your "
 
        #                 "accommodation at a later date, provided rooms remain "
 
        #                 "available. Rooms may only be booked from Sunday 15 "
...
 
@@ -346,31 +345,35 @@ class Command(BaseCommand):
 
            ("name", "category",),
 
            category=self.extras,
 
            name="Offset the carbon pollution generated by your attendance, "
 
                 "thanks to fifteen trees.",
 
            price=Decimal("5.00"),
 
            reservation_duration=hours(1),
 
            order=10,
 
        )
 

	
 
        # Shirts
 
        ShirtGroup = namedtuple("ShirtGroup", ("prefix", "sizes"))
 
        shirt_names = {
 
            "mens": ShirtGroup(
 
                "Men's/Straight Cut",
 
                ("S", "M", "L", "XL", "2XL", "3XL", "4XL"),
 
            "straight": ShirtGroup(
 
                "Straight Cut",
 
                ("S", "M", "L", "XL", "2XL", "3XL", "4XL", "5XL"),
 
            ),
 
            "semi_fitted": ShirtGroup(
 
                "Semi-Fitted",
 
                ("XS", "S", "M", "L", "XL", "2XL"),
 
            ),
 
            "womens": ShirtGroup(
 
                "Women's Classic Fit",
 
                ("8", "10", "12", "14", "16", "18"),
 
            "fitted": ShirtGroup(
 
                "Fitted",
 
                ("XS", "S", "M", "L", "XL", "2XL"),
 
            ),
 
        }
 

	
 
        self.shirts = {}
 
        order = 0
 
        for name, group in shirt_names.items():
 
            self.shirts[name] = {}
 
            prefix = group.prefix
 
            for size in group.sizes:
 
                product_name = "%s %s" % (prefix, size)
 
                order += 10
 
                self.shirts[name][size] = self.find_or_make(
...
 
@@ -454,25 +457,25 @@ class Command(BaseCommand):
 
            ("description", ),
 
            description="Reserved for sponsors",
 
            condition=cond.FlagBase.DISABLE_IF_FALSE,
 
            limit=70,
 
        )
 
        sponsor_ticket_cap.products.set([
 
            self.ticket_sponsor,
 
        ])
 

	
 
        volunteer_ticket_cap = self.find_or_make(
 
            cond.TimeOrStockLimitFlag,
 
            ("description", ),
 
            description="Reserrved for volunteers and organizers",
 
            description="Reserved for volunteers and organisers",
 
            condition=cond.FlagBase.DISABLE_IF_FALSE,
 
            limit=62,
 
        )
 
        volunteer_ticket_cap.products.set([
 
            self.ticket_team,
 
            self.ticket_volunteer,
 
        ])
 

	
 
        media_ticket_cap = self.find_or_make(
 
            cond.TimeOrStockLimitFlag,
 
            ("description", ),
 
            description="Reserved for media",
...
 
@@ -554,32 +557,32 @@ class Command(BaseCommand):
 
        # Speaker tickets are for primary speakers only
 
        speaker_tickets = self.find_or_make(
 
            cond.SpeakerFlag,
 
            ("description", ),
 
            description="Speaker tickets",
 
            condition=cond.FlagBase.ENABLE_IF_TRUE,
 
            is_presenter=True,
 
            is_copresenter=False,
 
        )
 
        speaker_tickets.proposal_kind.set(self.main_conference_proposals)
 
        speaker_tickets.products.set([self.ticket_speaker, ])
 

	
 
        # Speaker dinner tickets are for primary and secondary speakers
 
        # Speaker dinner tickets are for primary speakers only
 
        speaker_dinner_tickets = self.find_or_make(
 
            cond.SpeakerFlag,
 
            ("description", ),
 
            description="Speaker dinner tickets",
 
            condition=cond.FlagBase.ENABLE_IF_TRUE,
 
            is_presenter=True,
 
            is_copresenter=True,
 
            is_copresenter=False,
 
        )
 
        speaker_dinner_tickets.proposal_kind.set(self.main_conference_proposals)
 
        speaker_dinner_tickets.categories.set([self.speakers_dinner_ticket, ])
 

	
 
        # PDNS tickets are complicated.
 
        # They can be enabled by tickets
 
        pdns_by_ticket = self.find_or_make(
 
            cond.ProductFlag,
 
            ("description", ),
 
            description="PDNS available by ticket",
 
            condition=cond.FlagBase.ENABLE_IF_TRUE,
 
        )
...
 
@@ -758,25 +761,25 @@ class Command(BaseCommand):
 
            ("description", ),
 
            description="Complimentary for ticket holder (Student-level)",
 
        )
 
        ticket_student_inclusions.enabling_products.set([
 
            self.ticket_student,
 
        ])
 
        free_category(ticket_student_inclusions, self.t_shirt)
 

	
 
        # Team ticket inclusions
 
        ticket_staff_inclusions = self.find_or_make(
 
            cond.IncludedProductDiscount,
 
            ("description", ),
 
            description="Complimentary for ticket holder staff)",
 
            description="Complimentary for ticket holder (Staff)",
 
        )
 
        ticket_staff_inclusions.enabling_products.set([
 
            self.ticket_team,
 
        ])
 
        free_category(ticket_staff_inclusions, self.penguin_dinner)
 

	
 
        # Team & volunteer shirts, regardless of ticket type
 
        staff_t_shirts = self.find_or_make(
 
            cond.GroupMemberDiscount,
 
            ("description", ),
 
            description="Shirts complimentary for staff and volunteers",
 
        )