My Models:
OrderInfo is one-to-one with Print, which is a Many-to-One with Painting, which itself is a Many-to-One with Club.
class OrderInfo(models.Model):
print_ordered = models.OneToOneField(Print, blank=True)
class Print(models.Model):
painting = models.ForeignKey(Painting)
class Painting(models.Model):
club = models....
I've done a bit of reading related to the concurrency issues with sqlite, but I don't see how they'd apply to Django since it's inherently single threaded. I'm not using any multiprocess modules either. I have absolutely no experience with concurrent programming either, so if someone can identify WHY the following code is causing an Oper...
I have got tinyMCE working in the django admin, but all the popups are blank
(eg. edit HTML, add image)
The paths to the popup html pages all exist in the right places
http://thatch.media/js/tiny_mce/themes/advanced/source_editor.htm?mce_rdomain=thatch
The permissions are set to 777 on the whole js folder
This is my Model
class Pag...
When I define a Django form class similar to this:
def class MyForm(forms.Form):
check = forms.BooleanField(required=True, label="Check this")
It expands to HTML that looks like this:
<form action="." id="form" method=POST>
<p><label for="check">Check this:</label> <input type="checkbox" name="check" id="check" /></p>
<p><input t...
Hi!
I have a html code:
<button>asd</button>
<script type = "text/javascript">
$('button').click(
function() {
$.getJSON('/schedule/test/', function(json) {
alert('json: ' + json + ' ...');
});
}
);
</script>
and corresponding view:
def test(request):
if request.method == 'GET':
json = ...
I have the following code in one of my Django templates that I want to refactor:
{% ifequal sort_type "set" %}
{% regroup cards by set as grouped %}
{% endifequal %}
{% ifequal sort_type "rarity" %}
{% regroup cards by rarity as grouped %}
{% endifequal %}
It does work, but it's really ugly and I want to make it more like this:
...
I've been working on a web app using Django, and I'm curious if there is a way to schedule a job to run periodically.
Basically I just want to run through the database and make some calculations/updates on an automatic, regular basis, but I can't seem to find any documentation on doing this.
Does anyone know how to set this up?
To cl...
I'm working on a blog application, and I want to have a sidebar that includes a list of all the months the blog has been in existence, to provide links to archives pages. Moreover, I'd like to make this automatically update when the month changes, rather than hardcoding it in the template. Of course, as far as I can tell, this means that...
I'm wondering what the common project/application structure is when the user model extended/sub-classed and this Resulting User model is shared and used across multiple apps.
I'd like to reference the same user model in multiple apps.
I haven't built the login interface yet, so I'm not sure how it should fit together.
The following c...
I wrote some smart generic counters and managers for my models (to avoid select count queries etc.). Therefore I got some heavy logic going on for post_save.
I would like to prevent handling the signal when there's no need to.
I guess the perfect interface would be:
instance.save(dispatch_signal=False)
How can I accomplish this?
...
Does somebody know how "modular" is Django? Can I use just the ORM part, to get classes that map to DB tables and know how to read/write from these tables?
If not, what would you recommend as "the Python equivalent of Hibernate"?
...
How can i know the next free primary key of some model?
...
I have a Django model containing a text field. In the admin GUI, I'd like to be able to filter just those records containing text in this field. Is it possible?
Code something like this will filter on the contents of textfield, but shows filters on 'All' and each distinct entry in the filter. I'd like to filter 'All' or 'Contains someth...
I have two models in my Django project:
Match
Player
Match has a ManyToMany property pointing at players, so that multiple players can compete in a match. I'd like to return an informative object name in the Django admin, something like "Richard Henry vs John Doe", by using a join on the players' full names. However the following fai...
Hello guys, I'm having major problems getting Django working with my Apache configuration. I did not create the server, so I don't have too much leeway as to how the server works. Essentially there are three virtual hosts:
board.site.org, students.site.org and insider.site.org
The insider.site.org is the main one I'm concerned with. ...
I am working on a photo site and one of more active users (the jon skeet of the site ;) asked about pushing content to cell phones. The site is built on django, and I was wondering if anyone knows a good way of allowing users to download and store content (images) on their cell phones?
As a side question... is it possible to accept paym...
I wanted a Django model with 2 foreign keys from the same table. It's an event table which has 2 columns for employees: the 'actor' and the 'receiver'. But I get this error:
Error: One or more models did not validate:
tasks.task: Intermediary model TaskEvent has more than one foreign key to Employee, which is ambiguous and is not permi...
Hey all,
Whenever i shut down my development server (./manage.py runserver) with CTRL+c i get following message:
[24/Feb/2009 22:05:23] "GET /home/ HTTP/1.1" 200 1571
[24/Feb/2009 22:05:24] "GET /contact HTTP/1.1" 301 0
[24/Feb/2009 22:05:24] "GET /contact/ HTTP/1.1" 200 2377
^C
Error in atexit._run_exitfuncs:
Traceback (most recent cal...
Suppose someone is editing a HTML form, and their session times out, how can one have Django re-authenticate that individual without losing the content the user had entered into the form?
The snippet Django Snippets: Require login across entire site suggests how to do site-wide authentication, but I expect it will lose the GET component...
Hello, guys
I am working on a so-called Behavioral Risk Factor Surveillance System (BRFSS), a web query system dealing with questionnaires coming every year.
I had hard time in coming up with a suitable database design for it. Here is the problem: Each questionnaire contains about 80 questions, with demographic info, e.g. age, educati...