I'm currently trying to code a a simple website where what you submit to the website is is validated and then saved into a database using this bit of code.
def referral_create(request):
if request.method == 'POST':
form = CashtextsForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('Submitted_page.html')
else:
form = CashtextsForm()
return render_to_response('CashTextsubmit.html')
It works fine (I think) but when i run a Cashtexts.objects.all() on it. The database only returns 2 items from the database even tho I have "submitted" tens of things through the actual web interface.
I really have zero knowledge of Databases so I'm not sure if this is normal or if I'm looking in the wrong place or what is really going on here. any help is appreciated.
Edit: here is the file of Models.py
from django.db import models
from django.forms import ModelForm
class Cashtexts(models.Model):
cashcode = models.CharField(max_length=100)
def __unicode__(self):
return self.cashcode
class CashtextsForm(ModelForm):
class Meta:
model = Cashtexts
CashtextsFormDATABASESinsettings.py?