Django

Hi, I have just started to learn Django's template inheritance and I am stuck due to this problem - In my application's 'base.html', I have defined two blocks - {% block topbar %}{% endblock topbar %} and {% block s...
Hi, I have just started to learn Django's template inheritance and I am stuck due to this problem - In my application's 'base.html', I have defined two blocks - {% block topbar %}{% endblock topbar %} and {% block sidebar %}{% endblock sidebar %} I have 2 templates - 'sidebar.html' which extends {% block sidebar %}
score: 1 12 minutes ago
Use this directive to show google-map if you don't want to use 'raw' directive. default location is my favorite place. Of course you can change it :)
Use this directive to show google-map if you don't want to use 'raw' directive. default location is my favorite place. Of course you can change it :)
score: 1 about 5 hours ago
This is a YAML version of http://djangosnippets.org/snipptes/2397
This is a YAML version of http://djangosnippets.org/snipptes/2397
score: 1 about 6 hours ago
So I created a service record model like this: class ServiceRecord(models.Model): location = models.ForeignKey(Location, related_name='service_records' ) created = models.DateTimeField(auto_now_ add=True, null=True) modified...
So I created a service record model like this: class ServiceRecord(models.Model): location = models.ForeignKey(Location, related_name='service_records' ) created = models.DateTimeField(auto_now_ add=True, null=True) modified = models.DateTimeField(auto_now= True, null=True) active = models.NullBooleanField(defaul t=True, blank=True, null=True)
score: 1 about 9 hours ago
I use Django 1.5.1 out of the box in a virtual environment in my Mac. I just created an app with two models, so the one can be used as inline in the form of the other. While reducing the width of my browser I notice that the table ins...
I use Django 1.5.1 out of the box in a virtual environment in my Mac. I just created an app with two models, so the one can be used as inline in the form of the other. While reducing the width of my browser I notice that the table inside the inline, does not keep the same width with the other elements in the page. See pictures.
score: 1 about 9 hours ago
My site is currently using Mysql, would it benefit me to switch to Postgres? Thanks
My site is currently using Mysql, would it benefit me to switch to Postgres? Thanks
score: 1 about 15 hours ago
Hello, How can I resolve this in django 1.5? webfaction allows max 90 connections. Thanks
Hello, How can I resolve this in django 1.5? webfaction allows max 90 connections. Thanks
score: 1 about 15 hours ago
I am categorizing models in a tree. The tree is created based on a string of where the model falls in the tree. The tree will not change once it is created. I tried using django-mptt with this code to create the tree. def add_new_nod...
I am categorizing models in a tree. The tree is created based on a string of where the model falls in the tree. The tree will not change once it is created. I tried using django-mptt with this code to create the tree. def add_new_nodes(category_string) : for category in category_string.split(','):
score: 1 about 19 hours ago
Dear all, I'm working with a proxy model of django's User. I need to convert the user from the request into an instance of my proxy. At the moment I have the following method in my class: @classmethod def from_parent_user(cl...
Dear all, I'm working with a proxy model of django's User. I need to convert the user from the request into an instance of my proxy. At the moment I have the following method in my class: @classmethod def from_parent_user(cls, user): # return cls.objects.get(pk=user.pk) member = cls()
score: 1 about 20 hours ago
Hello! I have a code (test) that mocks datetime.datetime.now and the way queryset filter method works. The code is: Mock: @contextlib.contextmanager def mock_now(dt_value): """Context manager for mocking out datetime.now() in unit ...
Hello! I have a code (test) that mocks datetime.datetime.now and the way queryset filter method works. The code is: Mock: @contextlib.contextmanager def mock_now(dt_value): """Context manager for mocking out datetime.now() in unit tests. Example: with mock_now(datetime.datetime(201 1, 2, 3, 10, 11)):
score: 1 about 23 hours ago