Am I thinking about this all wrong, or am I missing something really obvious?
Python's style guide say's less code is better (and I don't think that's subjective... It's a fact), so consider this.
To use forms for all validation means that to write a model field subclass with custom validation, you'd have to:
Subclass models.Field
Su...
Django installation itself was quite a task (for a beginner like me) and reading a book to learn it would not be possible right now. I'm just looking to create simple test applications only to learn Python better, so I'm not ready for Django yet.
Is there any simple web framework that can be used for test projects, so I don't have to sp...
Is there an easy way to get the URL to a Django date-based generic view (specifically object_detail) from a template?
Given a URL conf like this
url(r'^posts/(?P<year>\d\d\d\d)/(?P<month>\d\d)/(?P<day>\d\d)/(?P<slug>[\w-]+)$', 'date_based.object_detail', detail_info, name='blog-post-detail')
My understanding is that I would need to d...
Using python django I would like to access this site http://www.reta-vortaro.de/revo/ It is a dictionary site for a language called esperanto, I need to be able to search for a word, and get back its definition, it looks like Each Esperanto root word has an xml file,
I need to index each xml file
store the name of each xml file in...
Pony references are in several places:
http://www.mail-archive.com/[email protected]/msg44751.html
http://pypi.python.org/pypi/django-pony/
http://djangopony.com/
Is there a cultural reference that I am missing? What is the deal with ponies?
...
In an inline form, in the admin interface, I have a foreign key field.
If you look at the following image: http://www.image-share.com/ipng-147-172.html you will notice an engine field (Set to proximity).
What I'd like is to filter what appear in the list (currently track.context.max_media_duration and track.ambient.max_media_duration) ...
Hi,
Sent a question yesterday but I wasn't too clear on what I am attempting. I'm struggling to find any useful tutorials on how best to achieve this so a nudge in the right direction would be greatly appreciated.
I've set up a model which references django_content_type. My idea is to use this model to reference other models so that th...
I've created a small article site. I am using, translema to store the same article in several languages (it creates copies of selected fields in the database, so they can be translated),
How can I generate sitemaps in this case?
(Forget to say, that I am using localurl application, so my urls look like this http://site/en).
...
Inside a django template I'm trying to call the split function on one of the template variables and then get the last element, so I did something like this:
{{ newsletter.NewsletterPath.split('/').-1 }}
Unfortunately, it doesn't like the split. Some might suggest that I do the split in the view, but I'm not sure how to do that because...
I ahve a multi tenant Django database. All my multi tenant enabled models import from a class AccountSpecificModel, which as a FK to a class Account. Now I have some unique=True and unqiue_together in Meta, which do not specify account.
In my scenario, for AccountSpecificModel uniqueness has no menaing unless it takes care of account, w...
Assume I have a such model:
class Foo(models.Model):
name = models.CharField("ad",max_length=25)
type = models.ForeignKey(Type)
So at the database I have Foo objects with same name field but different types ie:
name type
A 1
A 2
B 1
C 2
A 3
B 3
I will use this information inorder to generate a html s...
In Django, I have SESSION_COOKIE_DOMAIN set to my domain name. But I would actually like to run the same site with two different domain names.
With SESSION_COOKIE_DOMAIN set, only the named domain allows the user to login. Is it possible to allow both domains to login?
...
I've been doing things like this in the clean method:
if self.cleaned_data['type'].organized_by != self.cleaned_data['organized_by']:
raise forms.ValidationError('The type and organization do not match.')
if self.cleaned_data['start'] > self.cleaned_data['end']:
raise forms.ValidationError('The start date cannot be later tha...
I need to make a gql query against a set of some objects which have a date field. I am very new to python and also the GAE so I am a bit igorant to this. I am looking in the documentation but cannot find quite what I am looking for. Basically I have made the following class method
Event.getEventsForMonth(cls, month,year):
So I am t...
Hi
In Django application I have these models:
class DLL(models.Model):
prev = models.ForeignKey('self', related_name = 'prevItem', blank = True, null = True)
next = models.ForeignKey('self', related_name = 'nextItem', blank = True, null = True)
class Meta:
abstract = True
class SomeData(DLL):
name = models.TextField()
The pr...
I am not sure if the title makes any sense but here is the question.
Context: I want to keep track of which students enter and leave a classroom, so that at any given time I can know who is inside the classroom. I also want to keep track, for example, how many times a student has entered the classroom. This is a hypothetical example tha...
Python 2.6.2 / Django 1.0.2 on Win 2003 Standard IIS 6.
IIs is running two django sites with the following directory structure:
root/http/WEBSITE1
root/http/WEBSITE2
Both sites have their own application pools; each site has it's own pyISAPIe.dll instance.
WEBSITE1 is accessible (serving test django page). However, the browser produc...
Hi Guys,
I must be suffering from a serious lack of sleep but I am stumped. I can't seem to figure out how to get the {% url %} directive to give me the right url. So let's start with the basics..
urls.py
from people.views import employee_detail
urlpatterns = patterns("",
url(r'/uid/(?P<id>[0-9]+)/$', employee_detail, {'templat...
Hello,
This application returns schoolmates of lawyers.
When a user searches for first name only and there are more than 1 result I leave the query in the form and ask them to enter a last name. But I thought that it would be nicer if the user just clicks to one of the names and search results are returned directly. (at this point the ...
In my urls.py I have:
(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/section/(?P<slug>[-\w]+)/$',
'paper.views.issue_section_detail',
{},
'paper_issue_section_detail'
),
and I'm trying to do this in a template:
{% url paper_issue_section_detail issue.pub_date.year,issue.pub_date.month,issue.pub_date.day,section_li...