GitHub PullRequestReviewCommentEvent at 2014-01-18 19:36:45
Repository: django
Actor: akaariai
Payload: {"comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/8988888","id":8988888,"diff_hunk":"@@ -0,0 +1,929 @@\n+# -*- coding: utf-8 -*-\n+from __future__ import unicode_literals\n+\n+from itertools import chain\n+\n+from django.contrib.admin.util import get_fields_from_path, NotRelationField\n+from django.core import checks\n+from django.db import models\n+from django.db.models.fields import FieldDoesNotExist\n+from django.forms.models import BaseModelForm, _get_foreign_key, BaseModelFormSet\n+\n+\n+@checks.register('admin')\n+def check_admin_app(**kwargs):\n+    from django.contrib.admin.sites import site\n+\n+    return list(chain(*[\n+        model_admin.check(model, **kwargs)\n+        for model, model_admin in site._registry.items()\n+    ]))\n+\n+\n+class BaseModelAdminChecks(object):\n+\n+    def __init__(self):\n+        # Before we can introspect models, they need to be fully loaded so that\n+        # inter-relations are set up correctly. We force that here.\n+        models.get_apps()\n+\n+    def check(self, cls, model, **kwargs):\n+        errors = []\n+        errors.extend(self._check_raw_id_fields(cls, model))","path":"django/contrib/admin/checks.py","position":32,"original_position":32,"commit_id":"35f9f41359b73853cdf42cb814c31f45e74761d0","original_commit_id":"e28bc870fd9c30c00381ed2705fbd2849b648042","user":{"login":"akaariai","id":125285,"avatar_url":"https://gravatar.com/avatar/d9e07ff3bd9ffc8dca05187228c31514?d=https%3A%2F%2Fidenticons.github.com%2Fad3506b42e0fee132e6b8718bb353b70.png&r=x","gravatar_id":"d9e07ff3bd9ffc8dca05187228c31514","url":"https://api.github.com/users/akaariai","html_url":"https://github.com/akaariai","followers_url":"https://api.github.com/users/akaariai/followers","following_url":"https://api.github.com/users/akaariai/following{/other_user}","gists_url":"https://api.github.com/users/akaariai/gists{/gist_id}","starred_url":"https://api.github.com/users/akaariai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akaariai/subscriptions","organizations_url":"https://api.github.com/users/akaariai/orgs","repos_url":"https://api.github.com/users/akaariai/repos","events_url":"https://api.github.com/users/akaariai/events{/privacy}","received_events_url":"https://api.github.com/users/akaariai/received_events","type":"User","site_admin":false},"body":"I kind of like also the current coding. For example this produces much nicer stack traces.","created_at":"2014-01-18T19:36:45Z","updated_at":"2014-01-18T19:36:45Z","html_url":"https://github.com/django/django/pull/2181#discussion_r8988888","pull_request_url":"https://api.github.com/repos/django/django/pulls/2181","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/8988888"},"html":{"href":"https://github.com/django/django/pull/2181#discussion_r8988888"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/2181"}}}}