I have a User Profile which is currently shown in the Admin via a Stacked Inline. However because I have fields such as last_name_prefix and last_name_suffix (for foreign names such as Piet van Dijk to cover proper sorting by last name) I would like to be able interleave the user profile fields with the normal change user fields. So in t...
The problem:
I have some hierarchical data in a Django application that will be passed on through to javascript. Some of this data will need to be filtered out from javascript based on the state of several data classes in the javascript. I need a way of defining the filters in the backend (Django) that will then be applied in javascript...
Warning: I've found a weird reason for this behaviour. The question below is obsolete. Here is the followup for all the gory details.
Setup:
A production server running SuSE Enterprise 11 and my Django 1.1 application.
The application is being served with Apache (mod_wsgi) over HTTPS with client certificates (SSLVerifyClient require...
Hello.
I'm developing an advertising site. Want to use Web-Services for the requests. I mean, a publisher site will put a JS snippet and it will pull a banner through a REST GET.
Is this framework mature enough to implement this functionality?
Thanks
...
I have three inputs coming in from a form. They are name, neighborhoods and tags. Neighborhoods and tags are multi-select box string lists. Here is my current query:
q = Restaurant.objects.filter(name__icontains=name)
q = q.filter(neighborhoods__name__in=neighborhoods)
for tag in tags:
q = q.filter(tags__name=tag)
q = q.order_by('na...
We have been successfully running a Django site for a couple of years. We use the following (standard) google analytics code for most of our pages.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga...
Hi all,
I am preferring to manually migrate my tables in Django. Because using automated tools puts me in a place where I cannot see the impact. With impact, I mean the the time it takes the db get in synch with my models. Below is a simple example:
class User(models.Model):
first_name = CharField(..)
Let's say I want to add this:...
I've got a weird problem here: I'm getting a 500 error code from Apache serving a Django 1.1 application when the length of the path part of the URL given to Apache is in [23..26,30..33]. For example, http://server/012345678901234567890123 results in a 500 error while http://server/012345678901234567 does not.
Each 500 error also result...
I have been working on developing some RESTful Services in Django to be used with both Flash and Android apps. Developing the services interface has been quite simple, but I have been running into an issue with serializing objects that have foreign key and many to many relationships.
I have a model like this:
class Artifact( models.Mod...
I have the following model and url routes. There is one Post model that I want to route to different URLs based on the category. Is there a way to do this by passing in extra information in app/urls.py?
In app/posts/models.py
class Post(models.Model):
author = ...
title = ...
body = ...
category = models.CharField()
...
I've got an application that allows you to filter data via 3 fields. I'm trying to write a RegEx in my urls.py that can capture multiple combinations without having to write-out each possible combination it it's own URL.
Here's my urls.py:
#urls.py
urlpatterns = patterns('',
# Uncomment the next line to enable the admin:
(r...
I have four models with the relationships
Model PagetTemplate(models.Model):
pass
Model TextKey(models.Model):
page_template = models.ForeignKey(PageTemplate, related_name='text_keys')
Model Page(models.Model):
page_template = models.ForeignKey(Pagetemplate, related_name='pages')
Model Text(models.Model):
key = model...
I am somewhat new to Django and have searched for some simple examples of creating objects with subobjects in views so that in templates I can have nested for loops.
Here is my models.py for this application...
from django.db import models
from django import forms
class Market(models.Model):
name = models.CharField('Market name'...
I'm in the midst of creating an alarm/notification system for a small Sales CRM app.
I have a Lead_Contact model that is used to store a client's name, address, etc. as well as a Contact_Notifier models that is being used to keep track of when a client was first contacted, the last contact, and when we are going to next contact them.
F...
Prior to today, I've been using Django 1.1. To ensure I'm keeping up with the times, I decided to update my Django environment to use Django 1.2.3. Unfortunately, I've encountered an issue.
The following code did not raise a ValueError in 1.1:
instance = FormClass(
request.POST,
instance=existing_instan...
Since Django has its roots in news websites, I'm surprised that I haven't been able to find any good modules for working with DoubleClick / DART ads.
I'm going to being doing some DoubleClick integration, and I'd hate to have to reinvent the wheel so if an existing project exists, I'd appreciate a point in the right direction.
edit: I ...
I need to order_by a field comparison such that all fields matching a certain value are displayed at the top.
The SQL to do this is SELECT * FROM messages ORDER BY message='alsfkjsag' DESC
...
Hi,
I'm using django currently and outputting the date in seconds from the unix epoch. How do I use jquery time ago with unix epoch?
I see this example:
January 10, 2015
<abbr class="timeago" title="2015-01-10T15:00:00Z">January 10, 2015</abbr>
but can i do something like:
<abbr class="timeago" title="2015-01-10T15:00:00Z">{{UNI...
Hey!
I am trying to add additional fields to the default User model. I had a look around the internet and done something like this:
Made a new model named UserProfile with the following in /UserProfile/models.py:
from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
# This is the...
I have banged my head over this for the last few hours.
I can not get {{ MEDIA_URL }} to show up
in settings.py
..
MEDIA_URL = 'http://10.10.0.106/ame/'
..
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.media",
)
..
in my view i have
from django.shortcuts import ren...