python - Inserting a value (evaluated in views.py) to database in views.py -


here models.py file:

class soundfile(models.model):     date_created = models.datetimefield(auto_now_add=true)  # date of creation     name = models.charfield(max_length=50, default='sound file')    # name of file during upload     nameonly = models.charfield(max_length=200, default='filename') # song identifier without file extension     identifier = models.charfield(max_length=50, default='xxxxxxx') # song identifier without file extension     filesize = models.integerfield(default=0) # file size in bytes     uploaded_file_url = models.charfield(max_length=200, default='url')  # file url     duration = models.integerfield(default=0)     no_of_frames = models.integerfield(default=0)     score = models.floatfield(default=0.0) 

i need alter 'score' in views.py evaluated function in views.py only.

views.py:

from .models import soundfile def rnp(request, nameonly, no_of_frames): # ... # nameonly unique every row in database file = soundfile.objects.get(nameonly=nameonly)  score = compare.evaluate(freq, freq_u) # doesn't work file.score = score # ... 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -