an ideea:
build a custom Model Form for Character, and after that define CharacterHome
Model Form.
class CharacterForm(forms.ModelForm):
class Meta:
model = Character
exclude = ('some', 'fields','here', 'that', 'you', 'do', 'not',
'want', 'to', 'display' )
class CharacterHomeF
Hi Léon,
it's not that basic. Picking up your example, I define a Form based on
CharacterHome. Then I show 1 entry from CharacterHome; the field
'character' is shown as a MultipleChoiceField where ALL entries from
Character are listed. But I need only the one particular record that
ist referenced
Hi Léon,
it's not that basic. Picking up your example, I define a Form based on
CharacterHome. Then I show 1 entry from CharacterHome; the field
'character' is shown as a MultipleChoiceField where ALL entries from
Character are listed. But I need only the one particular record that
ist referenced
Basically you have to link them with a foreign key. I hope this fits
your needs with the legacy table.
class Character(models.Model):
guid = models.IntegerField(primary_key=True)
name = models.CharField()
…
class CharacterHome(models.Model):
character = models.ForeignKey(Character
goobee, I am not sure, if I understand you. You have a person with a
name, let's say "Max Mustermann". You want to show the ModelForm
participant for this particular person? Is this correct?
On Aug 24, 9:14 am, goobee wrote:
> thanks Léon
>
> but I need name and firstname from the referenced tab
thanks Léon
but I need name and firstname from the referenced table 'person', but
only from ONE person; the person I read from 'participant'.
goobee
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gro
I have experienced this same issue, and that link didn't really help.
I am trying to hook into a legacy database using "inspectdb", and I
can't index the tables.
class Character(models.Model):
guid = models.IntegerField(primary_key=True)
name = models.CharField()
...
...
class
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form
Good luck!
-ld
On Aug 21, 3:49 pm, goobee wrote:
> hi there
>
> I'm in dire need of a good idea. django drives me crazy with its
> foreignkey-resolver.
>
> class person(models.Model):
> name
hi there
I'm in dire need of a good idea. django drives me crazy with its
foreignkey-resolver.
class person(models.Model):
name ...
firstname
class participant(models.Model):
group ..
person(foreignkey(person))
funk ...
I want to show 'participant
9 matches
Mail list logo