entered
but i don't know if you can do this with a model based form or if you
have to manually create it.
On 27 July, 12:35, Daniel Roseman wrote:
> On Jul 27, 12:15 am, AKK wrote:
>
> > Hi, I have a form based on a model which allows users to add comment.
> > A comment is
Is there a way to do this or should i create my own form manually?
Andrew
On Jul 27, 12:15 am, AKK wrote:
> Hi, I have a form based on a model which allows users to add comment.
> A comment is made up of the comment is about, the body, the date and
> time and also who made the comme
Hi, I have a form based on a model which allows users to add comment.
A comment is made up of the comment is about, the body, the date and
time and also who made the comment.
I am mainly interested in the datetime and user fields. What i would
like to know is how i can automatically have these en
Thank you, got it working
On 21 July, 16:55, Daniel Roseman wrote:
> On Jul 21, 4:25 pm, AKK wrote:
>
>
>
> > Thanks, i tried this:
>
> > blog_posts = Post.objects.filter(post_slug=slug)
> > blog_comments = blog_posts.comment_set.all()
>
> >
Thanks, i tried this:
blog_posts = Post.objects.filter(post_slug=slug)
blog_comments = blog_posts.comment_set.all()
but i got this error and i don't know why:
Traceback:
File "C:\ProgLangs\Python25\lib\site-packages\django\core\handlers
\base.py" in get_response
86. response =
Do i need to have a one to many or many to many field for this to
work?
Thanks
Andrew
On 20 July, 22:24, AKK wrote:
> Hello, i currently have two classes in my model:
>
> class Post(models.Model):
> prepopulated_fields = {"post_slug": ("post_title",)}
>
Hello, i currently have two classes in my model:
class Post(models.Model):
prepopulated_fields = {"post_slug": ("post_title",)}
post_title = models.CharField(max_length=750)
post_slug = models.SlugField()
def __unicode__(self):
return self.post_
Thanks, this is what i wanted.
On 20 July, 20:02, Alex Gaynor wrote:
> On Mon, Jul 20, 2009 at 2:00 PM, AKK wrote:
>
> > I kinda know what the problem is here but don't know how to fix it.
>
> > I have this model class Comment(models.Model):
>
> > com
I kinda know what the problem is here but don't know how to fix it.
I have this model class Comment(models.Model):
comment_post = models.ForeignKey('Post')
comment_date = models.DateTimeField('Date comment made')
comment_body = models.TextField()
comment_spam = models.BooleanFiel
Hi, i have a login form using the generic view like so:
(r'^accounts/login/$', 'django.contrib.auth.views.login',
{'template_name': 'blogSite/login.html'}),
but i only want the form to show up if your not logged in, but since
its is a generic view how can i use
if not request.user.is_authentica
hi,
i have a form like this:
User name:
Password:
and the next field is where the user should be redirected assuming
they have the correct details.
When they login i want them to be redirected to myurl.com/blog/ but
what i have above redirects them to myurl
I'm still abit confused.
Does that mean this part in the book is wrong?:
def search(request):
if 'q' in request.GET:
message = 'You searched for: %r' % request.GET['q']
else:
message = 'You submitted an empty form.'
return HttpResponse(message)
I also tried what you
Hi,
I'm working through chapter 7 of the djangobook online. and i've got
the following:
def search(request):
if 'criteria' in request.GET:
message = 'You searched for: %r' % request.GET['criteria']
else:
message = 'You submitted an empty form.'
return HttpResponse(mes
Thanks, thats worked fine. I don't know why my original message has
reproduced itself.
Regards,
Andrew
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
Hi,
I've got the django adming setup but if i look at posts for example i
just get a with post object loads of times. How can i it so it
displays the post title?
In my admin.py i have:
admin.site.register(Post)
and the model is:
post_title = models.CharField(max_length=750)
.
post_t
Hi,
I've got the django adming setup but if i look at posts for example i
just get a with post object loads of times. How can i it so it
displays the post title?
In my admin.py i have:
admin.site.register(Post)
and the model is:
post_title = models.CharField(max_length=750)
.
post_t
Hello,
I have a number of views and templates and a list of categories which
i get from my models using:
categories_list = categories.objects.all()
Since i need to display this in multiple (but not all) templates is
there a better way to achieve this than just putting; categories_list
= categor
I added a comma and it worked fine. And i've learned something, i only
thought you needed a comma if there where multiple items.
Many Thanks,
Andrew
On 2 Mar, 00:10, Malcolm Tredinnick wrote:
> On Sun, 2009-03-01 at 14:40 -0800, AKK wrote:
> > Is this
st the code from
> your setting.py file where you specify your processors? Not just the
> strings, but the entire Python structure where you define those.
>
> On Mar 1, 7:51 am, AKK wrote:
>
> > Having looked at the traceback i gather its something to do with the
> > impor
Having looked at the traceback i gather its something to do with the
imports:
Environment:
Request Method: GET
Request URL: http://localhost:8080/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.se
Thank you. I had forgotten the context instance part but now i've
added that as below:
"render_to_response('blogSite/index.html', locals(),
context_instance=RequestContext(request))"
and i get:
Exception Type: ValueError
Exception Value: Empty module name
but if i take out reque
If you have windows you may want to try this version
http://groups.google.com/group/django-users/msg/5b5f4dee148d0fc3
There wasn't an mysqldb module exe version available for python 2.6
when i looked a few weeks ago.
I installed that and its worked fine.
Andrew
On 28 Feb, 14:23, ches wrote:
>
Actually i thought i have but i haven't, i added:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.media"
)
to my settings.py (it didn't seem to be in there by default, i don't
know if thats supposed to be the case).
Then when it didn't work i tried creating a simple template
Managed to get it working. Thanks for the help.
Andrew
On 28 Feb, 00:36, Malcolm Tredinnick wrote:
> On Fri, 2009-02-27 at 11:53 -0800, AKK wrote:
> > Sorry I must mean the media url. Are the media_root and the media_url
> > automatically linked?
>
> No. The MEDIA_RO
Sorry I must mean the media url. Are the media_root and the media_url
automatically linked? In my settings.py i have:
C:/Program Files/Apache2.2/myproject/
media/ as the root &
http://localhost:8080/akonline/media/
as the url
and i have an image (imgs/img.jpg) in my C
Hi,
I have a template and I want to get some images out of my media root.
I was wondering is there anyway to automatically return the media root
from settings.py rather than manually specifying it rather each time.
Thanks
Andrew
--~--~-~--~~~---~--~~
You received
Thanks a lot. I guess, I was not reading it well.
On Jul 24, 4:55 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/24/07, akk <[EMAIL PROTECTED]> wrote:
>
> > Traceback (most recent call last):
> > File "", line 1, in
> > File &q
File "", line 1, in
File "/usr/lib/python2.5/site-packages/django/db/models/base.py",
line 40, in __new__
model_module = sys.modules[new_class.__module__]
KeyError: '__console__'
Thanks a lot,
akk
--~--~-~--~~~---~--~~
You rec
28 matches
Mail list logo