Hey guys!
So, I'm writing something and I've come into a roadblock on how to do it (and what is the proper way of doing things). SO, explaining the situation will help be better understand the problem, and hopefully someone will know the answer :) Here it goes:
Basically, I'm writing up some dynamic forms in Python (more specifically D...
I'm trying to get started with Django, and have previously worked with CakePHP, and so my MVC background comes out of that. I'm aware of Django's slightly different MTV architecture, and am fine with the monolithic model files - multiple classes in one file I can handle just fine.
But I'm confused about how to do the views (which are r...
I had django-piston working a week ago but recently I'm unable to call any web services. Below is a simple example. I have a 'test' service that returns 'yes' if there is a content type and 'no' if content type is null. I've done this because I get HTTP 500 errors when I do a POST and try to parse my parameters via 'data = request.data'....
I'm trying to figure out which image management library to use on django. What is the difference between photologue, image-kit, and pil(python imaging library)?
...
My company is working on an application that is half Qt/C++ for the editor interface and half Django (via QtWebKit browser control) for the runtime. What we want to do is distribute a minimal python installation with our application.
For instance, our Mac app bundle would ideally be structured something like this:
TheApp.app/
Conte...
I have complex models and would like to just 'dump' some querysets to see exactly what they contain from view code.
I tried the generic list_detail (from urls.py) - but it appears to require writing a template.
Is there a way to dump data from a view (like how json is saved) that will work with anything passed?
...
Hi all,
I've been looking for a way to download an image from a URL, preform some image manipulations (resize) actions on it, and then save it to a django ImageField. Using the two great posts (linked below), I have been able to download and save an image to an ImageField. However, I've been having some trouble manipulating the file ...
Forgive me if this question makes little sense; I have had little sleep as of late.
I want to send a notification to the user whenever a signal fires via django's messages module, but I am at a loss as to how to pass the request object to the messages.success method.
I'm doing this because whenever a user gets a badge I need to tell hi...
I've created a Feed subclass to export a simple feed of news
#urls.py
from django.conf.urls.defaults import *
from litenewz.feeds import NewsFeed
feeds = {
'news': NewsFeed,
}
urlpatterns = patterns(
'',
(r'^feeds/(?P<url>.*)/$',
'django.contrib.syndication.views.feed',
{'feed_dict': feeds}),
)
#feeds.py
from d...
Hi. I was wondering if something can shed some light on where I might be going wrong with this.
I need to generate a signed Key for use with Gigya an openauth platform
This is a rework from their Ruby info,
http://wiki.gigya.com/020_Developer_Guide/70_Server_Side_API_(REST)#tab-2
Here is what I have thus far.
#@ escape the status mes...
Sometimes I need to use the same html code in different templates, like:
<div class="mylist"><span>item-1</span><span>item-2</span>...</div>
or more complicated widgets. I'm new to Django so I want to learn what do you usually do in these kinds of situations? Do you create your own template tags or what?
...
Hi all,
I'd like to sanely quiet a few pylint errors when using Django. The two that are causing the greatest irritation are when deriving from django.db.models.Model and accessing objects, and django.test.TestCase. In the first, pylint complains about any code that uses the attribute 'objects', saying it isn't a member. In the second...
Hi all,
I am working on an application using Google application engine and Django. I am using app engine patch. Some of the models have ReferenceProperty fields.
The issue is that when I am deleting some entries of the Referenced model, it should delete the entries where this ReferenceProperty is being used following the foreign key k...
Hi guys, Django newbie here
I know that I can change the encoding of a table by writing my own south migration.
My question is, is there a way doing it by changing my model and using
./manage.py schemamigration my_app --auto
?
...
I have the following model
class Team(models.Model):
name = models.CharField(max_length=100)
members = models.ManyToManyField(User, related_name="members", blank=True, null=True)
And the following view
def team_details(request, team_id):
# Look up the Team (and raise a 404 if it is not found)
team = get_object_or_404...
I'm writing a custom template tag 'firstnotnone', similar to the 'firstof' template tag of Django. How to use variable length arguments? The code below results in TemplateSyntaxError, firstnotnone takes 1 arguments.
Template:
{% load library %}
{% firstnotnone 'a' 'b' 'c' %}
Custom template tag library:
@register.simple_tag
def firs...
How to decode the values from request from django FW.
GET:<QueryDict: {}>,
POST:<QueryDict: {u'objarrid': [u'1035', u'1036', u'1037', u'1038', u'1039', u'1040', u'1041', u'1042']}>,
def get_data(request):
try:
if request.method == 'GET':
r_c = request.GET
elif request.method == 'POST':
r_c = request.POST
except:...
I'm looking for a way to have jquery automatically change the content of a <div> upon its creation in a page.
What I'm doing, specifically, is to use jquery to load django templates into the page. Some of those templates contain s that I want to immediately alter as soon as they come into the browser.
As a simple example, what I'd like...
I have a model which needs to store URLs which will be part of the Django environment. If I was storing normal URLs, I'd use models.URLField, and use verify_exists to make sure the URL actually exists.
However, this doesn't work that great in development, since the dev server is single-threaded, it hangs indefinitely, since it can't pro...
Hello,
In my Django web app, an event's status changes from 'upcoming' to 'completed' at a certain date/time. However, I want to update the database as soon as the event object's date/time has passed. Any ideas how I would code this?
My only idea so far is to have a thread constantly running that that checks to see if the event object'...