To display our list of categories in the DropDown, we set the items property of our DropDown to the categories list we just defined. Go back to your ‘ArticleEdit’ Form and add this line to the __init__ method:

    # Any code you write here will run when the form opens.
    self.category_box.items = categories

Your ‘ArticleEdit’ Form should now look like this:

from anvil import *
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables

categories = [(cat['name'], cat) for cat in app_tables.categories.search()]

class ArticleEdit(ArticleEditTemplate):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)

    # Any code you write here will run when the form opens.
    self.category_box.items = categories