"reorder stuff" is quite vague...
If you mean specifying the order of and which fields should appear on
the admin page you can do that using the ´´fields´´ parameter to
Admin as is shown in tutorial 2:
http://www.djangoproject.com/documentation/tutorial2/
If you want to control the order in which
Hi Minglei,
First of all I think I would rename "author" in Album to "authors" to
reflect the fact that there can be many authors. You could use
something like this:
objalbum, created = Album.objects.get_or_create(name=album)
objalbum.authors.add(objauthor)
or
objauthor.album_set.get_or_create(nam
Minglei Wang wrote:
> [...]
> when i want to get or create a song object in album like following, the
> second parameter (album=objalbum) must be put on.
> Otherwise it would report an error: album_id must not be null.
>
> song, created = objalbum.song_set.get_or_create(name=name, album=objalbum)
Hi
Not sure I completely get your code. If client_search initially is a
variable holding a string I assume you're aware that declaring a
function with the same name will override the original variable...
When you write ´´first_name__icontains=client_search´´, is
client_search supposed to hold a st
Hi Minglei,
Sorry for the digression. At first I thought you only wanted to solve
your immediate problem of how to add records to a many-to-many relation
to be able to move on. I understand now that you also wonder why one
has to specify the album a second time when the objalbum.song_set
should be
Hi Alen
Kilian showed how you can change the displayed name of your models.
If in addition you want to specify how your fields are displayed please
see:
http://www.djangoproject.com/documentation/model_api/#verbose-field-names
Martin
--~--~-~--~~~---~--~~
You rec
You might want to consult this page:
http://www.djangoproject.com/documentation/request_response/#examples
Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send em
Sorry for the bump. But I'm genuinly interested in understanding why
it's not possible to write:
>>> album.song_set.get_or_create(name='name', album=album)
without specifying the album explicitly as a kw argument. Shouldn't the
album parameter in this example be inferred through the album.song_set
8 matches
Mail list logo