mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
add ForeignKey
This commit is contained in:
14
test/test-data/check-model-relations.test
Normal file
14
test/test-data/check-model-relations.test
Normal file
@@ -0,0 +1,14 @@
|
||||
[case testForeignKeyWithClass]
|
||||
from django.db import models
|
||||
|
||||
class User(models.Model):
|
||||
pass
|
||||
|
||||
class Profile(models.Model):
|
||||
user = models.ForeignKey(to=User, on_delete=models.CASCADE)
|
||||
|
||||
profile = Profile()
|
||||
reveal_type(profile.user) # E: Revealed type is 'main.User*'
|
||||
[out]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user