Thanks a lot Bruno!!!
2010/9/15 bruno desthuilliers
> On 15 sep, 18:35, marcovic wrote:
> > Hi all,
> > i'm trying to do a simple task with Django but evidently it is not so
> > simple...
>
> It is - when you understand how things work.
>
> > I have my model:
> >
> > class Mymodel(models.Model)
On 15 sep, 18:35, marcovic wrote:
> Hi all,
> i'm trying to do a simple task with Django but evidently it is not so
> simple...
It is - when you understand how things work.
> I have my model:
>
> class Mymodel(models.Model):
> random_string = models.CharField(max_length=200)
>
> def prod
Your produce_string method is being run not just every time you create
a new Mymodel, but every time you load an existing one from the
database -- so it's overwriting your random strings on load. You'd
probably do better producing the random strings in the save() method.
On Sep 15, 12:35 pm, mar
Hi all,
i'm trying to do a simple task with Django but evidently it is not so
simple...
I have my model:
class Mymodel(models.Model):
random_string = models.CharField(max_length=200)
def produce_string(self):
a = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "L", "M",
4 matches
Mail list logo