Thanks again for your reply Ulrich. I finally figured out the problem :)
Towards the bottom of my settings.py I had mistakenly overwritten the
LANGUAGE_CODE as follows:
LANGUAGE_CODE = 'en'
Django must determine the locale internally based on the LANGUAGE_CODE
specified. Needless to say this
On Mon, Sep 8, 2014 at 5:08 PM, Артём Мутерко wrote:
> I need to list all values from request.META in Django using template.
>
> I've done it without template like this
> (code from my views.py)
>
> def display_meta(request):
> values = request.META.items()
> values.sort()
> html = []
> fo
Dear Jay,
glad that it works now.
I got myself confused about terms such as language name and locale name.
Setting the locale via locale.setlocale does indeed have no influence on
the Django settings. I knew that but I misunderstood you. I set
locale.setlocale in the example because I wanted to
Instead of "for team in {{l}}{{d}}" you should be able to do "for team in
l.d" IIRC.
TBH I haven't tried it and I'm on my phone so I can't run a quick check.
This SO post also has some hints on running nested loops:
http://stackoverflow.com/questions/13870890/django-template-counter-in-nested-loop
Scratch that, I misread what you were trying to do, but became clear when I
looked at your context a bit closer. You want to concatenate two strings
and use that as the variable lookup.
You can probably do that using a combination of the {% with %} tag and the
'add' filter (which works on strings
I have the following to model a calendar entry (recurring event). I need
the ability to retrieve all events from the database between a start and
end date. This has to include one off events and also recurring "virtual"
events that occur because of an event in the database. Do you think this is
hey Stodge,
Interesting question :)
My guess is there are probably a number of approaches one can take. Of
course, processing all your entries in python "on the fly" would
probably get to be quite an intensive operation.
One possible idea maybe to create a "cache" table of sorts where you
pre-ca
On Fri, Sep 19, 2014 at 11:13 AM, James Schneider
wrote:
> Scratch that, I misread what you were trying to do, but became clear when I
> looked at your context a bit closer. You want to concatenate two strings and
> use that as the variable lookup.
>
> You can probably do that using a combination
Hello,
*To follow my preceding question, on customize admin view, (*Helton Alves
gave me a nice response).
I am wondering how to filter a list in change_form.html admin form,
according to a partuculiar user ?
Thank you for your help
Regards
--
You received this message because you are s
Take a look at:
https://github.com/llazzaro/django-scheduler
also available on PyPI:
pypi.python.org/pypi/django-scheduler/
It's very similar to what you have done so far. It handles virtual events
('occurrences') by generating them on the fly for a requested date range.
Individual occurrences
On 09/18/2014 10:50 PM, James Bennett wrote:
> Are you using any third-party libraries which were installed as eggs?
>
Sorry, but was that supposed to be a hint to say "Don't use eggs"? I can
see why it may fail looking for '__file__', but I don't understand
why that is acceptable. Surely there s
I have generated a very simple test project using a fresh copy Django 1.7.0
with a model that has a PositiveSmallIntegerField, it is attached to this
post. The ORM is not preventing instances being created with that field's
value set to -1
>>> django.VERSION
(1, 7, 0, 'final', 0)
$ python man
I want to redirect user after logout to another page, not account/logout.
Hoe can I do this?
I've red documentation, but can't understand where to find next_page
variable
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
Something like this might work:
class MySitemap(sitemaps.Sitemap):
def items(self):
urls = []
for obj in Store.objects.all():
urls.append((obj, ''))
urls.append((obj, 'about'))
urls.append((obj, 'contact'))
return urls
def locati
Yes, this seems to be the usual problem with inheritance.
You need to do something scary like
workshop_job.__dict__.update(job.__dict__) so that your workshop_job object
will actually have all of the info from the job, like date_opened.
--
You received this message because you are subscribed t
You can't get it sorted (you would need a template filter for that), but:
{% for k, v in request.META.items %}{{ k }}{{ v }}{%
endfor %}
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails f
so if you go to http://myproject.de:8001/static/some-file-in-myproject.css
it works fine, but if you go
to http://myproject.de:8001/static/admin/js/jquery.js you get a 404 Not
Found?
Are the files you're looking for actually in webapps/sonar3/static?
--
You received this message because you a
Are you uploading a file using apache? It could be the /etc/apache2/envvars
issue.
Are you ever using string formatting like "something %s something" %
something ? If so, use unicode_literals or change that to a unicode string:
u"something %s something" % something
--
You received this messag
class Dish(models.Model):
resturant = models.ForeignKey(Resturant)
name = models.CharField(max_length=255)
--
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
t
Wow. It took a lot of digging, but your situation is documented in
https://docs.djangoproject.com/en/1.7/topics/forms/formsets/#django.forms.formsets.BaseFormSet.can_delete
another thing that might also work in your case:
def save_formset(self, request, form, formset, change):
for form in fo
This happened to me once when using django.contrib.comments. It turned out
there was an exception happening in the template rendering that was getting
silenced.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and
if nothing else:
{% for item in list %}{% if item.user = user %}
{% endif %}{% endfor %}
--
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.
Yes. I believe that type of validation only happens in forms, or if you
manually call obj.full_clean().
--
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-u
from django.contrib.auth.views import logout
urlpatterns = [
url('^/accounts/logout/', logout, {'next_page': '/'}),
]
--
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
or send them to /accounts/logout/?next=/another/page/
--
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
Hi Everyone,
I wonder if there is any good, stable and trusted django or python package
that can convert dict to xml, and load xml into dict, just like what the
json package does.
Thanks
--
⚡ Chen Xu ⚡
--
You received this message because you are subscribed to the Google Groups
"Django user
Ah! OK, it's not just me then. Good.
It's a usual inheritance problem? I've never seen it with o2m or m2m
relations? I think I'll just change them to o2m and check to make sure
there's only one in the save method - seems clearer -easier to read
for !me, and less scary.
Thanks for your help
L.
O
On Sat, Sep 20, 2014 at 2:17 AM, Christopher Welborn
wrote:
> On 09/18/2014 10:50 PM, James Bennett wrote:
> > Are you using any third-party libraries which were installed as eggs?
> >
>
> Sorry, but was that supposed to be a hint to say "Don't use eggs"? I can
> see why it may fail looking for '
On 09/19/2014 08:26 PM, Russell Keith-Magee wrote:
> So - James' comment should be interpreted as "Are you using eggs? Well,
> there's your first problem". If you're actually using eggs, I'd strongly
> encourage you to consider why, because there's almost certainly a better
> way to distribute your
Hmm, the problem is that there doesn't appear to be any way to turn off the
creation of the migrations table itself, even if all of the other models
are set to managed=False as suggested by Nikolas. I've commented it out for
now but it would be ideal to have some way of turning it off completely
XML is more complex than JSON and AFAIK there isn't a generic tool to do
this. I work with XML all the time with Python/Django and I would only
recommend lxml http://lxml.de/
On Fri, Sep 19, 2014 at 9:39 PM, Chen Xu wrote:
> Hi Everyone,
> I wonder if there is any good, stable and trusted
I guess you're probably using SQLite as the database engine. "unsigned
integer" and "signed integer" belong to same affinity in SQLite
(http://www.sqlite.org/datatype3.html). Even if you specify "unsigned
int" for the column during creation, you can save negative values
without any error.
If you us
32 matches
Mail list logo