Title: TreeAdmin displaying odd ordering with more than 1 root node · Issue #2 · feincms/feincms3 · GitHub
Open Graph Title: TreeAdmin displaying odd ordering with more than 1 root node · Issue #2 · feincms/feincms3
X Title: TreeAdmin displaying odd ordering with more than 1 root node · Issue #2 · feincms/feincms3
Description: model class Step(CTENode): description = models.CharField(max_length=75, null=True, blank=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, limit_choices_to=step_choices, null=True, blank=True) object_id = Gfk...
Open Graph Description: model class Step(CTENode): description = models.CharField(max_length=75, null=True, blank=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, limit_choices_to=step_choices...
X Description: model class Step(CTENode): description = models.CharField(max_length=75, null=True, blank=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, limit_choices_to=step_choices...
Opengraph URL: https://github.com/feincms/feincms3/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TreeAdmin displaying odd ordering with more than 1 root node","articleBody":"**model**\n\n```\nclass Step(CTENode):\n description = models.CharField(max_length=75, null=True, blank=True)\n content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, limit_choices_to=step_choices, null=True, blank=True)\n object_id = GfkLookupField('content_type', null=True, blank=True)\n content_object = GenericForeignKey('content_type', 'object_id')\n is_active = models.BooleanField(verbose_name=\"Active\", default=True, help_text=\"If not active, subscribers will still be allowed to move to this step, but this step won't run until it's active. Consider this a good way to 'hold' subscribers on this step. Note: Step children won't run either.\")\n position = models.PositiveIntegerField(db_index=True, editable=False, default=0)\n\n _cte_node_path = 'cte_path'\n _cte_node_order_by = ('position',)\n```\n\n**admin**\n\n```\nclass StepAdmin(TreeAdmin):\n model = Step\n generic_raw_id_fields = ['content_object']\n raw_id_fields = ('parent',)\n list_display = ('indented_title', 'move_column')\n```\n\n**issue**\n\n```\n\u003e\u003e\u003e root_one = Step.objects.create(description='root_one')\n\u003e\u003e\u003e root_one_middle = Step.objects.create(description='root_one_middle', parent=root_one)\n\u003e\u003e\u003e root_one_bottom = Step.objects.create(description='root_one_bottom', parent=root_one_middle)\n```\n\n\n\nThat looks as expected. Let's add another root node.\n\n```\n\u003e\u003e\u003e root_two = Step.objects.create(description='root_two')\n\u003e\u003e\u003e root_two_middle = Step.objects.create(description='root_two_middle', parent=root_two)\n\u003e\u003e\u003e root_two_bottom = Step.objects.create(description='root_two_bottom', parent=root_two_middle)\n```\n\n\nIt only seems to look good with 1 root node. Everything gets displayed properly even when adding multiple children all over the place, but as soon as another root node gets in, it gets wonky. Only happens in Admin. Likely has something to do with TreeAdmin's get_ordering method, but I'm curious if you're able to re-create this with your Page model.\n","author":{"url":"https://github.com/kronok","@type":"Person","name":"kronok"},"datePublished":"2016-09-23T19:23:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2/feincms3/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2a6a8d8a-686b-d182-59e3-579949e12635 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E600:1625C5:CA812FC:1066737B:6976CD2A |
| html-safe-nonce | e1cf0dc066c687a6d4a670ad48a0ca46624d5866068cbcaa95e37c8f11756eb0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjAwOjE2MjVDNTpDQTgxMkZDOjEwNjY3MzdCOjY5NzZDRDJBIiwidmlzaXRvcl9pZCI6IjkwMDE5MDc3MTA3NzI4MjUzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 05a95101e6a3182ad6ed6ca27372461d6ef99916d66bd322026bcab21cea8ed2 |
| hovercard-subject-tag | issue:178954735 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feincms/feincms3/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a015003d62970f5203a528a9af3a4dd42f9083b270a9bf14a0daee49bc2e09df/feincms/feincms3/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a015003d62970f5203a528a9af3a4dd42f9083b270a9bf14a0daee49bc2e09df/feincms/feincms3/issues/2 |
| og:image:alt | model class Step(CTENode): description = models.CharField(max_length=75, null=True, blank=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, limit_choices_to=step_choices... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kronok |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/feincms/feincms3 git https://github.com/feincms/feincms3.git |
| octolytics-dimension-user_id | 935594 |
| octolytics-dimension-user_login | feincms |
| octolytics-dimension-repository_id | 61632866 |
| octolytics-dimension-repository_nwo | feincms/feincms3 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 61632866 |
| octolytics-dimension-repository_network_root_nwo | feincms/feincms3 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width