Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • A Auction
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 14
    • Issues 14
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 5
    • Merge requests 5
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • prozorro-sale
  • Auction
  • Wiki
  • Auction Rules

Last edited by dmitry.mashoshin Mar 18, 2021
Page history

Auction Rules

Auction Rules

Rules is very important part of every auction.

Rules declared inside Auction class and play "role" of encapsulation of some business data from users. More about existing schematics base roles you may find here

Auction roles in must cases uses in bundle with AuctionStatusRole that allow to apply roles for specific states of auction. [example]

To implement custom role you must create role class and extends from schematics.role and implement init method with pass body, and __call__ method with conditions to describe or not to describe data.

class MyCustomRole(schematics.role):

    def __init__(self, *args, **kwargs):
        pass
    
    def __call__(self, name, value, context):
        if name == 'name_of_value_to_hide':
            return
        return value

name - name of the field.

value - value that contains in the object by key name.

context - auction contains that defined inside Auction class and contains data of auction that will helm in some business logic. To add some custom context - you should to redifine to_primitive method of auction [example]

Examples of implementation of custom roles

Clone repository
  • Auction Feed
  • Auction Room
  • Auction Rules
  • Auction Specs
  • Auction States
  • Dutch Auction
  • English Auction
  • Green Auction
  • How to add new Auction?
  • Makefile
  • MultiAwards Auction
  • MultiAwards desc Auction
  • PriorityEnglish Auction
  • Home