Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » ForeignKey, Inline, and normal Admin interface [RSS Feed]

#1 June 15, 2010 12:52:32

S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ForeignKey, Inline, and normal Admin interface


Hello *,

I've encountered a problem. I have a Match (football) which contains
relationship one-to-many with Goals.

class Match(models.Model):
title = models.CharField(max_length=150)
body = models.TextField()
...

class Goal(models.Model):
player = models.ForeignKey(Player)
moment = models.DateTimeField()
match = models.ForeignKey(Match)


What is the easiest\smartest way to enable adding Goals from Match
page ? I've read about Inline, but it doesnt works, because in this
way we will have loop import.

Thank you.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 15, 2010 13:03:30

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ForeignKey, Inline, and normal Admin interface


On Tuesday 15 June 2010 11:13:11 Saikek wrote:
> What is the easiest\smartest way to enable adding Goals from Match
> page ? I've read about Inline, but it doesnt works, because in this
> way we will have loop import.
>

easiest way is to make a custom form covering both models, preferably outside
admin
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 15, 2010 13:11:08

Daniel R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ForeignKey, Inline, and normal Admin interface


On Jun 15, 6:43 am, Saikek <dmitriy.shafrans...@gmail.com> wrote:
> Hello *,
>
> I've encountered a problem. I have a Match (football) which contains
> relationship one-to-many with Goals.
>
> class Match(models.Model):
>     title = models.CharField(max_length=150)
>     body = models.TextField()
>     ...
>
> class Goal(models.Model):
>     player = models.ForeignKey(Player)
>     moment = models.DateTimeField()
>     match = models.ForeignKey(Match)
>
> What is the easiest\smartest way to enable adding Goals from Match
> page ? I've read about Inline, but it doesnt works, because in this
> way we will have loop import.
>
> Thank you.

Why doesn't inline work? Why do you think you will have a loop import?
Be specific. After all this is the classic use case for inline admin
forms.
--
DR.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » ForeignKey, Inline, and normal Admin interface [RSS Feed]

Board footer

Moderator control

Enjoy the 13th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support