File: invalid_models.py

package info (click to toggle)
python-django-parler 2.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,012 kB
  • sloc: python: 4,291; makefile: 164; sh: 6
file content (15 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.db import models

from parler.models import TranslatableModel, TranslatedFields
from parler.tests.testapp.models import RegularModel


class RegularModelProxy(TranslatableModel, RegularModel):
    # Overwriting existing fields in a regular model by using a proxy.
    # This doesn't work yet, and unittests confirm that.
    translations = TranslatedFields(
        original_field=models.CharField(default="translated", max_length=255)
    )

    class Meta:
        proxy = True