And i have a simple modelform for Package
from models import Package
from django import forms
class PackageForm(forms.ModelForm):
class Meta:
model= Package
fields= ['name', 'version', 'url', 'description', 'arch', 'dependancies', 'conflicts', 'file']
How can i ask the modelform to check, within validation, if the file extension (class is FileField) is .sh for example?
is there a way to put this in modelform? of can i only manage it in a view?
Thanks
Edit: Also, forgot to ask, the model has a Foreignkey to the auth User model... which is going to contain the current user.. how can modelform manage that?
Thanks again