• white-space: pre-wrap preserves white spaces and breaks lines at newlines. (CSS)

*You can index your models with db_index=True (reference)

  • You can give your model metadata by adding class Meta. Example from the official docs:
    from django.db import models
    class Ox(models.Model):
      horn_length = models.IntegerField()
    
      class Meta:
          ordering = ["horn_length"]
          verbose_name_plural = "oxen"
    

Metadata options can include db_table, ordering, and verbose_name_plural. (reference)

This post is a part of the #100daysofcode challenge.

blog comments powered by Disqus
  • Hi, I'm Linda! I enjoy going to tech meetups, learning web development, and blogging about the learning path. Follow me @LPnotes

Subscribe to The Coding Diaries