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
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:
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
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
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
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
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
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
8 matches
Mail list logo