def can_create_more(data):
 data = dict(data)
 user = data['user']
 course_key = data['usage_key'].course_key
 if (Bookmark.objects.filter(user=user, course_key=course_key).count() >= settings.MAX_BOOKMARKS_PER_COURSE):
  return False
 return True

def can_create_more ( data ) : data = dict ( data ) user = data [ 'user' ] course_key = data [ 'usage_key' ] . course_key if ( Bookmark . objects . filter ( user = user , course_key = course_key ) . count ( ) >= settings . MAX_BOOKMARKS_PER_COURSE ) : return False return True
determine if a new bookmark can be created for the course based on limit defined in django .