-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm using django-mptt to manage a simple CMS, with a model called Page, which looks like this (most presumably irrelevant fields removed):
class Page(mptt.Model, BaseModel):
title = models.CharField(max_length = 20)
slug = AutoSlugField(populate_from = 'title')
contents = models.TextField()
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I've been using django-mptt in my project for a while now, it's fabulous. Recently, I've found a need to override a model's save() method that uses mptt, and I'm getting an error when I try to save a new instance of that model:
Exception Type: ValueError at /admin/scrivener/page/add/
Exception Value:…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm using Ben Firshman's fork of django-MPTT (hat tip to Daniel Roseman for the recommendation).
I've got stuck trying to re-order nodes which share a common parent. I've got a list of primary keys, like this:
ids = [5, 9, 7, 3]
All of these nodes have a parent, say with primary key 1.
At present…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
django-mptt seems determined to drive me out of my mind. I'm trying to do something relatively simple: I'm going to delete a node, and need to do something reasonable with the node's children. Namely, I'd like to move them up one level so they're children of their current parent's parent.
That is…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
What mysql query should i use to select root elements? Let's say i have tree structure like this:
http://www.ipix.lt/desc/18496369
And i want to select (Vaisiai, Daržoves) elements.
>>> More