Update model field after a certain period

2016-01-06 Thread salma . essalmani . wbc
I have a Django model with a Boolean field called New. During the model creation it's set to True, but I want it to be updated automatically to False after a certain period (1 month post creation for example). Can I use signals here? -- You received this message because you are subscribed to t

Re: how to model a reflexive many to many relationship?

2013-08-28 Thread Wissal Wbc
This is my progress so far : class Utilisateur(models.Model): user = models.OneToOneField(User) role = models.CharField(choices=ROLES,blank=False,max_length=50) managed_by = models.ManyToManyField('self', related_name='managers',

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
I went the hard way and changed all the null values untill I found out which one caused a problem Thanks 2013/4/24 Shawn Milochik > Ah, I missed that point. You could temporarily create an __init__ override > in your model and put the code there. > > -- > You received this message because you a

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
output to a file. > > > On Wed, Apr 24, 2013 at 10:39 AM, Wissal Khadrouf WBC < > wissal.khadr...@wbc.ma> wrote: > >> That's what I was thinking,it's from the data >> But I dont know wich field and how to find out >> >> >> 2013

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
That's what I was thinking,it's from the data But I dont know wich field and how to find out 2013/4/24 Shawn Milochik > Try iterating through your output in the view and look at field, > field.content, and if field.help_text. Somewhere you have a null value > which is None in Python. > > Since

How to get the source code of an url?

2012-11-27 Thread wbc
I'm trying to parse an xml url with minidom. I have an url with my xml data. This is my code: url = "http://myurl.com/wsname.asp"; datasource = urllib2.urlopen(url) dom = parse(datasource) handleElements(dom) my handleElements function to parse xml: def handleElements(dom): Elements