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

  • Home
  • SEARCH
  • 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 8511567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:02:02+00:00 2026-06-11T04:02:02+00:00

class Url(models.Model): url=models.URLField(verify_exists=True,max_length=200,blank=False,null=False) date=models.DateTimeField(auto_now_add=True) count=models.IntegerField(default=0) isspam=models.IntegerField(default=0) This is my models code….and when i make

  • 0
class Url(models.Model):
    url=models.URLField(verify_exists=True,max_length=200,blank=False,null=False)
    date=models.DateTimeField(auto_now_add=True)
    count=models.IntegerField(default=0)
    isspam=models.IntegerField(default=0)

This is my models code….and when i make an object with no arguments..the object is created and is saved to the DB even after writing blank=False,null=False and the URL is also not checked for existence.If i supply it a dead link, it works but it shouldn’t!

What is the problem with my code?

Related Query: Now that in django 1.4, verify_exists has been deprecated…how can i check for validation in 1.4?

  • 1 1 Answer
  • 0 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-06-11T04:02:04+00:00Added an answer on June 11, 2026 at 4:02 am
    1. As you’ve seen, django does not validate model on save() by default, but your database should’ve thrown an error when inserting NULL value, I would check the schema to be sure.
    2. Use URLValidator
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following model: class mark(models.Model): title=models.CharField(max_length=35) url=models.URLField(max_length=200) user=models.ManyToManyField(User,blank=True) and then I use
Here's my code: class Publisher(models.Model): name = models.CharField( max_length = 200, unique = True,
<!-- language: lang-default --> class Seo(models.Model): title = models.CharField( max_length=500, blank=True) description = models.CharField(max_length=500,
I have a simple model: class MediaLink(models.Model): title = models.CharField(max_length=200) subtitle = models.TextField(max_length=2000, unique=False,
For the following model: #models.py class entry(models.Model): title = models.CharField(max_length=25) image = models.ImageField(upload_to=/,blank=True) video_url
In models.py I have... class Siteinfo(models.Model): url = models.CharField(max_length=100) description = models.TextField() class Makesite(models.Model):
I defined couple models in my app: class Project(models.Model): title = models.CharField(max_length=150) url =
models: class Band(models.Model): B_Name = models.CharField(max_length=30, primary_key=True) Country = models.CharField(max_length=30) genre = models.ForeignKey(Genre) imageband
This is the model: class Car(models.Model): user = models.ForeignKey(User, related_name='cars') name = models.CharField(max_length=64) Url
I attached a UserProfile class to User this way: class UserProfile(models.Model): url = models.URLField()

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.