mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 20:54:29 +08:00
Reorganize code a bit, add current directory to sys.path (#198)
* reorganize code a bit * add current directory to sys.path * remove PYTHONPATH mention from the docs * linting
This commit is contained in:
@@ -212,4 +212,45 @@
|
||||
class User(models.Model):
|
||||
pass
|
||||
class Profile(models.Model):
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
|
||||
|
||||
|
||||
# TODO
|
||||
- case: f_expression_simple_case
|
||||
main: |
|
||||
from myapp.models import User
|
||||
from django.db import models
|
||||
User.objects.filter(username=models.F('username2'))
|
||||
User.objects.filter(username=models.F('age'))
|
||||
installed_apps:
|
||||
- myapp
|
||||
files:
|
||||
- path: myapp/__init__.py
|
||||
- path: myapp/models.py
|
||||
content: |
|
||||
from django.db import models
|
||||
|
||||
class User(models.Model):
|
||||
username = models.TextField()
|
||||
username2 = models.TextField()
|
||||
|
||||
age = models.IntegerField()
|
||||
|
||||
|
||||
# TODO
|
||||
- case: f_expression_with_expression_math_is_not_supported
|
||||
main: |
|
||||
from myapp.models import User
|
||||
from django.db import models
|
||||
User.objects.filter(username=models.F('username2') + 'hello')
|
||||
installed_apps:
|
||||
- myapp
|
||||
files:
|
||||
- path: myapp/__init__.py
|
||||
- path: myapp/models.py
|
||||
content: |
|
||||
from django.db import models
|
||||
class User(models.Model):
|
||||
username = models.TextField()
|
||||
username2 = models.TextField()
|
||||
age = models.IntegerField()
|
||||
|
||||
Reference in New Issue
Block a user