Re: return pk id on Form

2010-08-02 Thread alan-l
Thank you for the point in the right direction. In the end i now have: @models.permalink def get_absolute_url(self): return ('c_viewcontact', [str(self.id)]) class ContactForm(ModelForm): class Meta: model = Contacts fields = ('contact_type', 'firstname', 'surname', 'note

return pk id on Form

2010-08-02 Thread alan-l
Hi, i have the below that im thought would be the best approach to have a add contact page on my app: class ContactForm(ModelForm): class Meta: model = Contacts fields = ('contact_type', 'firstname', 'surname', 'notes') def addcontact(request, request_id=0, template_name='addc

Re: return number instead of string in admin

2010-07-14 Thread alan-l
quot; % (self.mynumber, ) > > On Wed, Jul 14, 2010 at 3:57 PM, Nuno Maltez wrote: > > Hi, > > > Why not > > > def __unicode__(self): > >    return u"%d" % self.mynumber > > > ? > > > Nuno > > > On Wed, Jul 14, 2010 at 11

return number instead of string in admin

2010-07-14 Thread alan-l
Hi, in the tutorial i see that to return a string or a combination of strings, i can do: def __unicode__(self): return u'%s %s' % (self.firstname, self.surname) what do i need to do to return a number? or more importantly, what is the def called to ensure it is read and returned when

split views & shared tables for apps

2010-07-09 Thread alan-l
Hi, Im looking to use django to merge 2 MS Access databases into one and was wondering the following: Can a front end view support displaying 2 tables in one view? so having a contact on the top half and the company details on the bottom half? Also, can the view support read,update & delete all w