| 1 | r"""
|
|---|
| 2 | >>> from testapp.models import *
|
|---|
| 3 |
|
|---|
| 4 | >>> colors = OptionGroup.objects.create(name="colors")
|
|---|
| 5 | >>> sizes = OptionGroup.objects.create(name="sizes")
|
|---|
| 6 | >>> shirt = Product.objects.create(name="shirt")
|
|---|
| 7 | >>> config = ConfigurableProduct(product="shirt")
|
|---|
| 8 | >>> config.option_groups.add(colors)
|
|---|
| 9 | >>> config.option_groups.add(sizes)
|
|---|
| 10 | >>> config.option_groups.order_by('name')
|
|---|
| 11 | [<OptionGroup: colors>, <OptionGroup: sizes>]
|
|---|
| 12 | """
|
|---|
| 13 |
|
|---|
| 14 | # Use this to reproduce the error from a Python shell
|
|---|
| 15 | _ = """
|
|---|
| 16 | from testapp.models import *
|
|---|
| 17 |
|
|---|
| 18 | colors = OptionGroup.objects.create(name="colors")
|
|---|
| 19 | sizes = OptionGroup.objects.create(name="sizes")
|
|---|
| 20 | shirt = Product.objects.create(name="shirt")
|
|---|
| 21 | config = ConfigurableProduct(product=shirt)
|
|---|
| 22 | config.option_groups.add(colors)
|
|---|
| 23 | config.option_groups.add(sizes)
|
|---|
| 24 | config.option_groups.order_by('name')
|
|---|
| 25 | """
|
|---|