I want a simple edit / remove form in Django.
I want it to look like:
Item A edit / remove
Item B edit / remove
Item C edit / remove
I want to the edit and remove "buttons" to be hyperlinks, or at least look like them.
Is there an easy way without multiple submit buttons (and without violating the whole POST/GET thing...
Hi,
I would like to have 2 ImageFields in a Model.
being the one where the user uploads an image
being one where we have a copy of that image, but using the Same File.
Note: I am simplfying the reason for the two fields.
Apart from Creating a new ImageField field type is there any way to stop the ImageField adding a _ to the filena...
I'm building an Django app that requires users to enter the time of day in TimeFields and I'm trying to format this as nicely as possible. My code currently looks like this:
start = forms.TimeField(widget=forms.TimeInput(format="%I:%M %p"))
end = forms.TimeField(widget=forms.TimeInput(format="%I:%M %p"))
Where the values in the format...
Hi guys, i dont know what im doing wrong, but sorl-thumb just upload the image but dont make thumbs...
model.py
from sorl.thumbnail.fields import ImageWithThumbnailsField ,ThumbnailField
imagen = ImageWithThumbnailsField(upload_to='images',
thumbnail={'size': (75, 75)},
...
I'm implementing a custom log-in screen for a django site I am working on and users will be presented with a CAPTCHA challenge every time they log on. (Sounds like overkill I know but for a whole bunch of complex reasons it is impossible to set a decent password policy which leaves the log in open to brute force attacks)
I want to be ab...
I've been looking for a better way to deal with site-specific settings (in this case, the django settings.py file).
The settings.py structure and fields are fairly consistent, but the values differ between the developer's boxes, the integration, QA, testing, and production environments.
What's an elegant way to have the settings sourc...
How can I make mandatory fields non-mandatory when another [associated] field has a certain value?
Let's assume I have the following models:
class foo(models.Model):
bar = models.CharField(max_length=200)
foo_date = models.DateTimeField()
When I save, and bar contains a certain value, i'd like foo_date to become non-mandatory...
I have a model like:
CAMPAIGN_TYPES = (
('email','Email'),
('display','Display'),
('search','Search'),
)
class Campaign(models.Model):
name = models.CharField(max_length=255)
type = models.CharField(max_length=30,choices=CAMPAIGN_TYPES,default='display')
...
My ajax responses seem to die out now that I am sending so much data in response to a search form request. I'm using Django with Apache and Firefox and Chrome noth die out if I don't limit my search to few enough results. What's the time or size limit to an Ajax response?
...
Does anyone know how Pylons and TG2 projects handle database migrations? I'm looking for something similar to Rails' Migrations and Django's South.
...
I would like to provide the same content inside 2 different base files.
So I'm trying to do this:
page1.html:
{% extends "base1.html" %}
{% include "commondata.html" %}
page2.html:
{% extends "base2.html" %}
{% include "commondata.html" %}
The problem is that I can't seem to use both extends and include. Is there some way to d...
I've got a bit of Django form code that looks like this:
class GalleryAdminForm(forms.ModelForm):
auto_id=False
order = forms.CharField(widget=forms.HiddenInput())
And that makes the form field go away, but it leaves the label "Order" in the Django admin page. If I use:
order = forms.CharField(widget=forms.HiddenInput(), labe...
Hi guys, im using generic view, i would like to update a field (most_view) in another database table.
How ill update or create a new register for "most view" when the user are reading a article?
ulrs.py
from Paso_a_Paso.noticias.models import Noticia
noticias_info_dict = {
'queryset':Noticia.objects.all(),
'date_field...
I have some models and I want to generate a multi-selection form from this data.
So the form would contain an entry for each category and the choices would be the skills in that category.
models.py
class SkillCategory(models.Model):
name = models.CharField(max_length=50)
class Skill(models.Model):
name = models.CharField(max_l...
I want to round off my decimal values as below:
7,715.625 becomes 7,716
How do I achieve this?
...
I'm making a threaded forum app using django-mptt. Everything is up and running, but I have trouble building one specific queryset.
I want to retrieve posts which:
1) are root nodes
2) are posted by current_user or have a descendant posted by current_user.
What I have so far is this:
Post.objects.filter(Q(user = current_user) | Q...
How can I set a Flatpage as the Homepage?
My urls.py is
(r'', include('django.contrib.flatpages.urls')),
In the admin section I set the URL of the Flatpage to "/".
I get this error
Firefox has detected that the server
is redirecting the request for this
address in a way that will never
complete.
I'm guessing setting ...
I can't get wsgi to import my settings file for my project 'mofin'.
The list of errors from the apache error log are as follows
mod_wsgi (pid=4001): Exception occurred within WSGI script '/var/www/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 2...
I am using django-compress with far future expires for my css and js files. Works great.
I'd like to do something similar for other static content (images, flash, etc). I can set a far future expires on this content, but I must manually rename the files when they change.
Is there a better way to handle this?
...
Hi
I'm using the development server (runserver) in Django and it's started to annoy me that Django is validating the models every time I save a file and the server restarts. I have ~8000 entries in my SQLite3 database and it takes up to five seconds to validate the models. I'm not familiar with how Django validates the models, but I'm...