Hi Duncan,

On 3/5/07, DuncanM <[EMAIL PROTECTED]> wrote:
> [Class description]
>
> The squad selector also has a foriegnkey on fixture, but also has 16
> other fields that are all foreignkeys on player.
>
> [SquadSelector class]
>
> Now I have a few queries/questions.
> 1.)As you can see from the class above I have stated core=True on all
> the fields in SquadSelector except subs 1-5 because obviously a team
> must have all 11 players, but subs are a possible extra.  Yet still
> when I try and leave them blank the admin page says I need to have
> them.  How do I stop this from happening?

I think you have to add "blank=True" and null="True" to the fields,
that can be left out.


> 2.)My appearance class simply contains a result foreignkey and a
> player foreignkey, when I go to the admin page I select the result
> from a drop down box, then select the player from another drop down
> box.  How would I go about making it so that all those players in the
> starting 11 (e.g. those not a sub) that were in the squad selector for
> that particular fixture, are automatically added to the appearance
> admin page? (e.g. so I dont have to add the fixture and player 11
> times over?)

You could overwrite the save method of you models Appearance class.
Example:

class Appearance(models.Model):
    def save(self):
        # add your 11 players from the squad selecter
        super(Appearance, self).save()


> 3.)How would I go about creating a statistics page (now the classes
> are in place) such as player x has 10 appearances, and 3 goals (goals
> come from scorer class[result, player, howmany]) I know this is a
> basic question regarding views and templates but I'm still very new to
> this, I have looked through as much of the documentation as I can but
> cannot find anywhere that details what I want?

I would recommend to read the tutorial on the django homepage:
http://www.djangoproject.com/documentation/tutorial1/

You could write me a pm if you still don't get it work.


> Duncan

Kai

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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