CSS для предотвращения наследования родительских стилей дочерним элементом [дубликат]

Возможный дубликат:
Как предотвратить наследование CSS?

Есть ли способ объявить свойство CSS элемента таким образом, чтобы оно не влияло ни на одного из его дочерних элементов, или есть способ объявить CSS элемента, чтобы реализовать только указанный стиль и не наследовать какой-либо из объявленных стилей для его родителей?

Быстрый пример

HTML:


    
Content of the paragraph
Content of the span

CSS:

form div {
    font-size: 12px;
    font-weight: bold;
}
div.content {
    /* Can anything go here? */
}

При нормальных обстоятельствах можно было бы ожидать, что текстовый блок " У меня есть модель игры с «сквозным» ManyToManyField к модели пользователя. class Game (models.Model): # другие разные поля описания игры ... ...

Вопрос о том, как выполнить запрос django. У меня есть игровая модель через ManyToManyField к модели "Пользователь".

class Game(models.Model):
    # other misc game-description fields...
    players = models.ManyToManyField(User, through='PlayerGameResult',
                                     blank=True, null=True)

class PlayerGameResult(models.Model):
    game            = models.ForeignKey(Game)
    player          = models.ForeignKey(User)
    dtime_played    = models.DateTimeField(default=datetime.now)
    # ...

Если в определенную игру сыграли более 1 игрока, то поле игроков в игровой модели будет иметь 1+ ссылок. В противном случае игроки равны нулю. Чтобы задать вопрос, пожалуйста, обратитесь к ?????? ниже ....

# all games not yet played by this user...
games_qset = Game.objects.exclude(players__username=request.user.username)

# out of all the games not played by this user, extract the ones not
# yet played by anyone else either (this user would be the 1st player)
games_unplayed_qset = games_qset.filter(players__isnull=True)


# here's the question: out of all the games that have not been played by 
# this user, get a queryset that extracts only the games that have been 
# played by more than 10 (GAME_WITH_FEW_PLAYERS_THRESHOLD) players
# ?????? this is the query I don't know how to make... ?????
#
# in the following example, I want to get back a queryset that includes only
# Game Ids 6 and 19, because they have players count 20 and 12 (> threshold 10)
#
# (Pdb) for rec in games_qset: print rec
# Game id 6,  Num players:  20
# Game id 7,  Num players:   5
# Game id 13, Num players:   0
# Game id 19, Num players:  12
#
# for a count of all games that have been played by at least one player:
# (Pdb) games_qset.filter(players__isnull=False).count()
# 3
#

Есть идеи? Спасибо. Хуан

11
задан jd. 22 February 2011 в 16:34
поделиться