{"action":"created","comment":{"url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/comments/77585517","id":77585517,"diff_hunk":"@@ -0,0 +1,211 @@\n+from django.contrib import admin\n+from django.contrib.admin import SimpleListFilter\n+from django.contrib.admin.widgets import AdminRadioSelect\n+from django.db import models\n+from django.forms import NullBooleanSelect\n+from powerdns.models.requests import (\n+    DeleteRequest,\n+    DomainRequest,\n+    RecordRequest,\n+)\n+from django.utils.translation import ugettext_lazy as _\n+from django_extensions.admin import ForeignKeyAutocompleteAdmin\n+\n+from powerdns.models.powerdns import (\n+    CryptoKey,\n+    Domain,\n+    DomainMetadata,\n+    Record,\n+    SuperMaster,\n+)\n+from powerdns.models.templates import (\n+    DomainTemplate,\n+    RecordTemplate,\n+)\n+from powerdns.models.tsigkeys import TsigKey\n+\n+\n+RECORD_LIST_FIELDS = (\n+    'name',\n+    'type',\n+    'content',\n+    'ttl',\n+    'prio',\n+)\n+\n+\n+class ReverseDomainListFilter(SimpleListFilter):\n+    title = _('domain class')\n+\n+    # Parameter for the filter that will be used in the URL query.\n+    parameter_name = 'domain_class'\n+\n+    def lookups(self, request, model_admin):\n+        return (\n+            ('fwd', _('domain:forward')),\n+            ('rev', _('domain:reverse')),\n+        )\n+\n+    def queryset(self, request, queryset):\n+        q = (\n+            models.Q(name__endswith='.in-addr.arpa') |\n+            models.Q(name__endswith='.ip6.arpa')\n+        )\n+        if self.value() == 'fwd':\n+            return queryset.exclude(q)\n+        if self.value() == 'rev':\n+            return queryset.filter(q)\n+\n+\n+class DomainMetadataInline(admin.TabularInline):\n+    model = DomainMetadata\n+    extra = 0\n+\n+\n+class DomainAdmin(ForeignKeyAutocompleteAdmin, admin.ModelAdmin):\n+    inlines = [DomainMetadataInline]\n+    list_display = (\n+        'name',\n+        'type',\n+        'last_check',\n+        'account',\n+    )\n+    list_filter = (\n+        ReverseDomainListFilter, 'type', 'last_check', 'account', 'created',\n+        'modified'\n+    )\n+    list_per_page = 250\n+    save_on_top = True\n+    search_fields = ('name',)\n+    radio_fields = {'type': admin.HORIZONTAL}\n+    readonly_fields = ('notified_serial', 'created', 'modified')\n+\n+\n+class NullBooleanRadioSelect(NullBooleanSelect, AdminRadioSelect):\n+    pass\n+\n+\n+class RecordAdmin(ForeignKeyAutocompleteAdmin, admin.ModelAdmin):\n+    list_display = (\n+        'name',\n+        'type',\n+        'content',\n+        'domain',","path":"dnsaas/admin.py","position":93,"original_position":93,"commit_id":"34226132947c0635b526abff9a3d59640c998692","original_commit_id":"34226132947c0635b526abff9a3d59640c998692","user":{"login":"szok","id":2209581,"avatar_url":"https://avatars.githubusercontent.com/u/2209581?v=3","gravatar_id":"","url":"https://api.github.com/users/szok","html_url":"https://github.com/szok","followers_url":"https://api.github.com/users/szok/followers","following_url":"https://api.github.com/users/szok/following{/other_user}","gists_url":"https://api.github.com/users/szok/gists{/gist_id}","starred_url":"https://api.github.com/users/szok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szok/subscriptions","organizations_url":"https://api.github.com/users/szok/orgs","repos_url":"https://api.github.com/users/szok/repos","events_url":"https://api.github.com/users/szok/events{/privacy}","received_events_url":"https://api.github.com/users/szok/received_events","type":"User","site_admin":false},"body":"Add select_related to this field, and \"owner\"","created_at":"2016-09-06T07:37:35Z","updated_at":"2016-09-06T07:37:35Z","html_url":"https://github.com/allegro/django-powerdns-dnssec/pull/144#discussion_r77585517","pull_request_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/comments/77585517"},"html":{"href":"https://github.com/allegro/django-powerdns-dnssec/pull/144#discussion_r77585517"},"pull_request":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144","id":82710514,"html_url":"https://github.com/allegro/django-powerdns-dnssec/pull/144","diff_url":"https://github.com/allegro/django-powerdns-dnssec/pull/144.diff","patch_url":"https://github.com/allegro/django-powerdns-dnssec/pull/144.patch","issue_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/144","number":144,"state":"open","locked":false,"title":"New simple admin","user":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"body":"Add new `admin` site\r\n(Old `admin` site is moved to `/admin-deprecated` and it will be eventually deleted).\r\n\r\nAlso `blank=False` set on `Record.type`.\r\n\r\n\r\n","created_at":"2016-08-25T12:29:15Z","updated_at":"2016-09-06T07:37:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4555535bffdea5cbcf6c7d4806711dbc893845b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144/commits","review_comments_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144/comments","review_comment_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/144/comments","statuses_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/statuses/34226132947c0635b526abff9a3d59640c998692","head":{"label":"xliiv:new-admin","ref":"new-admin","sha":"34226132947c0635b526abff9a3d59640c998692","user":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"repo":{"id":53501845,"name":"django-powerdns-dnssec","full_name":"xliiv/django-powerdns-dnssec","owner":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xliiv/django-powerdns-dnssec","description":"Django application managing PowerDNS database","fork":true,"url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec","forks_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/forks","keys_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/teams","hooks_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/hooks","issue_events_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/issues/events{/number}","events_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/events","assignees_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/assignees{/user}","branches_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/branches{/branch}","tags_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/tags","blobs_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/git/refs{/sha}","trees_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/statuses/{sha}","languages_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/languages","stargazers_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/stargazers","contributors_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/contributors","subscribers_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/subscribers","subscription_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/subscription","commits_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/commits{/sha}","git_commits_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/git/commits{/sha}","comments_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/comments{/number}","issue_comment_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/issues/comments{/number}","contents_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/contents/{+path}","compare_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/merges","archive_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/downloads","issues_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/issues{/number}","pulls_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/pulls{/number}","milestones_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/milestones{/number}","notifications_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/labels{/name}","releases_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/releases{/id}","deployments_url":"https://api.github.com/repos/xliiv/django-powerdns-dnssec/deployments","created_at":"2016-03-09T13:59:19Z","updated_at":"2016-03-09T13:59:20Z","pushed_at":"2016-09-06T07:26:33Z","git_url":"git://github.com/xliiv/django-powerdns-dnssec.git","ssh_url":"git@github.com:xliiv/django-powerdns-dnssec.git","clone_url":"https://github.com/xliiv/django-powerdns-dnssec.git","svn_url":"https://github.com/xliiv/django-powerdns-dnssec","homepage":"http://django-powerdns-dnssec.readthedocs.org","size":633,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"allegro:develop","ref":"develop","sha":"28bfe8d71cc202245937dd6e6cc5d230be3c9604","user":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":37307631,"name":"django-powerdns-dnssec","full_name":"allegro/django-powerdns-dnssec","owner":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/django-powerdns-dnssec","description":"Django application managing PowerDNS database","fork":false,"url":"https://api.github.com/repos/allegro/django-powerdns-dnssec","forks_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/forks","keys_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/teams","hooks_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/hooks","issue_events_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/events","assignees_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/tags","blobs_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/languages","stargazers_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/stargazers","contributors_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/contributors","subscribers_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/subscribers","subscription_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/subscription","commits_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/merges","archive_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/downloads","issues_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/labels{/name}","releases_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/releases{/id}","deployments_url":"https://api.github.com/repos/allegro/django-powerdns-dnssec/deployments","created_at":"2015-06-12T07:12:29Z","updated_at":"2016-08-03T19:55:28Z","pushed_at":"2016-09-06T07:26:34Z","git_url":"git://github.com/allegro/django-powerdns-dnssec.git","ssh_url":"git@github.com:allegro/django-powerdns-dnssec.git","clone_url":"https://github.com/allegro/django-powerdns-dnssec.git","svn_url":"https://github.com/allegro/django-powerdns-dnssec","homepage":"http://django-powerdns-dnssec.readthedocs.org","size":683,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":10,"forks":9,"open_issues":10,"watchers":19,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144"},"html":{"href":"https://github.com/allegro/django-powerdns-dnssec/pull/144"},"issue":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/144"},"comments":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/allegro/django-powerdns-dnssec/statuses/34226132947c0635b526abff9a3d59640c998692"}}}}
{"actor":{"display_login":"szok"}}