Hi,
I have written a model for a web form (of sorts) I'm making that
people can fill in from the admin site. I have set permissions from
the admin end so they can only write or change new posts of the form
(see http://dpaste.org/BZ5Nm/). it's still work in progress but I
have two problems.
Firs
Can anybody help me here???
On Feb 3, 9:40 am, Krondaj wrote:
> Hi,
>
> I have written a model for a web form (of sorts) I'm making that
> people can fill in from the admin site. I have set permissions from
> the admin end so they can only write or change new posts of
On page 19 of the Django documentation release 1.3.1 It tells you to
add
import datetime
#...
class Poll(models.Model):
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
I have added this to the models.py code as including the other
__unicode__ addit
ode__(self):
> return self.question
>
> def was_published_today(self):
> return self.pub_date.date() == datetime.date.today()
>
>
>
>
>
>
>
> On Tue, Jan 10, 2012 at 2:11 AM, Nasir Rasul wrote:
> > check your indentation.
> > def __unicode__(self):
else having problems!
p.s. should it be four spaces per indent (instead of tabs) for python
in general, or is this a Django thing?
K
On Jan 16, 4:31 pm, Krondaj wrote:
> Hi, This is what I have written, which I believe is the correct
> indentation:
> --
angry with me.
I think I have solved it now, the indentation now works (i told it to
use spaces instead of tabs and spaces, that it was previously set to
for some reason!?!)
I hope what i have said makes sense?
Chris
On Jan 16, 4:41 pm, Tom Evans wrote:
> On Mon, Jan 16, 2012 at 4:31 PM, Kron
Hi,
I have just started tutorial part 2 and in part 2.4.1.
I have added django.contrib.admin to the INTALLED_APPS part of
mysettings.py
I syncd the db
I uncommented the requierd three lines from urls.py in mysite folder
I ran the runserver, and go to 127.0.0.1:8000, using chromium
This is what
Hi,
I was wondering what the best IDE to use for Python / Django would
be?
I am currently using Geany, but i'm sure there is a better (hopefully
free) one out there!?!
Regards,
Chris
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Hi,
i have completed the tutorials for Django...
Unfortunately, as I've only been learning python/django for about 1
week now. I'm a little stuck
i would like to make an internal webform (at work, run from my
computer - or a new one if successful) that basically people fill in
to request mat
Hi,
After going through to tutorial 3 there is a little bit about setting
DEBUG = False to redirect the the 404.html.
I have set this, but now the template from the tutorials (also in /
admin/) has changed and is not as 'pretty' or well laid out as before.
Can someone tell me what has happened
f.first_name, self.last_name)
If there is no documentation (for dummies) can anyone explain it to
me??
Thanks
Krondaj
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
sorry bottom line should be?
as I believe if you take the top example you should be able to do:
def __unicode__(self):
return (self.first_name, self.last_name)
On Jan 24, 11:04 pm, Krondaj wrote:
> Hi,
>
> in the django docs about __unicode__ it says the following:
>
&g
dels.TextField()
def __unicode__(self):
return (self.project_and_task, self.project_number,
self.date_created, self.requested_by)
# may change requested_by to:
# requested_by = models.ForeignKey(Person)
#
## and then add a Person class after the RrsForm class?
#
#class Person(models.M
_unicode__(self):
return u'{} {} {} {}'.format(self.project_and_task,
self.project_number, self.date_created, self.requested_by)
is the two spaces between each {} two seperate the individual strings
with two spaces?
Krondaj
On Jan 25, 11:11 am, "Petr Přikryl" wrote:
in my model i'm using:
from django.db import models, datetime, MEDIA_ROOT
class RrsForm(models.Model):
#
upload_doc = models.FileField(upload_to 'documents')
I get this error when I run (before running syncdb):
python manage.py sql rrs
I get:
File "/home/chrissmith/Dcode/rrws/rrs/m
the arrow should be pointing at the last quote at ')
like this (hopefully):
File "/home/chrissmith/Dcode/rrws/rrs/models.py", line 36
upload_doc = models.FileField(upload_to 'documents')
^
SyntaxError: invalid syntax
Any idea's??
On Jan 25, 3:54 pm, Krondaj
upload_doc = models.FileField(upload_to 'documents')
^
On Jan 25, 3:54 pm, Krondaj wrote:
> in my model i'm using:
>
> from django.db import models, datetime, MEDIA_ROOT
>
> class RrsForm(models.Model):
> #
>
> upload_doc = models.FileField(uplo
(upload_to 'documents')
> ^.
>
>SyntaxError: invalid syntax
i don't know what i've done wrong, and why i'm getting this error
On Jan 25, 3:54 pm, Krondaj wrote:
> in my model i'm using:
>
> from django.db import models, datetime, MEDIA_ROOT
>
> class Rrs
(upload_to 'documents')
>
> ^.
>SyntaxError: invalid syntax
Idon't know why i'm getting this error, or what i'm doing wrong
On Jan 25, 3:54 pm, Krondaj wrote:
> in my model i'm using:
>
> from django.db import models, datetime, MEDIA_ROOT
>
>
(upload_to 'documents')
>
> ^.
>SyntaxError: invalid syntax
Idon't know why i'm getting this error, or what i'm doing wrong
On Jan 25, 3:54 pm, Krondaj wrote:
> in my model i'm using:
>
> from django.db import models, datetime, M
(upload_to 'documents')
>
> ^.
>SyntaxError: invalid syntax
Idon't know why i'm getting this error, or what i'm doing wrong
On Jan 25, 3:54 pm, Krondaj wrote:
> in my model i'm using:
>
> from django.db import models, datetime, M
21 matches
Mail list logo