Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3350418
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:47:04+00:00 2026-05-18T01:47:04+00:00

I have a simple model: class MediaLink(models.Model): title = models.CharField(max_length=200) subtitle = models.TextField(max_length=2000, unique=False,

  • 0

I have a simple model:

class MediaLink(models.Model): 
  title = models.CharField(max_length=200)
  subtitle = models.TextField(max_length=2000, unique=False, blank=True)
  byline = models.CharField(max_length=200, unique=False, blank=True)
  url = models.URLField(unique=False) 
  source = models.CharField(max_length=30, unique=False)
  source_url = models.CharField(max_length=30, unique=False, blank=True, null=True, choices=SURL_CHOICES)
  mediatype = models.CharField(max_length=30, choices=MEDIATYPE_CHOICES)
  topic = models.CharField(max_length=30, choices=TOPIC_CHOICES)
  sourceinfo = models.ForeignKey(SourceInfo, blank=True, null=True)
  date_added = models.DateField(auto_now_add=True)


  def __unicode__(self):
    return u'%s' % self.title

  class Meta: 
    abstract = True

  class Admin: 
    pass

I’d like to set the “subtitle” field so that in each object, its initial data is “<h3></h3>“. I’m using markdown and having the tags set initially saves me from having to create them in the admin for each record.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:47:04+00:00Added an answer on May 18, 2026 at 1:47 am

    You could just set the default on the field:

    subtitle = models.TextField(max_length=2000, unique=False, blank=True, default='<h3></h3>')
    

    Or if you’re using a ModelForm you can set it in the initial kwarg.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple model like this one: class Artist(models.Model): surname = models.CharField(max_length=200) name
I have this simple Blog model: class Blog(models.Model): title = models.CharField(_('title'), max_length=60, blank=True, null=True)
I have this simple Post model: class Post(models.Model): title = models.CharField(_('title'), max_length=60, blank=True, null=True)
I have a simple category model: class Category(models.Model): name = models.CharField(max_length=200) slug = models.SlugField()
Assume I have such simple model: class Foo(models.Model): name = models.CharField(max_length=25) b_date = models.DateField()
Here is a simple model: class Product(models.Model): caption = models.CharField(max_length=1000) description=models.TextField() supplier = models.ForeignKey(Supplier)
I have a simple model which looks like this: class Group(models.Model): name = models.CharField(max_length
Say I have a simple forum model: class User(models.Model): username = models.CharField(max_length=25) ... class
I have this simple model: class Tag(models.Model): title = models.SlugField() created = models.datetime def
Hay, i have a simple model class Manufacturer(models.Model): name = models.CharField() car_count = models.IntegerField()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.