hi
i have this model called charity
___________________________________________
from django.db import models
from settings import DEFAULT_CHARITY_NAME as deafult_charity_name
class GetDefaultInstance(models.Manager):
def get_default_instance(self):
return super(Charity,self).get_query_set().filter(charity_name=default_charity_name)
class Charity(models.Model):
class Meta:
verbose_name_plural = 'Charities'
app_label = 'charities'
charity_name = models.CharField(max_length=50)
in_percentage = models.IntegerField(help_text='default value is 0,\
leave blank if you will enter fixed amount.', default=0, blank=True,null=True)
fixed_amount = models.IntegerField(help_text='default value is 0,\
leave blank if you entered amount in percentage.',default=0, blank=True, null=True )
objects = models.Manager()
default_instance = GetDefaultInstance()
def __unicode__(self):
return '%s'%self.charity_name
_______________________________-
in urls:
(r'^admin/charity_report/(?P<itemdetails_id>[-\w]+)/$', 'charities.admin_views.report'),
__________________________________________
and another model called ItemDetails which have forignkey relation with above model, with default instance of charity attached to each Itemdetail object .
I wanted to add admin button alongside history button so user can see amount charged as charity and stuff like percentage deduction,amount deducted etc.
i managed to show the button but when clicked at it gives this trace:
http://pastebin.com/03wscYLXthe settings is at:
http://pastebin.com/7FYY189Dthe other regular info are in:
http://pastebin.com/QmAdEeP9its been 2-3 days trying to run it on apache server.. it works ok on local machine.
i override form_change template and provide the button, write urls for admin