mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 12:14:28 +08:00
Add from_db method to Model Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>
This commit is contained in:
14
test-data/typecheck/models/test_state.yml
Normal file
14
test-data/typecheck/models/test_state.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
- case: state_attribute_has_a_type_of_model_state
|
||||
main: |
|
||||
from myapp.models import MyUser
|
||||
user = MyUser(pk=1)
|
||||
reveal_type(user._state) # N: Revealed type is 'django.db.models.base.ModelState'
|
||||
installed_apps:
|
||||
- myapp
|
||||
files:
|
||||
- path: myapp/__init__.py
|
||||
- path: myapp/models.py
|
||||
content: |
|
||||
from django.db import models
|
||||
class MyUser(models.Model):
|
||||
pass
|
||||
Reference in New Issue
Block a user