question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsetting Model State

See original GitHub issue

Is it possible to unset a model state? I’m interested in changing a model from a shadow state to a production state such that the model no longer shows up if I query

model_store.list_versions("my-domain", state_name="shadow")

I see that I can set a model state, and that a model can be set to multiple different states at the same time, but I don’t see any support for removing a model from a given state.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nlathiacommented, Nov 26, 2021

This is shipped and now available on pypi in modelstore==0.0.72

0reactions
erosenthal-squarecommented, Nov 19, 2021

Thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asp.net MVC ModelState.Clear - Stack Overflow
Generally you should not need to clear the ModelState as it is maintained by the MVC engine for you. Clearing it manually might...
Read more >
ModelStateDictionary.Remove Method (System.Web.Mvc)
Removes the element that has the specified key from the model-state dictionary. Remove(KeyValuePair<String,ModelState>). Removes the first occurrence of the ...
Read more >
ModelState.Clear() is required to display back your model object
To clear the memory of the model state you need to use ModelState.Clear() . You could also remove only the desired field by...
Read more >
Disable Automatic Model State Validation in ASP.NET Core 2.1
Find out how to disable automatic model state validation in ASP.NET Core 2.1, which is enabled by default via APIController attribute.
Read more >
How to Use ModelState Validation in ASP.NET Core Web API
One idea to fix this could be to remove the [ApiController] attribute, and yes, our code will work. However, we shouldn't do that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found