示例#1
0
def set_pi_registry_number(info, context):
    """A parliamentary_item's registry_number should be set on the item being 
    submitted to parliament.
    """
    instance = removeSecurityProxy(context)
    if instance.registry_number == None:
        dbutils.set_pi_registry_number(instance)
示例#2
0
def set_pi_registry_number(info, context):
    """A parliamentary_item's registry_number should be set on the item being 
    submitted to parliament.
    """
    instance = removeSecurityProxy(context)
    if instance.registry_number == None:
        dbutils.set_pi_registry_number(instance)
示例#3
0
def set_pi_registry_number(context):
    """A parliamentary_item's registry_number should be set on the item being 
    submitted to parliament.
    """
    mask = get_mask(context)
    if mask == "manual" or mask is None:
        return
    
    items = re.findall(r"\{(\w+)\}", mask)
    
    for name in items:
        if name == "registry_number":
            mask = mask.replace("{%s}" % name, str(dbutils.get_next_reg()))
            continue
        if name == "progressive_number":
            mask = mask.replace("{%s}" % name, 
                                         str(dbutils.get_next_prog(context)))
            continue
        value = getattr(context, name)
        mask = mask.replace("{%s}" % name, value)
    
    if context.registry_number == None:
        dbutils.set_pi_registry_number(context, mask)
示例#4
0
def set_pi_registry_number(context):
    """A parliamentary_item's registry_number should be set on the item being 
    submitted to parliament.
    """
    mask = get_mask(context)
    if mask == "manual" or mask is None:
        return

    items = re.findall(r"\{(\w+)\}", mask)

    for name in items:
        if name == "registry_number":
            mask = mask.replace("{%s}" % name, str(dbutils.get_next_reg()))
            continue
        if name == "progressive_number":
            mask = mask.replace("{%s}" % name,
                                str(dbutils.get_next_prog(context)))
            continue
        value = getattr(context, name)
        mask = mask.replace("{%s}" % name, value)

    if context.registry_number == None:
        dbutils.set_pi_registry_number(context, mask)
示例#5
0
def set_pi_registry_number(context):
    """A parliamentary_item's registry_number should be set on the item being 
    submitted to parliament.
    """
    if context.registry_number == None:
        dbutils.set_pi_registry_number(context)