So just for completeness, here is the bit about avoiding the inner for
loop in this situation:
On Jan 17, 8:40 am, ptone wrote:
> matching_torrents = Torrent.objects.filter(name__icontains='x360')
> my_data = []
> for a_torrent in matching_torrents:
> info_objects = a_torrent.torrentInfo_se
It may not be as pretty as a parseable param array, but what about
just having all your args in a single JSON string. Are your template
authors savvy enough?
-Preston
On Jan 20, 3:32 pm, Andrew Ingram wrote:
> I'm building a simple banner/promotion system for a site. Aside from a
> few date-re
It doesn't seem like it would be that hard to combine django-
extensions export_emails command with Mailmans sync_members script
inside a cron job or a URL triggered script.
Usage: /usr/share/mailman/bin/sync_members [options] -f file listname
-Preston
On Oct 23, 6:06 am, Julien Phalip wrote:
The way I think of the value of the "through" table approach is when
you want to attach information to the relationship that does not
belong on either model.
I like a band/musician example.
A person can be a part of many bands
A band has many people
so here we have a classic M2M
But a person
I think a base class with subclasses is the best approach.
Define as much common behavior as possible, set up defaults for those
fields needed by your outbound API
How are you handling the branching lookup of what subclass to use?
You might name the subclasses in some way that they can be derive
On Oct 25, 2:55 pm, Bojan Mihelac wrote:
> Hi all,
>
> given an many_to_one doctests with Reporter/Article models, the
> following example would fail with "IntegrityError:
> many_to_one_article.reporter_id may not be NULL":
>
> >>> r = Reporter(first_name='John', last_name='Smith',
> >>> email
Well you've gotten farther than I have.
I can get passenger_wsgi working with hello world, and cherrypy
I can get those working with any combination of virtualenv etc
But with django I get the not too helpful Premature end of script
headers even with apache LogLevel set to debug.
-Preston
On
On Oct 27, 9:07 pm, Jacob Fenwick wrote:
> Wow, big surprise that someone else is having shared hosting issues with
> dreamhost eh?
>
> I'm importing a library I installed in site-packages in a module in a django
> app. When I call this django project, it returns with the error:
>
> ImportError
On Oct 30, 12:00 pm, Bill Freeman wrote:
> Yet another option is to write a widget that subclasses the existing
> one, and adds
> disabled='disabled' to the dictionary that will be used to populate
> the attributes
> (usually the 'attrs' argument, I think, and you will have to handle
> the poss
On Oct 31, 8:44 am, shacker wrote:
> At the university where I work, there is a LOT of momentum behind
> Drupal. A large and active users group, and dozens of departmental
> sites running it. I've succeeded in building a few departmental sites
> with Django but still feel like it's an uphill ba
On Nov 9, 7:49 am, NMarcu wrote:
> Hello all,
>
> I have a list of all users. My head table is made with the fields
> from User class. So look like this:
>
> username first name last name
> superuser status
>
> I want to make this head table editable. How can I change t
another option if you want to stay in just python and are on a POSIX
system is to use system file locking to ensure you don't get
concurrent calls to your updated function.
http://docs.python.org/library/fcntl.html#fcntl.lockf
-Preston
On Nov 9, 10:17 pm, Continuation wrote:
> Thanks Christoph
Is the admin in your installed apps in settings.py?
http://docs.djangoproject.com/en/1.1/intro/tutorial02/#activate-the-admin-site
Add "django.contrib.admin" to your INSTALLED_APPS setting.
-Preston
On Nov 11, 5:19 pm, neridaj wrote:
> I'm working on a standalone app and when I try to add i
Does your fixture result in a valid form?
if the form.is_valid() line doesn't pass, then you would get a 200
from the render to response...
-Preston
On Nov 11, 4:38 pm, Eesti Mate wrote:
> When I'm testing my form with assertRedirects I get the following error
> message:
>
> AssertionError: R
On Nov 11, 4:38 pm, "Richard E. Cooke" wrote:
> My client wants to use e-mail addresses for user names.
>
> the contrib.auth application does not have a restriction in its
> model. But the form code has put a regex on the field that disallows
> the ampersand (@).
fyi ampersand == &
>
> What w
You should change:
admin.site.register(PageAdmin)
to:
admin.site.register(FlatPage, PageAdmin)
also I don't see where you are using a generic relation - so the class
for your inline should be admin.StackedInline not
generic.GenericStackedInline
-Preston
On Nov 11, 8:37 pm, neridaj wrote:
> i
On Aug 26, 4:17 pm, thornomad wrote:
>
> Caveats: I would like to keep the original "synced" data in its own
> field and the "approved" data (as edited) in separate field. I
> imagine that the data first gets brought into the "edit" field, admin
> may make changes and save, but the "originatin
I'm setting up a conference website where a submission will have one
or more "reviews"
I've got the reviews set as inlines for submissions in the admin
The submission model has a "status" field that needs to go through
steps like "submitted" and "pending review"
What I'd like to do is when the f
On Nov 13, 5:13 pm, Preston Holmes wrote:
> if submission.status == "submitted" and submission.reviews.count > 0:
> submission.status = "pending review"
>
> Are there even simpler ways to do this that I haven't thought of?
answering myself - sor
do you have error templates defined?
http://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views
-Preston
On Nov 16, 12:55 pm, Alessandro Ronchi
wrote:
> If I put Debug = False in my django settings.py I receive an internal
> server error with no explanation.
>
> I'm using
On Nov 16, 8:31 am, Zeynel wrote:
> Thanks!
>
> I noticed that using
>
> class Lawyer(models.Model):
> ...
> ordering = ('last',)
>
> did not work.
>
> But this worked
>
> class Lawyer(models.Model):
> ...
> class Meta:
> ordering = ('last',)
>
> copied fromhttp://www.dja
Its not clear how you differentiate one measure as speed or another as
dir. Assuming only one has a link to another measure then you could
do something like:
results = Measurand.objects.exclude(entry__isnull=True).select_related
()
for speed in results:
speed_avg = speed.avg_value
dir_av
http://docs.djangoproject.com/en/1.1/ref/settings/#login-url
There are going to be some other places you will have to be careful
running django on a path other than /
-Preston
On Nov 19, 7:11 am, Stodge wrote:
> I added the @login_required decorator to my view but it redirects me
> to:
>
> htt
There are some details left out of how you want this to look.
The lower the level you try to make an object self protecting, the
trickier it's going to be.
The sweet spot I think here is a custom manager that adds a protect
filter, and perhaps a subclass of ModelForm if you need this in
forms. T
On Nov 22, 4:47 pm, Micah Vivion wrote:
> Greetings,
>
> I have a question on how to update an existing row in my database when one of
> the fields is my primary key. I am using ModelForm and Django-Piston - my
> main goal here is to have RESTful Post send to my webservice. I am able to
> hav
Perhaps there is a more efficient way, but in my quick test, one can't
filter() a queryset based on __class__ of the model, but seems one can
manually filter it afterwords:
qs = Player.objects.all()
for i,obj in enumerate(qs):
if obj.__class__ != Player:
del(qs[i])
On Nov 22, 4:32 p
On Nov 23, 8:51 am, Aizen wrote:
> Hi,
>
> I'd like to implement filtering for my app...currently, the filtering
> I have is stateless and so I can't add onto whatever value the user
> last selected. I've also implemented each filter separately, so I'd
> like to know how I can condense the five
On Nov 24, 1:28 am, Elyrwen wrote:
> Hello,
>
> I' ve been recently interested in Djagno framework and I am at the
> point of choosing it as the framework for my project. My application
> will not use database, but will use webservices to get data and then
> process it.
>
> I need a substitute f
I'm a bit confused on a few points here. The upload_to field
attribute should be atomic to the imagefield - it doesn't rely on
related models.
your change_upload_to creates a new screenshot - but doesn't connect
it to the current WebProject instance. Is that what you are trying to
do?
s = Scree
My expectation was that it was possible to 'stream' a response back to
a browser from a view, where that response is 'trickled' onto the
browser page. I had done this a while back in cherrypy and it worked
as expected.
a super simple view demonstrates the issue. Instead of a series of
numbers ma
On Nov 28, 11:07 pm, Preston Holmes wrote:
> My expectation was that it was possible to 'stream' a response back to
> a browser from a view, where that response is 'trickled' onto the
> browser page. I had done this a while back in cherrypy and it worked
> as e
On Nov 29, 4:50 pm, Continuation wrote:
> In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/
> #order-with-respect-to) it is mentioned that order_with_respect_to
> marks an object as "orderable" with respect to a given field.
>
> What exactly does that mean? Can someone give m
On Dec 4, 6:43 pm, jwpeddle wrote:
> Not having any luck with this. Surely there's a simple example out
> there somewhere of view agnostic DRY form logic.
The old thread you point to still makes sense.
A redirect can only happen in response to a request
a request is handled by a view
It soun
On Dec 3, 12:02 pm, Wayne Koorts wrote:
> >> > remember that an app can do a lot more than provide views.
>
> >> Explain this one to me. AFAICS, its just http request/response all the
> >> way down and this is basically done by getting a
>
> > An app can expose views, indeed. It can also expos
Not simply. The design of the tag to drop smaller time frames the
further out you are.
The source is all there for you to copy and modify into your own
custom filter, but that may be more than you want to bother with...
-Preston
On Dec 4, 3:22 pm, Continuation wrote:
> I use the timeuntil tag
On Dec 7, 8:56 am, Daniel Goertzen wrote:
> Thanks for the reply Bill. The problem I had with that approach is that
> after creating the product I have to worry about creating red and green
> ports. Likewise, upon deletion, I have to mop up the ports. Looking
> through the documentation, I di
Is there a way to make this the default at the project level?
I see a number of tricks out there for making it easier to do within
your own views, but I'm using an auth check in django-navbar, so I
need the full context on every page, and not all reusable apps I'm
using are passing the RequestCon
On Dec 11, 5:20 am, Aaron wrote:
> On Dec 10, 6:04 pm, aa56280 wrote:
>
> > if form.is_valid():
> > # do something and redirect
> > else:
> > render_to_response('foo.html', {'form' : form'})
>
> Would that leave the URL as displayed in the browser the same as the
> one for the form handling
On Dec 10, 9:05 am, cerberos wrote:
> I'm building a library system and have models Member, Loan and
> LoanItem (relationships as you'd expect), and an inline formset to
> enter a new loan (Loan and LoanItems).
>
> A member can borrow up to 6 books at a time, so my form contains 7
> individual f
On Dec 10, 11:02 am, jul wrote:
> hi,
>
> when submitting my form using jQuery form plugin, the request received
> by the target view is different than that received when the form is
> submitted in the standard way (with no javascript), and my Django
> template does not render as expected. When
On Dec 10, 8:41 am, Adonis wrote:
> Hi,
>
> I am trying to figure out the best way to do this.
> I have built a django application where users are members in projects.
> Thus, i need to assign users different permission sets that correspond
> to different projects. The django core permission sys
On Dec 10, 7:53 am, Superman wrote:
> Thank you DR for your response.
>
> Yes that helps in a way, as that is what I am planning to do. But at
> the moment I can store the name of Projects, Categories and Specs in
> the three different models. Where can I store the values for the Specs
> for eac
On Dec 10, 5:53 am, Shai wrote:
> Hi all,
>
> I'm not sure my title is correct. Here Is my problem: I want to use
> the django admin for data entry into some models. The models are based
> on actual paper forms. There are several forms. and they share some
> fields. I would like to follow the pr
On Dec 11, 10:40 am, Kashif Azeem wrote:
> Thank you Shawn for the reply now i have another problem i.e. on executing
> some commands like 'vgs' or 'lvs' it didnt executed and the warning
> generated as "Running as a non-root user. Functionality may be unavailable".
> Any idea how to solve this
Well something wonky is going on.
>From my readthrough of the code, it *should* get called on empty
formsets:
is_valid calls total_form_count to get a loop count
total_form_count should be positive even if forms are blank
is_valid then accesses form.errors inside that loop
(django.forms.formsets
I've hit a case where I want to use aggregation, but I think I'll have
to end up using a for loop.
I have items. They have an estimated cost and an actual cost
They may have one, the other, or both defined.
They are both DecimalFields
I can get the sum of the estimated cost with a simple aggre
On Dec 15, 12:02 pm, Continuation wrote:
> This is a question about django-uni-form. But I figure many people
> here may have experienced with django-uni-form so I'd try asking here.
>
> I'm using django-uni-form to style my form using the filter my_form|
> as_uni_form:
>
>
>
>
On Apr 26, 2:28 am, Kevin Renskers wrote:
> I also used the multiple select field found
> onhttp://www.djangosnippets.org/snippets/1200/
> with success, until I updated Django to the 1.2 beta release. It now
> longer works, always giving the validation error. I have no clue how
> to fix this, s
Has anyone adapted the interfaced used for adding permissions to a
group/user to allow one to add users to a group?
How reusable is the CSS/JS?
-Preston
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
Filemaker has a pattern where you can set the choices of a field to be
the indexed contents of that field.
Along with an "Other..." choice option to add a new value.
This is a very handy way of having user modified choices for a given
field.
Now I can think of several ways to do this in a form f
On Aug 31, 4:31 am, Shamail Tayyab wrote:
> Hi,
>
> I am working on a chat application in Django, how can I ensure that I
> do not have to poll the server for any chat data.
>
> Possible approaches that I've been to:
>
> 1. BAD - use polling.
>
> 2. Use long polling - bad approach afa browser
On Sep 6, 2:39 am, kmpm wrote:
> First of all to everyone, thanks for all good suggestions so far.
>
> Regarding UUIDs, one of the business requirements (which I don't
> control) is that the identifier that is to be used on barcodes and
> what not is to be in the format "YYMMDD" where i
On Sep 7, 1:45 am, Benedict Verheyen
wrote:
> Hi,
>
> i've written a calltracking application for my company and other apps will
> follow soon.
> Now, i would want a central way to access them and to assign rights on who
> can see
> and run what application.
> The dashboard or access panel wil
On Sep 8, 11:47 pm, Max_ wrote:
> Hello,
> I created a website, using the IPN-Function.
> Everything worked fine at first - the notification view was called and
> the signal was sent.
> But now (without any changes on the code), the IPN-Request from PayPAL
> doesn't call the IPN-view anymore. Th
On Sep 8, 5:04 am, Dave wrote:
> Hi everyone,
>
> I've found in documentation usage of custom file storage. There it is
> like that
> (http://docs.djangoproject.com/en/1.2/topics/files/#the-built-in-files...
> ) -
>
> from django.db import models
> from django.core.files.storage import FileSyst
On Sep 9, 5:11 am, justin jools wrote:
> Hi Muhuk,
>
> I am using django-simple-friends app, much easier to setup than django-
> friends.
> but need a little help and was hoping for some guidance.
>
> I have set up friends_list.html no problem:
> Friend List
> Friends for {{ user }}
>
> {%
On Sep 10, 2:43 pm, Christos Jonathan Hayward
wrote:
> P.S. Setting:
>
> .filter(is_invisible__in = [False, None])
how about:
.exclude(is_invisible__exact = True)
>
> is not working as intended; I seem to be getting no matches when I should be
> getting matches.
>
> On Fri, Sep 10, 2010 at 4:
On Friday, September 17, 2010, Stodge wrote:
> I have a bunch of models and I want to specify which models (tables)
> are stored on which PostgreSQL database. I've read the documentation
> and I know I can use the using() function. I'm just wondering this
> can't be specified in the model's meta d
On Sep 19, 1:50 pm, "J. P. Smyth"
wrote:
> Someone here wrote:
>
> "Mutli-column composite keys are not currently supported by Django.
> Adding support for multi-column keys (primary or otherwise) is
> something that has been long discussed, and there is agreement that it
> is a desirable featur
I'm pretty comfortable with the concept of mixing multiple objects in
one form. But I have a case where I have a model formset and want to
add a form field that represents a field from a related model, such
that the related model can be created if it is filled out.
As a simple example:
I have a
This is a cart/horse pattern I run now and then, and while I can think
of several sort of ugly ways to do it, I'm wondering if someone has a
clean solution in Django.
I'm going to use a gradebook as an example. The goal is to present a
user with a grid of lets say students and assignments to ente
Assuming you want to create a score per class - you should have
students go to a form that:
creates a student and first score if student does not already exist
creates a score for the student for that class and date
Basically the students should be creating the 'blank' scores when they
come in.
On Feb 9, 3:43 am, djangonoob wrote:
> Hello,
>
> I have the following problem which I hope someone could shed some
> light on.
>
> In my project I have the main site with login. I now implemented a
> questionnaire app that also requires a login. It would be great if
> someone could help me to t
On Feb 17, 9:36 am, justind wrote:
> I have an unusual Django application. I was wondering if someone could
> offer advice to the best way to handle a requirement. This isn't a
> standard application (and might not even seem like a good use of
> Django, but that's beside the point.)
>
> Redhat,
On Feb 28, 12:21 pm, Simon Davies wrote:
> figured out how to do it using the get_form method like this:
>
> class AccessoryStockOrderAdmin(admin.ModelAdmin):
> form = AccessoryStockOrderForm
> def get_form(self, request, obj=None, **kwargs):
> form = super(AccessoryStockOrderAdm
On Mar 16, 3:21 am, ALJ wrote:
> This is a bit of a modeling question that I am struggling to get my
> head around. How would you model this scenario?
>
> I have to record expenses that are of 3 different types.
>
> 1. Fixed - The name of the expense and unit amount are fixed. For
> example, "in
On Mar 15, 10:27 pm, pyleaf wrote:
> I want to use manage.py as a command in script file.
> e.g,
>
> >> python manage.py shell
> >>from testproject.testapp.models import Testee
> >>from testproject.others.modules import utils
> >>utils.do(Testee)
>
> Above are commands in command window manually
On Mar 23, 8:20 am, jrs wrote:
> Is there a flag somewhere which will allow me to disable django
> messaging?
>
> Thanks
You give too few details. The messaging system is something that is
opt in, you have to create messages, and then display them in your
template. Are you trying to alter an
How you use a virtualenv in production depends on all the parts of
your production stack. If you are using mod_wsgi, search mod_wsgi +
virtualenv, gunicorn, etc
You might also consider one of the new "platform-as-a-service" hosting
options that basically solve this for you.
-P
On Sep 19, 10:55
On Sep 20, 12:07 am, Micke wrote:
> Thank you for your quick reply!
>
> My socket server is ready, but I dont know where to import it in
> django so it starts when django starts?
You are going to run your socket server in a different python process
than Django. Django is based on more of a CGI
I've just pushed an initial release of a tool that will hopefully make
it easier to make apps more easily shareable.
The idea is something like this:
manage.py startapp gets you a start, but once you get something to the
point where you might want to share it, now you've got to wrap it up
in all
71 matches
Mail list logo