django

Can I give the same name for different Models in different apps?

Can I give the same name for different Models in different apps? and What conflicts can happen? After I have a try.. I got this Error: Error: One or more models did not validate: playlist.playlist: Accessor for field 'user' clashes with related field 'User.playlist_set'. Add a related_name argument to the definition for 'user'. audio_p...

Buildout, psycopg2, postgresql

I'm trying to make buildout config that installs psycopg2 egg and postgres from source if needed: parts = ... postgre psycopg2 ... [postgre] recipe = hexagonit.recipe.cmmi url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz configure-options = --without-readline [psycopg2...

Django or Ruby on Rails - user extensions, plugins

Which framework has the most mature, flexible, intergrated, centralized and easy-to-use plugins/extension system. My main requirements are: a centralized system/repository where i could find a extension i need no need to make changes in the source code, the plugin should be easily enabled and disabled large plugin/extension database ...

Django 0.96 and url

I want to get the absolute url of a given action in Django 0.96 (using Google App Engine). I have this url configuration: from django.conf.urls.defaults import patterns urlpatterns = patterns('framework.facebook',(r'^canvas/invite_friends$','views.inviteFriends'), ) In my template: window._url = '{% url views.inviteFriends %}'; I...

Amazon api giving a 403 forbidden error.

I'm using Django to display a form which allows users to submit a book title which will make a request to Amazon to find the information about a book and return the results. However, i keep getting a 403 Forbidden error. I have no idea why. But the code is working, because whenever i use the script without Django, i receive the book inf...

get all instances from related models

I have one problem Looking below: i have this model class Shoes(models.Model): shop = models.ForeignKey(Store, related_name="%(class)s") name = models.ForeignKey(ShoesItem) size = models.ManyToManyField(ShoesSize, help_text=_("Get useful sizes")) price = models.IntegerField() ...

Iterating over items in search result view with django haystack MultiValueField

If I have a MultiValueField on one of my search indexes and I want to display each value in the search results, how would I do that? It seems like something is not being formatted appropriately or I am somehow misunderstanding the MultiValueField. class PageAttachmentIndex(indexes.SearchIndex): # This should reference search/indexes/pa...

Chart apps for django

I'm building an application in django and I'd like to have a reports section. The charts will be used to disply numerical values between different dates. I tried GoogleChartWrapper but I'm looking something more flexible and nicer. Thanks. ...

Synchronizing Flickr With Django

Hello. I am trying to synchronize flickr with django. I am using django-syncr app. But i stacked in somewhere. Database syncdb is ok. But how do we sync the images? Where do we write below code. from syncr.app.flickr import FlickrSyncr f = FlickrSyncr(API_KEY, API_SECRET) f.syncRecentPhotos('username', days=7) f.syncPublicFavorites('...

Django- populating an "update/edit" form with an autofield and foreignkey

Hello- I'm new to Django and I'm creating an app to create and display employee data for my company. Currently the model, new employee form, employee table display, login/logout, all works. I am working on editing the current listings. I have hover on row links to pass the pk (employeeid) over the url and the form is populating correctl...

Error in Django-nonrel : 'ModelOptions' object has no attribute 'db_table'

I tried to install the django-messages 3rd party application to my Django-nonrel / App Engine project. However it threw the error: 'ModelOptions' object has no attribute 'db_table' Request Method: GET Request URL: http://localhost:8090/ Django Version: 1.3 pre-alpha Exception Type: AttributeError Exception Value: 'ModelOptions'...

built-in django.contrib.auth.models.User VS own User model?

Hi, I'm writing a web app using the django framework and I was just wondering what are the pros/cons of using the built-in django.contrib.auth.models.User model over my own user model? Please explain in terms of performance, scalability and security. Many thanks ...

android to django - how to authenticate users

Hi all I'm trying to get json data from a django view (login required) into a new android app I'm working on. I would like to authenticate the user against the django login and keep the cookie/session for all the django view calls to get data from the server. I did some googling but nothing helped me, even if I guess it should be a q...

JQuery post not passing variable

I'm trying to pass an image's src to a django view when a button is clicked. In my template, I have: $("#url_submit").click(function() { var film = "{{ filmname }}" var id = {{ id }} $.ajax({ url: "/db/gallery2/" + film + "/" + id + "/", data: {url: $('#large_thumbnail').attr('src')}, type: "POST" }); }); ...

How can I distinguish lists from strings in django templates

I'm developing a project on Google AppEngine, using Django templates, so I have to use tags like {{ aitem.Author }} to print content within my HTML template. Author, however, can either be a string or a list object, and I have no way to tell it in advance. When the Author is a list and I try to print it on my template, I get the ugly re...

Using Django ORM outside of Django throws ImportError on assigning to the FK

When using the Django ORM from an external shell, using a model with a ForeignKey field an ImportError is thrown when assigning to it. And here is a paste of my shell sessions both from ./manage.py shell and from normal python shell. bradyrj@machine:~/workspaces/django/shellgame$ python manage.py shell Python 2.6.6 (r266:84292, Sep 15 ...

django - too many options when lanuching dbshell sqlite3

I have django 1.2.3.0 Final and I am using Python 2.7 In my setting, I have 'sqlite3' filled for the DATABASE_ENGINE. I am able to work with the sqlite3 (at the level of djano manage.py shell) until I am told that I need to access python manage.py dbshell At first I got the error "sqlite3 is not recognized...." Then I read thread...

Migrating Django fixtures?

I have a Django application. I have .json fixture files containing test data, with unit tests that use the data to confirm the application is working properly. I also use South to migrate my database. After doing a few database migrations, my fixtures are out of date, because the database has migrated, adding a new database column, ...

django change_form.html problem

Hello, i'd like to pass an argument {{x}} to my custom file change_form.html, which is located in /home/django/project/app/template/admin/change_form.html. i found this code but it doesnt work. thx for any help class MyModelAdmin(admin.ModelAdmin): # A template for a very customized change view: change_form_template = 'admin/cha...

Amazon API signed requests isn't working properly.

Here's the code: import urllib2 import base64,hashlib,hmac,time from urllib import urlencode from xml.dom import minidom AWS_ACCESS_KEY_ID = "secret" AWS_SECRET_ACCESS_KEY = "secret" base_url = "http://ecs.amazonaws.com/onca/xml" url_params = {"Version": "2010-09-01", "Operation": "ItemSearch", "ResponseGro...