I had asked a question pertaining to this. But I think it would be better to ask my question directly.
I have a "User" table with manytomany relationship with two other tables "Domain" and "Groups".
So in the admin interface I see the Groups and Domains as 2 ModelMultipleChoiceFields.
But I want to present them on the UI in a more user f...
What's the quickest way to build admin interfaces in PHP?
It can be a framework, a library/libraries coupled with a particular approach, or whatever.
Background: I'm a Django developer spoiled by auto admin who has to deliver a web-app in PHP. The app is very admin-area/form heavy and has different access levels.
...
Thanks to Insin for answering a previous question related to this one.
His answer worked and works well, however, I'm perplexed at the provision of 'cleaned_data', or more precisely, how to use it?
class RegistrationFormPreview(FormPreview):
preview_template = 'workshops/workshop_register_preview.html'
form_template = ...
I query a model,
Members.objects.all()
and it returns say
Eric, Salesman, X-Shop
Freddie, Manager, X2-Shop
Teddy, Salesman, X2-Shop
Sean, Manager, X2-Shop
What i want is, to know the best DJango way to fire
a group_by query to my db, as like,
Members.objects.all().group_by('designation')
Which doesn't work of course...
We're about to deploy a new Django website, and we want to use Google Analytics to keep track of traffic on the site. However, we don't want all of the hits on development instances to contribute to the Google Analytics statistics.
There are a few ways we could deal with this:
have a configuration option in settings.py which the base...
We have a fairly simple Django-based website for doing CRUD operations. I've been doing testing and development locally and then checking out releases and database schema changes onto the live server once testing is done. We've recently run into a problem when releasing some types of changes. Imagine the following sequence of events:
U...
Hi i am trying to link flex to django with Pyamf
As a first step i tried the basic Hello World
http://pyamf.org/wiki/DjangoHowto
But that results in an ErrorFault.
I use django 1.0.2
amfgateway.py in the root folder of my project (same level as settings)
import pyamf
from pyamf.remoting.gateway.django import DjangoGateway
from djan...
I have a model as follows
class UserPrivacy(models.Model):
user = models.ForeignKey(User)
profile = models.SmallIntegerField(default=1, choices=PRIVACY_TYPE)
contact = models.SmallIntegerField(default=1, choices=PRIVACY_TYPE)
friends = models.SmallIntegerField(default=1, choices=PRIVACY_TYPE)
location = models.SmallI...
I've looked for other questions, but could not find any...
I have freshly installed my Mac with OSX 10.5. I need to learn Python/Django for a new job, so want to set it all up correctly, ready to develop and run from my browser using http://localhost/
I come from a PHP background and always used MAMP before. But I want to get everythin...
I'm having a problem while trying to call a custom Model method from my Form clean method.
Here is [part of] my model:
http://dpaste.com/hold/12695/
Here is my Form:
http://dpaste.com/hold/12699/
I'm specifically having a problem with line 11 in my Form:
nzb_data = File.get_nzb_data(nzb_absolute)
This raises the following error:
Typ...
I am using Django admin for managing my data.
I have a Users, Groups and Domains tables
Users table has many to many relationship with Groups and Domains tables.
Domains table has one to many relationship with Groups table.
and when I save the User data through admin I also need some addtional database updates in the users_group and the...
I jumped into learning django recently.
I am rendering my template with citylist like,
{'citylist': Cities.objects.all()}
And want to reqroup on country in template (same as in django-docs) below:
{% regroup citylist by country as coutrylist %}
<ul>
{% for country in countrylist %}
<li>{{ country.grouper }}
<ul>
{% ...
I need to validate the contents of an uploaded XML file in my Form clean method, but I'm unable to open the file for validation. It seams, in the clean method, the file hasn't yet been moved from memory (or the temporary directory) to the destination directory.
For example the following code doesn't work because the file hasn't been mov...
I would like my form to output something like this:
Name: ___________
Company: ___________
Interested in
-------------
Foo: [ ]
Bar: [ ]
Baz: [ ]
That is to say, I would like to have the 'Interested In' title inserted in the middle of my form output.
One way of doing this would be to write out the template code for each field, and i...
I'm working with a Satchmo installation that resides within an existing project. This project has its own templates as well as templates for some of the various apps that are installed. Some of these app-specific templates have their own app_base.html variations that expect to derive form base.html. I'd like to be able to do the same ...
I have a form that inherits from 2 other forms. In my form, I want to change the label of a field that was defined in one of the parent forms. Does anyone know how this can be done?
I'm trying to do it in my __init__, but it throws an error saying that "'RegistrationFormTOS' object has no attribute 'email'". Does anyone know how I can ...
I'm trying to rename a file after it's uploaded in the model's save method. I'm renaming the file to a combination the files primary key and a slug of the file title.
I have it working when a file is first uploaded, when a new file is uploaded, and when there are no changes to the file or file title.
However, when the title of the file...
I'm trying to get a trivial Django project working with Passenger on Dreamhost, following the instructions here
I've set up the directories exactly as in that tutorial, and ensured that django is on my PYTHONPATH (I can run python and type 'import django' without any errors). However, when I try to access the url in a browser, I get ...
For a website implemented in Django/Python we have the following requirement:
On a view page there are 15 messages per web paging shown. When there are more two or more messages from the same source, that follow each other on the view, they should be grouped together.
Maybe not clear, but with the following exemple it might be:
An ex...
Is it possible to use create_object view to create a new object and automatically asign request.user as foreign key?
P.E:
class Post(models.Model):
text = models.TextField()
author = models.ForeignKey(User)
What I want is to use create_object and fill author with request.user.
...