Hi there.
I'm about to build a site that has about half a dozen fairly similar products. They're all DVDs so they fit into a very "fixed" database very well. I was going to make a DVD model. Tag them up. All very simple. All very easy.
But we need to be able to sell them. The current site outsources the whole purchasing system but that...
When an admin fieldset is given the class "collapse", it is rendered with a Show/Hide link installed by CollapsedFieldset.js which collapses or expands it.
In all cases where the collapse class appears, I'd like the link to be the whole fieldset box (or a div of that dimension) instead of just the word "Show".
What is the best way to "...
Are there any differences, limitations or gotchas between NDjango and Django templates? I'm specifically interested in implementing them in future ASP.NET MVC projects.
I'm certain I won't be able to use any of my custom template tags that I've written for Django, but would I be able to port them to NDjango?
...
name class an id, a first & a last attributes
In my view.py, I fetch a name object from the database and pass it into the index.html template.
In my templagetags/my_tags.py, I have a filter my_private_tag(value, arg) that takes value and an arg. It appends the arg to the value and returns the result.
def my_private_tag(value, arg):
...
In the process of learning Django and Python. I can't make sense of this.
(Example Notes:'helloworld' is the name of my project. It has 1 app called 'app'.)
from helloworld.views import * # <<-- this works
from helloworld import views # <<-- this doesn't work
from helloworld.app import views # <<-- but this...
I have some links on an html page like , , currently I handle them as so
<p> <a href="/cases/{{case.id}}/case_rate/-">rate down</a>
and have a url.py entry:
(r'^cases/(?P<case_id>\d+)/case_rate/(?P<oper>.)$', 'mysite.cases.views.case_rate'),
then I have a view function that handles the logic and hits the DB, then does this:
retu...
I'm trying to get South to work - it worked fine on my PC, but I'm struggling to deploy it on my webhost.
Right now it seems that any changes I make to add/remove items from INSTALLED_APPS aren't being picked up by syncdb or diffsettings. I've added south to my list of INSTALLED_APPS, but the tables it needs aren't being created when I ...
Eclipse/PyDev, Python 2.6, Django 1.1
All is working in run mode. If I put debug point inside manage.py file, breakpoint worked. But when I putted it in any action method, it causes nothing :(
...
I'm new to Django and I'm trying to learn it through a simple project I'm developing called 'dubliners' and an app called 'book'. The directory structure is like this:
dubliners/book/ [includes models.py, views.py, etc.]
dubliners/templates/book/
I have a JPG file that needs to be displayed in the header of each Web page. Where shoul...
Suppose you are running a Django site, and have a legacy PHP forum to support and integrate into your site, since current Django forum solutions are not mature enough.
What is the best way to do this?
Currently I have a simple view, which renders a very simple template which extends my site's base template, and the content area has not...
I have a list in my Django template. I want to do something only if the size of the list is greater than zero. How can I check this?
I have tried myList|length and myList|length_is but have not been successful. I've searched all over and don't see any examples.
...
I'm trying to implement a WikiLink template filter in Django that queries the database model to give different responses depending on Page existence, identical to Wikipedia's red links. The filter does not raise an Error but instead doesn't do anything to the input.
WikiLink is defined as: [[ThisIsAWikiLink | This is the alt text]]
Her...
I've been looking at django-swingtime, django-schedule and django-agenda.
Any recommendations of which is them easier to use, and if so any practical code examples out there? Couldn't find useful examples in the respective projects.
My requirement is to have a number of events and track their occurrences, but the events are custom thin...
why doesn't {% url myVar %} where myVar = 'jack.johnson' doesn't work ?
The view is fine, the urls.py is:
url(r'^(?P[A-Za-z0-9-._]+)/$', overview, name='user_profile'),
...
Hi all,
Im following the Django tutorial, and ive got up to part 4. But when i went back to have a look at my admin page it mysteriously didnt work anymore. So i messed around a bit more and came up with this.
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
...
Hi,
I have a form with 2 buttons. depending on the button click user is
taken to different url.
view function is :
friend_id = request.POST.get('selected_friend_id_list')
history = request.POST.get('statushistory')
if history:
print "dfgdfgdf"
return HttpResponseRedirect('../status/')
else:
return direct_to_template(reque...
I have a form. Once the form is filled I don't want the user to change anything in the form.
But the user can see the values. Meaning all the fields are non editable. I can do this by using instance method but this does not help in foreignkey.
...
I am writing a subscription app for a rallye site. As the subscription doesn't need former registration, a captcha should be useful.
The subscription is team-based. One team include 1 to 3 person. for each person an postal address must be provided.
Now I wonder, if it makes sense to check if the city exists and the provided street is ...
I am looking for a forum solution for a Django site. I looked over the options in the Django wiki and I check about integrating non-Django solutions.
As much as I do not feel comfortable with implementing an external PHP forum, I feel even less comfortable with going with a Django solution which is not mature enough.
Do you have any re...
A have 3 models: Project, Image and Video with ManyToManyField relation:
class Project(models.Model):
images = models.ManyToManyField('Image', through='Project_Images')
video = models.ManyToManyField('Video', through='Project_Video')
class Image(models.Model):
original = models.ImageField()
projects = models.ManyToManyF...