OneToOne field versus model inheritance

2015-01-20 Thread Paul Royik
I have three models: Person, Client, Member Person is a base model, Client and Member are profiles for Person. class Person(AbstractBaseUser, PermissionsMixin): email = models.EmailField( verbose_name=_('email address'), max_length=255, unique=True, ) class Client

Re: Re-Order rendering of input fields of django-contact-form?

2015-01-20 Thread Paul Royik
Try def __init__(self, *args, **kwargs): super(CustomContactForm, self).__init__(*args, **kwargs) self.fields.keyOrder = ['name', 'reason', 'email', 'body'] On Tuesday, January 20, 2015 at 11:26:01 PM UTC+2, Tobias Dacoir wrote: > > I'm using django-contact-form which allows me t

Re: Re-Order rendering of input fields of django-contact-form?

2015-01-21 Thread Paul Royik
> > So pass the request > def __init__(self, request, *args, **kwargs): self.request=request super(CustomContactForm, self).__init__(*args, **kwargs) self.fields.keyOrder = ['name', 'reason', 'email', 'body'] -- You received this message because you are subscribed to

Select Field With Other option

2015-01-26 Thread Paul Royik
I need to build a form field with a special select field. Select field should have option other on which text field is shown. After entering value in textfield, it should be validated, saved and then refered to initial form. How this can be done? I'm trying to override MultiValueField and Mult

Re: forloop

2015-01-26 Thread Paul Royik
Inside view there is no forloop (unless you explicitly define it). forloop is defined only inside for loops in templates Actually your code is somewhat weird. You iterate all list until last without doing anything. It is more efficient to use slicing email = newleave.objects.all()[-1] # this is

Save one to one field manually

2015-02-01 Thread Paul Royik
I need to manually save OnetoOne field. I asked this question on stackoverflow. More details here: http://stackoverflow.com/questions/28262236/saving-onetoone-field-manually-in-django Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Save one to one field manually

2015-02-02 Thread Paul Royik
I solved the problem. See http://stackoverflow.com/questions/28262236/saving-onetoone-field-manually-in-django -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to d