Here, I am a bit confused with forms in Django. I have information for the form(a poll i.e the poll question and options) coming from some db_table - table1 or say class1 in models. Now the vote from this poll is to be captured which is another model say class2. So, I am just getting confused with the whole flow of forms, here i think. H...
I have seen people writing forms in models or in forms.py? Is it the case I can actually write it anywhere say in blah.py and just import it wherever necessary?
...
In production server I can't login to my website.
I know that it is some bug of Django with MD5 crypt or something like that, but unfortunately I don't remember what I should do. I am searching the answer since half day, but I can't find this website where was explained this problem.
DO you know how I can do sessions working.
...
I have declared my model classes as found in this link....I now want to customize how my add/edit ModelForm for a Vehicle object is rendered in that I want the year, make, model, and manufacturer fields to be rendered separately as opposed to referring to the one common_vehicle field from the Vehicle class. How can this be done?
...
Hi
I have 2 models in my django code:
class ModelA(models.Model):
name = models.CharField(max_length=255)
description = models.CharField(max_length=255)
created_by = models.ForeignKey(User)
class ModelB(models.Model):
category = models.CharField(max_length=255)
modela_link = models.ForeignKey(ModelA, 'modelb_link')...
I have a Customer table and one of the fields here is for Status....I want to have the background colour of the cell containing this field to be set according to it's value e.g green for the status "Closed"; yellow for the status "Pending" and so on.
What's the best way to do this...possibly something that'll be easy to modify if need ...
Hi guys, there is any way to make a Break Page with django for using with large articles?
thanks
...
Hey,
I am using "url" tag in my template and everything works fine, except I cant capture anything thats behind it. Since I have multiple filters on that page, that are kept via GET request in the url, I need to be able to apend them to it. What happens is, that when I select one filter url will change to some/url/?f=1, then when I sele...
I've created a Python script that monitors a logfile for changes (like tail -f) and displays it on a console. I would like to access the output of the Python script in a webbrowser. What would I need to create this? I was thinking about using Django and jQuery. Any tips or examples are greatly appreciated.
...
I've been searching here and there, and based on this answer I've put together what you see below.
It works, but I need to put some stuff in the user's session, right there inside authenticate.
How would I store acme_token in the user's session, so that it will get cleared if they logged out? The request object is not available in this ...
I have a Django-based site with roughly 300,000 User objects. Admin pages for objects with a ForeignKey field to User take a very long time to load as the resulting form is about 6MB in size. Of course, the resulting dropdown isn't particularly useful, either.
Are there any off-the-shelf replacements for handling this case? I've been go...
I've been using django-mptt in my project for a while now, it's fabulous. Recently, I've found a need to override a model's save() method that uses mptt, and I'm getting an error when I try to save a new instance of that model:
Exception Type: ValueError at /admin/scrivener/page/add/
Exception Value: Cannot use None as a query value
...
I have a model:
class Cost(models.Model):
project = models.ForeignKey(Project)
cost = models.FloatField()
date = models.DateField()
For the model I created a class form:
class CostForm(ModelForm):
class Meta:
model = Cost
fields = ['date', 'cost']
view.py:
def cost(request, offset):
if request.method ==...
I have a base LoggedEvent model and a number of subclass models like follows:
class LoggedEvent(models.Model):
user = models.ForeignKey(User, blank=True, null=True)
timestamp = models.DateTimeField(auto_now_add=True)
class AuthEvent(LoggedEvent):
good = models.BooleanField()
username = models.CharField(max_length=12)
c...
I trying to restful server that one can upload image, By use django-piston I can put,get,post information restfully but don't know how to upload image.
...
I have this model:
class blog(models.Model):
user = models.ForeignKey(User)
mail = models.EmailField(max_length=60, null=False, blank=False)
name = models.CharField(max_length=60, blank=True, null=True)
I want that (user,email) are unique togheter. For example:
This is allowed:
1, [email protected], myblog
2, hello@hello...
Is there a way for me to get sessions working? I know Django has built in session management, and GAE has some tools for it if you're using their watered down version of Django 0.96, but is there a way to get sessions to work if you're trying to use GAE w/ Django 1.1 (i.e. use_library() call). I assume using a db-backed session doesn't...
I made a jquery function that binds some fields, but it doesn't work when i add a new inline.
The main problem is that i don't know how to detect the insertion in DOM and bind it to my function.
Thanks
...
I installed it in my dev project. I would like to remove it and any trace of it in my database and my django app, not to mention my python install. I found it didn't quite do what I needed, but that's another topic, and I'm moving to South.
Can I just delete the evolution tables in my django db, and remove it from the app settings? Or i...
I've begun diving into Django again and I'm having trouble finding the parallel to some common concepts from my life in C#. While using .NET MVC I very often find myself creating a base controller which will provide a base action implementation to take care of the type of stuff I want to do on every request, like retrieving user informat...