Here is my Pricing model:
in my settings.py I have AUTH_PROFILE_MODULE = 'userprofile'
class Pricing(models.Model):
name = models.CharField(max_length=255, unique=False, default='Special
Pricing',
help_text='You do not have to change this')
user = models.ForeignKey(User, help_text='Select the user to apply this
pricing')
category = models.ForeignKey(Category, help_text='Select the category
to apply this pricing')
price_adjust = models.DecimalField(max_digits=6, decimal_places=2,
help_text='Enter a negative number
to decrease the price, example: -2.00')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
ordering = ['updated_at']
verbose_name_plural = 'Special Product Pricing'
unique_together = ("user", "category")
def __unicode__(self):
return self.user.first_name + " " + self.user.last_name
On Sunday, April 7, 2013 8:01:52 PM UTC-4, frocco wrote:
>
> I have a model that references User and on the admin page, it shows the
> user name.
> I have the User tied to a UserProfile model that has a field called
> company.
>
> I want the drop down on my Pricing Model to show company, not user.
>
> user = models.ForeignKey(User)
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.