<commit_before>from django import forms
from rango.models import Category, Page

class CategoryForm(forms.ModelForm):
  name = forms.CharField(max_length=128, help_text="Please enter a category name")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  likes = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  slug = forms.CharField(widget=forms.HiddenInput(), required=False)

  class Meta:
    model = Category
    # tuple specifying the classes we want to use
    fields = ('name', )

class PageForm(forms.ModelForm):
  title = forms.CharField(max_length=128, help_text="Please enter the title of the page.")
  url = forms.URLField(max_length=200, help_text="Please enter the URL of the page.")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)

  class Meta:
    model = Page
    # excluding the category foreign key field from the form
    exclude = ('category', 'slug')<commit_msg>Add form classes for User and UserProfile<commit_after>from django import forms
from django.contrib.auth.models import User
from rango.models import Category, Page, UserProfile

class CategoryForm(forms.ModelForm):
  name = forms.CharField(max_length=128, help_text="Please enter a category name")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  likes = forms.IntegerField(widget=forms.HiddenInput(), initial = 0)
  slug = forms.CharField(widget=forms.HiddenInput(), required=False)

  class Meta:
    model = Category
    # tuple specifying the classes we want to use
    fields = ('name', )

class PageForm(forms.ModelForm):
  title = forms.CharField(max_length=128, help_text="Please enter the title of the page.")
  url = forms.URLField(max_length=200, help_text="Please enter the URL of the page.")
  views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)

  class Meta:
    model = Page
    # excluding the category foreign key field from the form
    exclude = ('category', 'slug')

class UserForm(forms.ModelForm):
  password = forms.CharField(widget=forms.PasswordInput(), help_text="Enter your password")

  class Meta:
    model = User
    fields = ('username', 'email', 'password')

class UserProfileForm(forms.ModelForm):
  class Meta:
    model = UserProfile
    fields = ('website', 'picture') 
{'fraction_non_alphanumeric': 0.10999123575810692, 'fraction_numerical': 0.010517090271691499, 'mean_word_length': 4.823979591836735, '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': '6460464', 'n_tokens_mistral': 670, 'n_tokens_neox': 647, 'n_words': 198}