I want to create a helper screen that can create a bunch of Django auth users on my site and have those accounts setup the same exact way as if they were done one by one through the Django auth GUI signup. What methods from Django auth would I have to use in my view to accomplish this?
...
I'm trying to figure out how I can use:
order_with_respect_to()
to order via a Child relationship
class Product(models.Model):
name = models.CharField(max_length=100)
class Affiliate(models.Model):
product = models.ForeignKey(Product)
clicks = models.IntegerField(default=0)
I want to be able to display the Products in or...
I have a model form that I am writing a custom widget for in order to replace the many-to-many forms.SelectMultiple fields with jQuery FCBKcomplete widgets. While the replacement of the multiselect element works fine, it is no longer pulling the options for the multiselect.
Here is my widget:
class FCBKcompleteWidget(forms.SelectMultip...
Hello.
I want to create an order form to buy multiple things in this sort of structure:
Business Data 1
---Product A
---Product B
Business Data 2
---Product A
That is, I want to sell products A,B, but before this is done I need additional aggregate data to be in the 'Business Data' object. That is:
Business 1: Joe's Plumbing, locate...
I need to edit the template shown for editing a specific user. I need to display some additional data that doesn't fit in with an include-style.
I apologise for the short question... but that's pretty much all there is at the moment.
...
Has anyone written a block template tag that joins arbitrary html snippets with some separator, where empty items are omitted?
Could be useful for rendering menu-like lists, where displayed items are determined at run time and items to be joined require elaborate markup.
Thanks.
E.g.:
{% joinitems using ' | ' %}
{% if show_a %}
...
Hello I have a form with ChoiceField whose widget is set to RadioSelect
Now to override default html output one needs to subclass RadioFieldRenderer like this:
class SimpleRadioFieldRenderer(forms.widgets.RadioFieldRenderer):
def render(self):
"""Outputs widget without <ul> or <li> tags."""
return mark_safe(u'\n'.j...
I'm trying to set up a Django application using WSGI. That works fine. However, I am having some issues with part of my Django app that uses BDB XML. My Apache config is as follows:
Listen 8000
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:8000>
ServerName <server name>
DocumentRoot <path to doc root>
LogLevel info
WSGIScr...
Having read some great things about the Django framework I'm becoming quite interested in it. But before making my decision to use it for a small project I would like to hear some more down to earth opinions: Please write of your experience with the framework beyond the usual "toy" website and how well it compares generally with other ma...
Hi people.
I'm wondering if is it possible to have autocompletion, autoformatting, and those beautiful things working in Eclipse IDE for Django based templates.
Mainly for these things: {% ... %} {{ ... }}
Thanks in advance
...
I'm working with a friend on a web application we'd like to distribute and we're working in Django.
I'd like to make sure deployment is as easy as possible for potential users. It seems that Django uses shared installed libraries alot and I'd like for folks to just need to download our latest version, unzip, edit a config file or two a...
I have a city foreign key in by BusinessBranch model. My City model also has a state and country foreign keys for State and County models. I'm having hard time displaying State and Country dropdown menus inside my BusinessBranchInline. What would be the best way to achieve this? It would be great if the dropdowns filter items based on th...
Here's the gist of what I'm trying to do. I have a list of objects, and I know they have an instance method that looks like:
def render(self, name, value, attrs)
# Renders a widget...
I want to (essentialy) decorate these functions at runtime, as I'm iterating over the list of objects. So that their render functions become this:
d...
Hi - I'm working on a django app for a site that requires an image gallery. Since the site is fairly simple I chose not to use a database. In the gallery part, I have a loop in the view that reads all the image files from the image folder, and sends them to the template, where they are rendered inside a loop:
import os
from django.short...
I am running django simple server via manage.py runserver. With a client code I create a list of resources (approx 50 I would estimate). Occasionally (apparently random) the server restarts itself for no apparent reason, like when a .py file has been modified, and the client code dies (but this is another story). The operations happen on...
I have a model that looks like this:
class ProjectImage(models.Model):
big_thumb = ThumbnailField(upload_to='profiles', size=(500, 500))
med_thumb = ThumbnailField(upload_to='profiles', size=(300, 300))
small_thumb = ThumbnailField(upload_to='profiles', size=(100, 100))
I associate ProjectImage with a Project as a Tabular...
I have foreign key entries in my model that I'd like to use for my choicefields...now I'm not so sure how to go about this....my model file can be found here Basically I want have a choicefield for vehicle make, model, year, body style, exterior color and transmission. Since all of them work in the same way I just need someone to point...
Interestingly it also works on the shell.
[MY code which calls Model.objects.get_or_create(...)]
File "/usr/lib/python2.5/site-packages/django/db/models/manager.py", line 123, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line 308, in ge...
We are building out an app in Django and trying to nail down what the right ecommerce framework will be to work with in Django. We've heard of Satchmo. Any other suggestions on ways to approach ecommerce in Django that's clean, simple, cheap and easy to implement? Thanks!
...
Hi all,
Here is my django models:
class Author (models.Model):
name = models.CharField(max_length=255)
removed = models.BooleanField(default=False)
class Image (models.Model):
author = models.ForeignKey(Author)
name = models.CharField(max_length=255)
height = models.PositiveIntegerField()
width = models.Positi...