Skip to content

Make it easier to apply a view's tagset as another view's filter #617

@fluffy-critter

Description

@fluffy-critter

Currently, if you do something like get_view(category='blah', tag=view.tags) then if the current view has no tags, the view.tags will be [], which will cause no entries to match.

There are two possibilities for fixing this:

  1. Make view.tags return None if the tagset is empty
  2. Make get_view(tag=[]) apply no tag filter

Choice 2 makes the most high-level sense, but doing that would eliminate the possibility of purposefully excluding entries that do have tags, although it isn't clear if get_view(tag=[]) currently works at all anyway.

The current workaround is to do something like

get_view(tag=view.tags or None)

which also feels super grody.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions