<commit_before>from django.contrib import admin
from .models import Patient

admin.site.register(Patient)<commit_msg>In Django Patient admin, filter hub and user options<commit_after>from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Patient
from django import forms

class CustomPatientForm(forms.ModelForm):
    class Meta:
        model = Patient

    def __init__(self, *args, **kwargs):
        super(CustomPatientForm, self).__init__(*args, **kwargs)
        self.fields['hub'].queryset = Group.objects.get(name="hubs").user_set.all()
        self.fields['user'].queryset = Group.objects.get(name="patients").user_set.all()


class PatientAdmin(admin.ModelAdmin):
    form = CustomPatientForm

admin.site.register(Patient, PatientAdmin)
{'fraction_non_alphanumeric': 0.11153358681875793, 'fraction_numerical': 0.0, 'mean_word_length': 4.851851851851852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7272638', 'n_tokens_mistral': 232, 'n_tokens_neox': 215, 'n_words': 55}