I have a form to edit my model. There is a select box in this form. By
default there are all the data in this select box. My goal is exclude
some data from select box, depending on current item data. So, to
achieve my goal, I need to know field value of the current model item
in the __init__ method
Thank you, Shawn.
I just wander, why auto-deleting files was not included in django as
well? Just your opinion?
On May 30, 6:32 am, Shawn Milochik wrote:
> You can override thedeletefunction of your model to take care of this.
>
> Alternatively, if you want to do this for a bunch of different mo
There are ImageField and FileField in a model.
When model item removed, image and file stay.
Is it normal behavior?
Is there a way to remove image and file automatically?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
se,default=1)
>
> def save(self, *args, **kwargs):
> if not self.id:
> # If the primary key is not defined, this is a new insertion
> self.ordering = 42 # set magic values
> self.level = 99
> super(Structure, self).save(*ar
class Structure(models.Model):
parent =
models.ForeignKey('site.Structure',blank=True,null=True,default=0)
title = models.CharField(max_length=128,verbose_name=u'Заголовок')
url = models.CharField(max_length=48,verbose_name=u'URL')
ordering = models.IntegerField(blan
rmed.
>
> Xia Kai(夏恺)
> xia...@gmail.comhttp://blog.xiaket.org
>
> --
> From: "ev"
> Sent: Saturday, January 02, 2010 12:35 AM
> To: "Django users"
> Subject: how to put html in __unicod
t; Xia Kai(夏恺)
> xia...@gmail.comhttp://blog.xiaket.org
>
> --
> From: "ev"
> Sent: Saturday, January 02, 2010 12:35 AM
> To: "Django users"
> Subject: how to put html in __unicode__() ?
>
>
>
> > I tryed to do:
>
> >
I tryed to do:
class Structure(models.Model):
def __unicode__(self):
deep = Structure.getDeep(self)
return deep * " " + self.title
def getDeep(self):
...
The result was:
Level 1
Level 2
Level 3
etc
So, how to put h
Example: I have a playlist and I want to have a possibility to change
songs order (manually, not by name or raiting).
This task could be done by adding to the model an integer field (to
remember the order):
ordering=models.IntField()
I'd like to know, if there is any feature to realize such a
fun
Thank you, Daniel, I'm trying to use this:
http://magicrebirth.wordpress.com/2009/08/18/django-admin-and-mptt-2/
On Oct 15, 12:09 pm, Daniel Roseman wrote:
> On Oct 15, 8:16 am, ev wrote:
>
> > May be there were developers solutions? Where should I look for?
>
> Look at
May be there were developers solutions? Where should I look for?
On Oct 15, 9:18 am, Михаил Лукин wrote:
> There is no sucj feature in admin interface
>
> On Wed, Oct 14, 2009 at 9:18 PM, ev wrote:
>
> > I've created model Structure referenced to itself and fil
I've created model Structure referenced to itself and filled it with
my data.
class Structure(models.Model):
parent=models.ForeignKey('self', blank=True, null=True,
related_name='child_set')
title=models.CharField(max_length=100)
Default admin interface shows my data as a plain l
12 matches
Mail list logo