I have three drop down select boxes, which I have to expand for web visibility reasons with the size='' option. If I select one from each box I receive no errors, but if I leave one or more boxes without a selection I receive an error.
{% for pathology in pathology_list %}
{{ pathology.pathology }}
{% endfor %}
...
Hi People,
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.)
However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like Django s...
Hi everyone I have a few questions about the django admin.
First the relevant details. I currently have Client, Printer, Cartridge, and Order models.
The Printer model has a ManyToManyField to the Cartridge model, which would allow you to select all the cartridges that can be used with that printer.
The Cliente has a ManyToManyField t...
I'm trying to write a bat file so I can quickly launch into the Interactive Shell for one of my Django projects.
Basically I need to write a python script that can launch "manage.py shell" and then be able to print from mysite.myapp.models import *
The problem is manage.py shell cannot take additional arguments and launching into "mana...
Hey I want to sort objects based on a computed value in django... how do I do it?
Here is an example User profile model based on stack overflow that explains my predicament:
class Profile(models.Model):
user = models.ForeignKey(User)
def get_reputation():
...
return reputation
reputation = property(get_rep...
I have a model, "Market" that has a one-to-many relation to another model, "Contract":
class Market(models.Model):
name = ...
...
class Contract(models.Model):
name= ...
market = models.ForeignKey(Market, ...)
current_price = ...
I'd like to fetch Market objects along with the contract with the maximum price of ea...
I'm developing a web app using Django, and I'll need to add search functionality soon. Search will be implemented for two models, one being an extension of the auth user class and another one with the fields name, tags, and description. So I guess nothing too scary here in context of searching text.
For development I am using SQLite and...
I'm trying to create a messaging system where a message's sender and recipients can be generic entities. This seems fine for the sender, where there is only object to reference (GenericForeignKey) but I can't figure out how to go about this for the recipients (GenericManyToManyKey ??)
Below is a simplified example. PersonClient and Comp...
I love the abstract database API that comes with Django, I was wondering if I could use this (or something similar) to model, access, and manage my (postgres) database for my non-Django Python projects.
...
Just wondering if it is possible to get a result that I can get using this SQL query with only Django ORM:
SELECT * FROM (SELECT DATE_FORMAT(created, "%Y") as dte, sum(1) FROM some_table GROUP BY dte) as analytics;
The result is:
+------+--------+
| dte | sum(1) |
+------+--------+
| 2006 | 20 |
| 2007 | 2230 |
| 2008 | 49...
Can anyone give me an idea or perhaps some references on how to create custom markups for django using textile or Markdown(or am I thinking wrong here)?
For example: I'd like to convert the following markups(the outer bracket mean they are grouped as one tag:
[
[Contacts]
* Contact #1
* Contact #2
* Contact #3
[Friend Requests]
* Jose
]...
Hi,
I have 2 models which look like that:
class Entry(models.Model):
user = models.ForeignKey(User)
dataname = models.TextField()
datadesc = models.TextField()
timestamp = models.DateTimeField(auto_now=True)
class EntryFile(models.Model):
entry = models.ForeignKey(Entry)
datafile = models.FileField(upload_to="uploads/%Y/%m/%d/...
I have a django form where I have a FileField which accepts user's resume. I am gonna convert the resume to a html document LATER. So I thought of pickling the original document right away and store in it a db colum and later unpickle it and convert it. Is that possible?
...
I am writing a Django application that has a model for People, and I have hit a snag. I am assigning Role objects to people using a Many-To-Many relationship - where Roles have a name and a weight. I wish to order my list of people by their heaviest role's weight. If I do People.objects.order_by('-roles__weight'), then I get duplicates w...
Update 3 (Read This First) :
Yes, this was caused by the object "profile" not having been saved. For those getting the same symptoms, the moral is "If a ForeignKey field seems to be getting set to None when you assign a real object to it, it's probably because that other objects hasn't been saved."
Even if you are 100% sure that it wa...
I'm trying to decide between the two. I don't know ruby or python very well. I found some articles on SO. Are there any recommended sites? Googling only shows one or two. Thank you.
...
I'm trying to prepopulate the data in my django form based on some information, but NOT using ModelForm, so I can't just set the instance.
This seems like it should be really easy, but for some reason I can't find any documentation telling me how to do this. This is my form:
class MyForm(forms.Form):
charfield1 = forms.CharField(max...
hello again!
I have some code that throws causes syncdb to throw an error (because it tries to access the model before the tables are created).
Is there a way to keep the code from running on syncdb? something like:
if not syncdb:
run_some_code()
Thanks :)
edit: PS - I thought about using the post_init signal... for the code th...
The Django flatpages app has a well-known and oft-discussed-on-the-web bug related to a missing 404.html "Page Not Found" template in your project's templates directory. If you have DEBUG = False in your settings.py file, and you're missing the 404.html file, flatpages will generate a 500 server error instead of loading the flatpage beca...
Possible Duplicates:
Use only some parts of Django?
Using only the DB part of Django
I want to use the Django ORM as standalone. Despite an hour of searching Google, I'm still left with several questions:
Does it require me to set up my Python project with a setting.py, /myApp/ directory, and modules.py file?
Can I create a ne...