Hello. I have such model class:
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
class Profile(models.Model):
regnum = models.CharField(_('registration number'), maxlength=32)
pvnnum = models.CharField(_('pvn number'), maxlength=32)
jaddress = models.TextField(_('juridical address'), maxlength=256)
paddress = models.TextField(_('physical address'), maxlength=256)
bank = models.ForeignKey(Bank)
swift = models.CharField(_('SWIFT code'), maxlength=32)
account = models.CharField(_('account no.'), maxlength=32)
contactperson = models.CharField(_('contact person'), maxlength=64)
phone = models.CharField(_('phone number'), maxlength=32)
mail = models.EmailField(_('e-mail'))
url = models.URLField(_('URL'), verify_exists=False)
user = models.ForeignKey(User)
def __str__(self):
return self.user.username
class Meta:
verbose_name = _('user profile')
verbose_name_plural = _('user profiles')
class Admin:
pass
--------------------------
I just want to create form_for_model and/or form_for_instance and then
delete one field (user). Is it possible or do I need to manually create my
own form? Also when retrieving a form data from request.POST.copy() - can I
(how?) update just some fields in existing record. Actually the goal is to
not show this ForeignKey (user) field and not to update it too. Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---