I want to create a list of distinct month / year values based on a date fields in my db.
So for example in my table I have
id | date_added | title
1 | 01/06/2010 | ????
2 | 02/09/2009 | ????
3 | 24/08/2009 | ????
4 | 15/06/2009 | ????
5 | 16/06/2009 | ????
and this table is from model article
how would I create a list of:
[...
So I have 3 django sites running on a development server.
2 of them work fine.
The third and last one unfortunately does not show the admin.
The error I get:
TemplateDoesNotExist at /admin/
Django tried loading these templates, in this order:
* Using loader django.template.loaders.filesystem.load_template_source:
o /...
How can I drop all tables from database using mannage.py and command line? Is there any way to do that executing manage.py with appropriate parameters so that to execute it from .NET application?
...
Hi,
I was working on a many-to-many model with extra fields and i saw the documentation
for extra fields in many to many relations
on their exemple, to create a membership they use
m2 = Membership.objects.create(person=paul, group=beatles,date_joined=date(1960, 8, 1), invite_reason= "Wanted to form a band.")
but that means that they...
Hi there,
I am a total beginner to programming and Django so I'd appreciate help that beginner can get his head round!
I was following a tutorial to show how to upload images to an Amazon S3 account with the Boto library but I think it is for an older version of Django (I'm on 1.1.2 and Python 2.65) and something has changed. I get an ...
I understand request.sessions dictionary and how to use this.
However, it appears that values set using request.sessions is only valid while the user is logged in.
I need to set a persistent cookie that lasts for a fixed time period and not dependent on whether the user is logged in or not.
What I would like is to store a value for...
Hay I was wondering if anyone knew a better way to do this.
def login_user(request):
username = request.POST.get('username')
password = request.POST.get('password')
user = User.objects.filter(username=username)
if user:
user = user[0]
if user.password == generate_password(password):
return H...
I have a website which users can sign up to using Facebook Connect (with the new OAuth 2.0 stuff). Now when a user logs out of Facebook they remain logged-in on my site.
I'm not using the JavaScript SDK as I don't like the "magic behind the curtains". So what should I do when a user logs out of Facebook? Should I care at all? I get the ...
Hi,
In my application I have a model that looks like this:
class Talk(models.Model):
title = models.CharField(max_length=200, primary_key=True)
speaker = models.CharField(max_length=200)
date_of_talk = models.DateField('date_of_talk')
def __unicode__(self):
return self.title
class Member(models.Model):
name...
Does anyone know if there is a version of django-filebrowser-no-grappelli-optional-uploadify that is compatible with Django 1.1? I tried this version...
http://github.com/alexvasi/django-filebrowser-no-grappelli-and-uploadify
...but I'm getting an error, and I presume that's because it only supports Django 1.2, since the oriignal Fileb...
Hi, I'm working with an iPhone developer who does not have any Django experience, and I am relatively new to Django. I've built an existing Django app with a web interface that allows a user to log in and add books from our database to his personal library.
We are trying to build an iPhone application that allows a user to authenticate ...
I have a form class that looks like this:
class ApplicationDetailsForm(ModelForm):
worked_in_industry = forms.TypedChoiceField(coerce=int,
choices=((1, 'Yes'), (0, 'No')),
widget=forms.RadioSelect())
class Meta:
model = ApplicantDetails
fields = ('work_experien...
Hello,
I would like to write a simple server-push implementation either using long pooling or comet that integrates into the server.
I don't want to use a networking framework like twisted because I want to learn how everything is done internally.
What exactly should I learn?
What specifications should I look at?
I prefer something that ...
Hello all,
PostgreSQL / Django / newbie here.
I've got a bunch of JSON data with venues and lat/long information, and I'm looking to import it into my database. So far I've fenagled a script to format my JSON into SQL statements, so I can import them with a slew of INSERT statements.
But my 'location' field (a PointField) is giving me...
Hi,
Is there way to work with drupal beautiful themes and display django content?
I have site written with Django, and I now needs to build templates and some design site to display it..
How can I use drupal for this target?
Thanks..
...
Is there a way in Django templates to show a heading for a field (name of the field) only if the field has a value.
For instance if one of the fields was called Year Established it might look something like this.
Year Established: 1985
But if the field was empty then it wouldn't show Year Established like this.
Year Estabished:
I k...
Given the following two models:
class Card(models.Model):
disabled = models.BooleanField(default=False)
class User(models.Model):
owned_cards = models.ManyToManyField(Card)
Given a certain user, how can I, in one query, get all the Card objects that are not disabled, and are also present in that user's owned_cards field?
...
I have a model that has a template_name field and I have this generic view:
url(r'^/post/(?P<slug>[a-zA-Z0-9_.-]+)$', 'django.views.generic.list_detail.object_detail', {
"template_object_name" : "post",
'template_name': 'post_details.html'
}, 'index')
How can I replace the template_name from 'post_details.html' t...
I'm having some trouble trying to understand how to create a dynamic choice field in django. I have a model set up something like:
class rider(models.Model):
user = models.ForeignKey(User)
waypoint = models.ManyToManyField(Waypoint)
class Waypoint(models.Model):
lat = models.FloatField()
lng = models.FloatField()
...
My organization currently delivers a web application primarily based on a SQL Server 2005/2008 back end, a framework of Java models/controllers, and ColdFusion-based views. We have decided to transition to a newer framework and after internal explorations and mini projects have narrowed the choice down to between Python and C#/.NET.
Le...