-
as seen on Stack Overflow
- Search for 'Stack Overflow'
i have some csv data and i want to export into django models the example of csv data
1;"02-01-101101";"Worm Gear HRF 50";"Ratio 1 : 10";"input shaft, output shaft, direction A, color dark green";
2;"02-01-101102";"Worm Gear HRF 50";"Ratio 1 : 20";"input shaft, output shaft, direction A, color dark…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Like in this question, except I want to be able to have querysets that return a mixed body of objects:
>>> Product.objects.all()
[<SimpleProduct: ...>, <OtherProduct: ...>, <BlueProduct: ...>, ...]
I figured out that I can't just set Product.Meta.abstract to true or otherwise…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have an object:
POP_CULTURE_TYPES = (
('SG','Song'),
('MV', 'Movie'),
('GM', 'Game'),
('TV', 'TV'),
)
class Pop_Culture(models.Model):
name = models.CharField(max_length=30, unique=True)
type = models.CharField(max_length=2, choices = POP_CULTURE_TYPES, blank=True,…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Given a reference app ( called guide), how can I create additional apps that will reuse the same model/admin/views than guide - the motivation behind is to be able to individually control each subapp.
guide
guideApp1
exact same models/admin/views than guide
guideApp2
exact same models/admin/views…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to use unique hashes for each model rather than ids.
I implemented the following function to use it across the board easily.
import random,hashlib
from base64 import urlsafe_b64encode
def set_unique_random_value(model_object,field_name='hash_uuid',length=5,use_sha=True,urlencode=False):
…
>>> More
-
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