You cannot do something after the "return" line. This is Python
functionality. When you return, the function exits and does not process
anything else.
What exactly are you trying to do? There is probably another way to
accomplish it.
--
You received this message because you are subscribed to
It's this line:
PythonOption django.root /var/www/project
Change that to / or anything else and you should be all set.
On Wednesday, June 19, 2013 10:32:12 AM UTC-4, Jiří Kupka wrote:
>
> Hi! I have little trouble with reverse function in my project. When I run
> it over ./manage runserver, eve
gets do you know as some of
> these are choice fields i.e. non text and non integer fields
>
>
> On Wed, Jun 19, 2013 at 1:26 PM, Timster
> > wrote:
>
>> Where are you setting that? readonly_fields is for ModelAdmin when you
>> are working with the admin app.
>&g
Where are you setting that? readonly_fields is for ModelAdmin when you are
working with the admin app.
If you want to do it in a normal form, you will need to set readonly
attribute on the widget.
--
You received this message because you are subscribed to the Google Groups
"Django users" grou
By setting "initial" on a field, you are not changing the list of available
options. Setting the initial like this determines which of all the
locations are selected when the form is shown for the first time. The
default would be to select the location for the event, but you are
overriding that
You need to return initial from the method.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, sen
Are you including any other apps that are not located under your project
folder?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/et1JsOmLoUQJ.
To post to t
It's well-documented. Check out the Django documentation page on time zones:
https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/
When time zone support is enabled, Django uses time-zone-aware datetime
objects. If your code creates datetime objects, they should be aware too.
In this mod
After saving the form, instead of doing a render_to_response, you should
redirect the user to another page.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-
What does the rest of your views.py file look like?
Do you happen to have a view named login()?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/ANUnnrLEVB8
Well, do you have an app named "world" in your INSTALLED_APPS setting?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/jvL-1nGXQxEJ.
To post to this group,
Picture the following model and admin:
class Section(models.Model):
position = models.PositiveIntegerField(editable=False)
title = models.CharField(max_length=200)
class SectionAdmin(admin.ModelAdmin):
list_display = ['title']
ordering = [ 'position']
The position is a column tha
That's not a bad solution.
I just came up with a solution I'm very happy with. I created a custom
manager that only returns visible objects.
This way I can just do categories = Category.objects.all() and
category.forum_set.all() in my template and it will only display
visible objects. It works g
Yuck. I don't want to do it that way. It couples the display logic with
the template. If I ever need to change the criteria that determines
when to display forums/categories, I will need to change it in two
places (view and template).
--~--~-~--~~~---~--~~
You rec
To start off, I have two models:
class Category(models.Model):
name = models.CharField(maxlength=50)
visible = models.BooleanField(default=True)
class Forum(models.Model):
category = models.ForeignKey(Category)
name = models.CharField(maxlength=50)
visible = models.BooleanFie
Thanks for the reply Ian.
I seem to have solved this for the most part. The second message in
that thread was very helpful. I was able to use that solution almost
exactly. I added the following save() method to my model:
def save(self):
if self.image:
import shutil
from os im
I'm trying to create a simple image gallery. Here's what my models look
like. It's very simple, a gallery can have one or more images.
class Gallery(meta.Model):
name = meta.CharField(maxlength=50)
class Image(meta.Model):
gallery = meta.ForeignKey(Gallery)]
image = meta.ImageField(u
I think you may be able to do v.freshness.verbose_name.
--~--~-~--~~~---~--~~
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
To unsubscribe from th
to access the built-in admin site, I get the
following error:
AttributeError at /admin/
'WSGIRequest' object has no attribute '_user_source'
/home/timster/django_src/django/core/handlers/wsgi.py in _get_user
124. self._user = self._user_source.get_user(self)
To the bes
19 matches
Mail list logo