-
as seen on Stack Overflow
- Search for 'Stack Overflow'
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:…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm getting the error:
Exception Value: (1110, "Column 'about' specified twice")
As I was reviewing the Django error page, I noticed that the customizations the model User, seem to be appended to the List twice.
This seems to be happening here in django/db/model/base.py in base_save():
values…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I've been struggling to deploy Django application on Amazon EC2 using Bitnami Djangostack for the last couple of days. When I go to http://dewey.io I see the default bitnami page (/opt/bitnami/apache2/htdocs/index.html), however, when I open http://dewey.io/portnoy, I get 'Internal Server Error'…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
when i run development server it works very well, even an empty project runing in mod_wsgi i have no problem but when i want to put my own project i get an Internal Server Error (500)
in my apache conf i put
WSGIScriptAlias /codevents C:/django/apache/CODEvents.wsgi
<Directory "C:/django/apache">
Order…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
when i run development server it works very well, even an empty project runing in mod_wsgi i have no problem but when i want to put my own project i get an Internal Server Error (500)
in my apache conf i put
WSGIScriptAlias /codevents C:/django/apache/CODEvents.wsgi
<Directory "C:/django/apache">
Order…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have the following class
public class ElementBean {
private String link;
private Set<ElementBean> connections;
}
I need to create a map table where elements are mapped to each other in a many-to-many symmetrical relationship.
@ManyToMany(targetEntity=ElementBean.class)
@JoinTable(
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm sure this is really simple, but I can't for the life of me find any documentation explaining how to do this.
How do I get the results of a ManyToMany field inside a join as opposed to doing this:
{% for tag in article.tags.all %}
Which results in an extra query? What I'd like to do is fetch…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hay I've got a question about relationships.
I want to Users to have Friendships. So a User can be a friend with another User. I'm assuming i'll need to use the ManyToManyField, through a Friendship table. But i cannot get it to work. Any ideas?
Here are my models.
class User(models.Model):
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Background
I've created three Django models—Inventory, SalesOrder, and Invoice—to model items in inventory, sales orders for those items, and invoices for a particular sales order. Each sales order can have multiple items, so I've used an intermediary junction table—SalesOrderItems—using the through…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
from an instance of Site with a ManyToMany relationship to Kiosk, i'd like to check if a Kiosk object is part of the relationship.
I could do
self.apps.get(id=app_id).exists() and check if True
or
self.apps.get(id=app_id) and catch the ObjectDoesNotExist error
or
self.apps.filter(id=app_id)…
>>> More