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 6062067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:00:33+00:00 2026-05-23T09:00:33+00:00

How do you annotate a numerical field that is required, and must not zero….

  • 0

How do you annotate a numerical field that is required, and must not zero…. I have tried looking this up a couple of times, but can’t find anything on it. Surely I can’t be alone!

[Range(-9999999,-1)] is good for negative values only (is there a better way?)

OK – so how about NOT zero?

Range(1,9999999) and Range(-9999999,-1) – but two range attributes is incorrect. Is Custom attribute the only way to go?

Regards,
R

  • 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-05-23T09:00:33+00:00Added an answer on May 23, 2026 at 9:00 am

    I don’t think you can do this using the standard validation attributes. As you say, you could use a custom attribute. Alternatively you could use someone else’s library, for example MVC Foolproof validation appears to provide a NotEqualTo operator which you could use.

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

Sidebar

Related Questions

I'm doing this query: SomeObject.objects.annotate(something=Avg('something')).order_by(something).all() I normally have an aggregate field in my model
Let's say I have this class: @Annotate class MyClass { MyField field = new
I'm looking for a tool with which I can annotate source code. I have
I've got a query that looks like this affiliates = User.objects.annotate(referral_count=Count('referrals')) .filter(referral_count__gt=0) But when
I have tried to simplify and annotate the code which is giving me a
Does anyone have any idea why annotate does not work anymore in rails 3.1
I am looking for the way to annotate axis in ggplot2. The example of
Is there a way to annotate an anonymous inner class in Java? In this
In previous organization, 'cvs annotate' used to give annotation w.r.t modifier login id. This
I have a column type date (shown from annotate) on my Contacts table: #

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.