models.py question for setting up multiple sql entries for 1 master sql entry

2014-11-23 Thread Bovine Devine
Hello, I am creating hardware database webapp in django and I have a question for how to setup my models.py to ensure I get the data entered into the mysql db that I have setup. I have my models.py setup this way: from django.db import models from django.utils import timezone # Create your

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine
Hmm not sure what happened but I modified my models.py section: class Hardwareid(models.Model): hardwareid_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date added') def __unicode__(self): return self.hardwareid_text to match what you had recommended:

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine
On Thursday, October 16, 2014 2:28:38 PM UTC-7, Collin Anderson wrote: > > Hi Bovine, > > Your pub_date field needs a value. Maybe try this: > > from django.utils import timezone > > class MyModel(models.Model): > pub_date = models.DateField(default=timezone.now) > > Collin > > Thanks Collin

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine
Okay I figured that part out now by editing the correct URLS.py file as I was using the one in the app package as opposed to the root level sute url.py, When I go to submit the text info in the form now I receive the following error. IntegrityError at /get_barcode.html (1048, "Column

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-15 Thread Bovine Devine
On Tuesday, October 7, 2014 6:42:39 PM UTC-7, Collin Anderson wrote: > > My bad. Put your add_view in views.py (cause it's a view :) > > Then, you'll need to import your form into your view: > from oneidentry.forms import HardwareidForm > > Thanks Collin I made the switch but now cannot access

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
On Tuesday, October 7, 2014 4:49:04 PM UTC-7, Collin Anderson wrote: > > > Am I correct in understanding that using ModelForm example you listed as > a view does not need to be added to urls then? What is the user access page > then? > The add_view would need to be added to your urls. > > I

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
Thanks for the help Collin...I need to read through more of the documentation it seems! Going through the chapter am I correct in understanding that using ModelForm example you listed as a view does not need to be added to urls then? What is the user access page then? Sorry this is all really

How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
I have gone through the django tutorial but seem to be lost on how to create a simple user view page that allows me to add/post/create data directly to the connected mysql database. I have the models view working and can access and add items in admin view but not sure how/what is the best way