I am trying to get the form preview django module example to work. In polls_app/mysite/urls.py:
from django.conf.urls.defaults import *
from mysite.preview import SomeModelFormPreview
from mysite.forms import SomeModelForm
from django import forms
In polls_app/mysite/SomeModelFormPreview.py:
from django.contrib.formtools.preview
imp...
Does anyone know of, or use a library that has similar functionality to Typogrify (http://code.google.com/p/typogrify/) in a .NET project. Typogrify is a Python/Django library and I am looking for an equivalent that I could use in a .NET project.
Edit: Now I'm just looking for any typography processing library for .NET
...
the goal is to render a comment form with an extra recaptcha field if the user is not authenticated.
I'd like to extend the comments framework, making the contrib CommentForm dynamic, so the constructor checks to see if the context user is authenticated.
But it doesn't seem like I can get the context user in the form without passing it...
I'm using django-tinymce together with the no grappelli branch of django-filebrowser running django 1.2.
I use the tinymce HTMLField model definition for the model field that I would like to have WYSIWYG.
I've added the correct javascript to my AdminModel, and the filebrowser works great, adding the image to the textarea with no proble...
In my project I deal with various sorts of events taking places in different cities. I'd like to present list of events per city in a template, but how to do that ? My view now looks like this :
def events_by_state(request, state):
cities = City.objects.filter(state_slug=state)
For each city I'd like do a query :
for c in cities...
Hi guys, im would like to use the cool app Django-AdZone, i thinks is a nice work , but i have a litter problem:
i have 2 website, django-adzone is working very nice in one of those website, but in the second website is not working.
I cant see in the django admin the app adzone, i dont know why, i did the same steps for both website, a...
User registration in my application is performed in steps. After submitting the form, some validation is performed and then register_prompt view is called. It renders a form, with two options - 'ok' and 'cancel'. Clicking ok will run registration, and clicking cancel should redirect to main page. Problem is that no matter which of the tw...
Weird CAPTCHA behavior. If failed, CAPTCHA hijacks page.
When submitting the form with errors, the correct page (displaying what fields are incorrect) is displayed for a brief moment then is immediately hijacked by the CAPTCHA form leaving only the CAPTCHA form on the page.
The CAPTCHA does not redirect to a new URL, the URL stays the ...
Hi all,
I'm looking for a good way to install multiple completely different Django projects on the same server using only a single domain name. The point is that I want to browse to something like:
http://192.168.0.1/gallery/ # a Django photo gallery project
http://192.168.0.1/blog/ # a blogging project
This way, I can deve...
I am using model forms in Django to allow the user to enter in their birthdate. I want to have the user select the date from a series of dropdown lists, one each for year, month, and day. Originally I thought that the SelectDateWidget would work. However that particular widget only displays dates in the future. I of course want to only d...
Is there some method to clen all model in Django (cleen table in database)?
Sorry i'm not a native english speacker. That why i'm making a lot of misstakes and some time asking question whith i cant undersand by reading official documentation. But I'm doing my best.
...
Say I have 2 classes as:
class Bar(models.Model):
prop = IntegerField()
class Foo(models.Model):
bar = ManyToManyField(Bar)
I want to return a QuerySet containing model instances of bar that
match the query:
QuerySetOfFoos.objects.filter(bar__prop__gt=0)
Is there an easy way to do this? I know that in the model instance I
c...
I'm working on a turn-based web game that will perform all world updates (player orders, physics, scripted events, etc.) on the server. For now, I could simply update the world in a web request callback. Unfortunately, that naive approach is not at all scalable. I don't want to bog down my web server when I start running many concurre...
I want to build a Country/State selector. First you choose a country, and the States for that country are displayed in the 2nd select box. Doing that in PHP and jQuery is fairly easy, but I find Django forms to be a bit restrictive in that sense.
I could set the State field to be empty on page load, and then populate it with some jQuery...
How would you duplicate a data entry in Django/
The model has data in it. What would be the best way to save an entire model entry into new record and update id to new one.
...
Hello!
I'm building an app that notifies user when new ThreadedComments appear. For this I'm using post_save signal. Here's my models.py:
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from datetime impor...
Now, I'm learning python but I'm PHP web developer. I don't interest about terminal and windows programming. I only want to do web development. So, Can I learn Django ?
...
I would like to preserve past revisions of MyModel instances, while updating and migrating MyModel with south.
Is it possible to update the past revisions?
Is it necessary to update the revisions on all types of changes to the model?
What kind of changes, if any, will force me to erase the revision history no matter what?
Is there an el...
Dear Djangonauts,
I'm still busy with my Django learning adventure. In another post I asked about how to structure a Django project and applications using buildout. In the details of doing this arose another issue, simply installing 3rd party Django applications using either easy_install or setup.py. My question is, where should you ins...
I would like to change a name of specific fields in a model:
class Foo(models.Model):
name = models.CharField()
rel = models.ForeignKey(Bar)
should change to:
class Foo(models.Model):
full_name = models.CharField()
odd_relation = models.ForeignKey(Bar)
What's the easiest way to do this using South?
...