Re: Passing parameters to class Meta:

2012-04-16 Thread Mario Gudelj
TIL don't override model class constructor if you don't really have to. Thanks for all your help guys! Now when I think about it I don't even know why I did it in the first place. On 17 April 2012 03:12, Javier Guerra Giraldez wrote: > On Mon, Apr 16, 2012 at 11:08 AM, Tom Evans > wrote: > > S

Re: Passing parameters to class Meta:

2012-04-16 Thread Javier Guerra Giraldez
On Mon, Apr 16, 2012 at 11:08 AM, Tom Evans wrote: > Surely you would want what business a payment relates to to be stored > directly in the database?! At which point it simply becomes an > additional field in your payment model, and the only problems come > with automatically populating that fiel

Re: Passing parameters to class Meta:

2012-04-16 Thread Tom Evans
On Mon, Apr 16, 2012 at 4:50 PM, Mario Gudelj wrote: > Hi Tom, > > Thanks for chiming in, mate. > > What I'm doing here is I'm getting the subdomain from the request and > matching it to the business when paypal PDT notification gets posted with > GET to my app. > > I then need to save the payment

Re: Passing parameters to class Meta:

2012-04-16 Thread Mario Gudelj
Hi Tom, Thanks for chiming in, mate. What I'm doing here is I'm getting the subdomain from the request and matching it to the business when paypal PDT notification gets posted with GET to my app. I then need to save the payment info and sine a foreign key for the payment is business I need to sa

Re: Passing parameters to class Meta:

2012-04-16 Thread Mario Gudelj
Hey Javier, Thanks for the reply. There are thousands of different businesses, so I guess I'll have to go with the last option... Is this kind of what you're referring to there http://stackoverflow.com/questions/7114710/using-a-mixin-with-a-django-form-class ? Thanks again. -m On 17 April 2012

Re: Passing parameters to class Meta:

2012-04-16 Thread Tom Evans
On Mon, Apr 16, 2012 at 4:11 PM, Mario Gudelj wrote: > Hi Djangoers, > > I have an issue I can't work out. This is the situation: > > I have a model called payment, which has a custom constructor which takes a > parameter. This is the code: > > class Payment(models.Model): >     id = models.AutoFi

Re: Passing parameters to class Meta:

2012-04-16 Thread Javier Guerra Giraldez
On Mon, Apr 16, 2012 at 10:11 AM, Mario Gudelj wrote: > I think I need to somehow pass the business object to model = Payment inside > the Meta class... how many 'business' options are there? if it's a fixed num, you could add a Proxy 'subclass' for each one that simply provides the apropriate p

Passing parameters to class Meta:

2012-04-16 Thread Mario Gudelj
Hi Djangoers, I have an issue I can't work out. This is the situation: I have a model called payment, which has a custom constructor which takes a parameter. This is the code: class Payment(models.Model): id = models.AutoField(primary_key=True) amount = models.FloatField("Total payment a