from django import template
from blanc_basic_events.events.models import Event

register = template.Library()


@register.assignment_tag
def get_events():
    return Event.objects.all().prefetch_related('recurringevent_set', 'recurringeventexclusion_set')

from django import template
from blanc_basic_events.events.models import Category, Event

register = template.Library()


@register.assignment_tag
def get_events_categories():
    return Category.objects.all()


@register.assignment_tag
def get_events():
    return Event.objects.all().prefetch_related('recurringevent_set', 'recurringeventexclusion_set')

Tag to get all categories
Tag to get all categories

  from django import template
- from blanc_basic_events.events.models import Event
+ from blanc_basic_events.events.models import Category, Event
  
  register = template.Library()
+ 
+ 
+ @register.assignment_tag
+ def get_events_categories():
+     return Category.objects.all()
  
  
  @register.assignment_tag
  def get_events():
      return Event.objects.all().prefetch_related('recurringevent_set', 'recurringeventexclusion_set')
  
Tag to get all categories
## Code Before:
from django import template
from blanc_basic_events.events.models import Event

register = template.Library()


@register.assignment_tag
def get_events():
    return Event.objects.all().prefetch_related('recurringevent_set', 'recurringeventexclusion_set')

## Instruction:
Tag to get all categories
## Code After:
from django import template
from blanc_basic_events.events.models import Category, Event

register = template.Library()


@register.assignment_tag
def get_events_categories():
    return Category.objects.all()


@register.assignment_tag
def get_events():
    return Event.objects.all().prefetch_related('recurringevent_set', 'recurringeventexclusion_set')
