예제 #1
0
def create_ruleset(ruleset_id, version, title, tooltip, desc, author,
                   author_url, date, editor):

    # ignore test ruleset
    if ruleset_id.lower().find('test') > -1:
        return False

    try:
        ruleset = Ruleset.objects.get(ruleset_id=ruleset_id)
        print("  Updating Ruleset: " + ruleset_id)
        ruleset.version = version
        ruleset.title = title
        ruleset.tooltip = tooltip
        ruleset.description = desc
        ruleset.author = author
        ruleset.author_url = author_url
        ruleset.updated_date = date
        ruleset.updated_editor = editor
    except ObjectDoesNotExist:
        print("  Creating Ruleset: " + title)
        ruleset = Ruleset(ruleset_id=ruleset_id,
                          version=version,
                          title=title,
                          tooltip=tooltip,
                          description=desc,
                          author=author,
                          author_url=author_url,
                          updated_date=date)
    ruleset.save()
    return ruleset
예제 #2
0
def create_ruleset(ruleset_id, version, title, tooltip, desc, author, author_url, date, editor):

  # ignore test ruleset
  if ruleset_id.lower().find('test') > -1:
    return False

  try:
    ruleset = Ruleset.objects.get(ruleset_id=ruleset_id)
    print("  Updating Ruleset: " + ruleset_id)
    ruleset.version        = version
    ruleset.title          = title
    ruleset.tooltip        = tooltip
    ruleset.description    = desc
    ruleset.author         = author
    ruleset.author_url     = author_url
    ruleset.updated_date   = date
    ruleset.updated_editor = editor
  except ObjectDoesNotExist:
    print("  Creating Ruleset: " + title )
    ruleset = Ruleset(ruleset_id=ruleset_id, version=version, title=title, tooltip=tooltip, description=desc, author=author, author_url=author_url, updated_date=date)
  ruleset.save()
  return ruleset