Hi

I have two models, Category and News. I have linked them to eachother
through a ForeignKey in News... when I add a new newsitem I would like
to pick the category it belongs to.

I have two problems I can´t figure out:
1. I would like to be able to save a news item with a blank Category,
Djangos admin doesn´t seem to accept this even though I have added
"null=True"... is there some other way to set which fields who should
be required?
2. When I choose the category when adding a newsitem the Category
title doesn´t show up in the selectbox, instead there´s just "Category
object", "Category object", "Category object" etc.. how do I set which
field in the Category class I would like to have in the selectbox?

Here´s my simple models:

--
class Category( models.Model ):

        title = models.CharField(maxlength=50)

class News( models.Model ):

        title = models.CharField( maxlength=50,)
        region = models.ForeignKey( Category, null=True )
--


Thanks in advance.
/Nianbig
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to