Hi,
I would strongly suggest looking into using Celery or some other form
of message queue.
In general you want to decouple the logic of the web app, such as
validating domain names, writing to the database, with operations that
has real-world important side effects. Once you split these, the
sys
I've used the django admin for the user interface to a warehouse
management system. The system managed some million pairs of shoes.
In my experience the admin is a bit different than what most people
expect it to be. On the other hand, it took my users 10 minutes to get
accustomed to the system. I
t the configurations is
plain text, so you can use your normal development tools, like version
control, peer review, etc. It becomes very easy to reason about the
proposed change, when you have a diff at hand.
Regards
Knut
>
> Thanks!
> marc.
>
> On Mon, Nov 1, 2010 at 9:29 AM,
I would suggest rewriting the loop in your template as a templatetag.
Something like this
@register.simple_tag
def render_locations(locations):
html = u""" html %(x)s stuff %(y)s here %(link)s """
return '\n'.join([html % { 'x': loc.x, 'y': loc.y', 'link':
loc.link } for loc in locations])
Hi,
Every Form subclass defines a method called 'is_valid()', even the
FormSet has one, which will repeatedly call it on every form. After
running is_valid(), form.cleaned_data will contain cleaned data from
the forms.
On subclasses of FormSet you can also override the clean method, which
allows
Maybe you could just use subclassing instead of doing stuff at run-time:
class UploadForm(forms.Form):
file = ...
# custom upload and validation code here
class ThumbnailUploadForm(UploadForm):
pass
class UploadFileForm(UploadForm):
title = ...
As for your current approach, it l
Look at the HTML for the form. The 'action' attribute tells the
browser where to submit the post. The view responsible for that URL is
the one you should be looking at.
If you have a ModelForm with no instance, Django will insert a new
row. If there is an instance and you call form.save(), it will
Your query can be translated into the ORM by simply using '__gt' and
'__lt' on your start_date and ends_date.
Regards
Knut
2010/11/8 Rogério Carrasqueira :
> Hello Everybody!
>
> I'm developing a routine that will control the information about scheduled
> events and it will avoid that some events
You need to sum the fines before you enter the templates.
This can be done either in your view like this:
total_fines = sum([item.fine for item in items])
Or you can do it in the db using the 'Sum' aggregate, see
http://docs.djangoproject.com/en/dev/ref/models/querysets/#sum
Regards
Knut
On
redirect_to = urlsplit(referer, 'http',
> False)[2]
> except IndexError:
> redirect_to = reverse('index_view')
>
>
> return render_to_response('upload.html', {'form&
Hi,
See the following link to the docs. This should be exactly what you want.
http://docs.djangoproject.com/en/dev/howto/apache-auth/
Regards
Knut
On Tue, Nov 9, 2010 at 6:51 AM, Torsten Bronger
wrote:
> Hallöchen!
>
> I know that my question has a strong Apache component, but can
> anybody he
t;
> And in terms of correctly passing the variable, does it need to be
> explicitly passed in the 3rd line above: form = UploadFileForm(), when
> I want the title shown? Or simply when grabbing the request.POST/
> FILES?
>
> Thank you for your help so far,
> Ed
>
> On Nov 9, 3
try:
obj = Model.objects.get(x = y)
except Model.DoesNotExist:
On Mon, Nov 15, 2010 at 6:23 AM, Akn wrote:
> Hi,
> I would like to use get_object to retrieve an object form the
> database, but if the object does not exist I do not want to display an
> error page(404). Is there any co
Hi Stefan,
If you roll your own login view, this can be done by simply
redirecting to the correct url after authentication. You would have to
come up with the correct url by looking at the groups. Consider
something like this:
def login_view(request):
# login and authenticate..
user = Use
Hello fellow Django users,
>From time to time users of one of my applications has problems with
formsets. More specifically:
...my stuff...
File "/usr/lib/python2.4/site-packages/django/forms/models.py", line
399, in __init__
super(BaseModelFormSet, self).__init__(**defaults)
File "/usr/lib
ook at this: http://
developer.yahoo.com/yui/examples/container/panelwait/1.html
Just call the view and then when your external application returns,
the view returns the exit status and the popup closes. I use it to
import data and generating thumbnails, etc. It works great.
:-)
--
ic: orders =
student.order_set.filter(product=product) and then returns the
quantity from the first order object.
Any help would be greatly appreciated!
--
Knut Ivar Nesheim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
17 matches
Mail list logo