> I want to check if the currently logged in user has permission to edit
> a particular student.
>
> s = Student.objects.get(pk=student_id)
> parents = s.parents.all()
>
> And then check if logged in user.id matches against any of the parent
> ids.
Looks like you're interested in something
> # Assume these are key-value pairs
> AGE_CHOICES=(
> (1, '0-3'),
> (2, '3-6'),
> (3, '6-15'),
> )
>
> class CustomForm(forms.Form):
> age = forms.ChoiceField(label='Age', choices=AGE_CHOICES)
>
> How can I get the value (not the key) of the age attribute after validation?
>
>
> return render_to_response('webpage.htm', {'manu': s, 'thelist':
> mylist})
>
> /
>
> Here is what I have in my template
>
> {% for a in manu %}
> {{ thelist.{{forloop.counter0}} }}
> {% endfor %}
Given that you're not using "a" in your loop, is there
> If your data is in the 'data' context variable, then try this:
>
>
> {% for d in data %}
> {% if forloop.counter0|divisibleby:"2" %}{% endif %}
> {{d}}
> {% if forloop.counter|divisibleby:"2" %}{% endif %}
> {% endfor %}
> {%
>> I don't know whether this would be better done by replacing the
>> INTERNAL_IPS functionality, or adding a second similar means, but
>> for my app, it's helpful to know if the user is "internal" or
>> "external" as defined by several netmasks/CIDR addresses. Rather
>> than adding every
I don't know whether this would be better done by replacing the
INTERNAL_IPS functionality, or adding a second similar means, but
for my app, it's helpful to know if the user is "internal" or
"external" as defined by several netmasks/CIDR addresses. Rather
than adding every address in the
> I have an issue with users doing a lookup on street address.
[snip]
> This seems like asuch a common problem; are there any
> libraries for this; what is the "correct" way to handle this?
> How do google; Mapquest and Yahoo do this? (I don't have quite
> their resources; but it would point me
> self.create(50, 50, "round")
>
> def create(self, wsize, hsize, shape):
> var = self.get_shape_filename()
> etc
>
> ///
>
> I get an error whenever it hits the line 'var =
> self.get_shape_filename()'. The error is:
>
> object has no attribute
> Could you do something like a wrapper object in your view before it
> hits the context? The wrapper below relies on a field list, but you
> could easily have it inspect the Meta class on the model and build the
> list.
This is a nice sort of idea. Is there a way to expand it from an
I've been playing around with some ideas and was hoping to get
feedback about what the "right" sort of way to do it would be
(the Django analog to "Pythonic").
Various models have sensitive fields associated with them that
should only be available to a template if the requester is on a
"secure"
> well I have a book on php,apache and mysql so are there? any
> differences between mysql and postgreSQL for django
> (proforanmce features etc.)
They're becoming closer in terms of their features. A couple
observations in my experience:
- MySQL tends to be faster and have some nice "my
> These guys seem to have very tempting packages. They say they support
> django. What I'd like to know is what kind of support? Do I have to
> install it on my home folder, or is it preinstalled on their servers?
I know two folks using WHB, though not for Django. Both are
using the basic
> Should I use trunk for development? Or is there any branch
> better for development? (with regard to the introduction of
> newforms)
I think the general rule of thumb is:
If you absolutely must have a stable API, and don't need anything
more than what 0.96 offers (lots of new features and
> I've run into a problem trying to model something in Django
> and could use some advice. In a nutshell, I'm trying to
> relate a single table to multiple (other) tables using a
> single foreign key field and foreign key type. I'm aware of
> the manytomany relationship type of Django but I
> I need to be able to query an object that has a set of related
> objects - the query is to find which objects contain the same
> set of query objects. For example the main object could be a
> research paper and the related object would be a set of topics
> that the papers could contain.
This
Malcolm,
Thanks for taking the time to look into my questions.
>> I'd like to build some automated tests as I go along, but I'm not
>> sure how to go about building a test harness that creates a
>> temporary model with my field-type, creates a table in the DB
>> with that field in it, and then
Using this section of the Master Class notes found here
http://toys.jacobian.org/presentations/2007/oscon/tutorial/#s103
I've been working to create a custom field-type for consolidating
some of my work that was previously duplicated across several
models. The field-type in question is a
> Personally I wonder if this is due to a conception that the *project*
> is somehow the deliverable;
I think James touches here on one of the key factors in this
whole issue. If I have a project that I'm making publicly
available, there are many project related settings that need to
be
>> Depending on the checkbox selection it might produce a sql string
>> like:
>> SELECT user_id FROM Bio WHERE (race='A' OR race='W' OR race='H') AND
>> (eye_color='B' OR eye_color='G' OR eye_color='H') AND (hair_color='W'
>> OR hair_color='B')
Though my solution would be logically about the
> class Bio(models.Model):
> HEIGHT_CHOICES = (
> ('A',"< 5' (< 152cm)")
[snip]
> ,('Z',"7' 0'' (213cm)")
> ,('*',"> 7'' (> 213cm)")
> )
> WEIGHT_CHOICES = (('A',"<100lbs (<45kg)"),('B',"100lbs
>> Is there any difference between:
>>
>> r'^accounts/(?P[\w-]+)/$'
>>
>> and
>>
>> r'^accounts/(?P[-\w]+)/$'
>
> they match the same.
To expand on Paul's answer, yes they're the same. The only time
order matters is detailed at [1] where the character-set "[...]"
notation is detailed. Namely
> I'm working on a brithdate/deathdate table and am having problems with
> this limitation. Realize this is a result of python's datetime
> strftime() issue but was wondering if anyone figured out a django
> workaround that wasn't a total hackfest.
Since I haven't noticed much feedback on this,
> Having your URLs end with a slash is good. It looks better and shortens
> your pages address. Also, in the future, you may find that not all of
> your pages are going to be text/html.
While I'm ambivalent about the trailing slash (the below assumes
that it's disabled), many of my urls/views
> class Property(models.Model):
> def isValidUKPostcode(self, field_data):
> p = re.compile(r'^(GIR
> 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HIK-Y][0-9](|
> [0-9]|[ABEHMNPRVWXY]))|[0-9][A-HJKSTUW]) [0-9][ABD-HJLNP-UW-Z]{2})$')
> if not p.match(field_data['postcode']):
> Thanks. Yes, using relative paths is the right idea - it's a shame that
> the base url's have to be hard coded in the templates. I understand
> from a web efficiency standpoint of Django not handling static content
> but from an application development standpoint this is a real complexity
> similar - sooo, do you think it's worthwhile to pull this together on a
> about / welcome / introduction page under a heading like "How Django
> Works". Then when these comments come, they can be pointed to the
> page. If you think it's worthwhile, I'll post some text to a
> documentation
> the symlinks I've added. For completeness sake, here's the full
> listing of my site-packages directory:
>
> www:/usr/local/lib/python2.5/site-packages# !ls
> ls -lAF
> total 1034
[stuff]
> -rw-r--r-- 1 root staff885 Aug 30 19:30 easy-install.pth
> lrwxrwxrwx 1 root staff 26 Sep 28
> i have to quickly make a few changes. I have replaced one
> email address in views.py by another. Now, i'd like to know if
> i need to recompile this views.py file, and if so what is the
> exact command ( will python views.py work).
It's non-obvious if you're coming from the compiled-language
> hi people, I got a little question, how can I make some users add news
> (model News), modify only news owned by him or even delete his news, not
> others users news, but only admins can publish all of them?
http://www.djangoproject.com/documentation/authentication/#permissions
The stock
> So I need to get the videos that match ALL the keywords that I provide
> in the query, like "give me all the videos that contain the keywords
> 'horse', 'country' and 'green'". These videos may contain another
> keywords or not, but I need them to contain at least ALL the keywords
> provided.
>
> an obvious one is to check whether the query uses standard syntax and
> features. and if not, rewrite it so it does.
>
> also, try to test it on different databases.
For those items that aren't quite so portable, it's helpful to
follow the Django examples like you'll find in
> I'm developing a Django project that's going to handle with
> big sets of data and want you to advise me. I have 10 internal
> bureaus and each of then has a 1.5 million registers database
> and it really looks to keep growwing on size on and on. I
> intend to use Postgres.
>
> The question:
>> I've been able to dig into this a little bit more and it
>> looks like django.utils.simplejson.decoder doesn't support
>> the '\x' escape character. Is this an intentional omission,
>> a bug in Django, or just me misunderstanding Python?
>
> JSON does not support the '\x' escape; see json.org
> if not request.GET.get('avatarkey',''):
> raise Http404
> elif len(request.GET['avatarkey']) != 36:
> raise Http404
Just as a side-note, these two are a bit redundant. I'd suggest
either
if 'avatarkey' not in request.GET or
> if (search_query['organisation']!=""):
> jobs = jobs.filter(organisation=search_query['organisation'])
> if (search_query['region']!=""):
> jobs = jobs.filter(region=search_query['region'])
> if (search_query['category']!=""):
> jobs =
http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L266
In the function that Alex linked to, the answer to your question
is on line 266:
backend.ops.last_insert_id(...)
This varies from backend to backend, but is abstracted enough to
know what the most recent insert
> "you redirect 404 errors to a script, which looks at the requested
> URL, decides whether it should actually exist, and if it should it
> builds the file from the database, saves it to the filesystem, and
> then returns the page to whoever requested it. Next time that URL is
> requested, the
> Obviously the Django field types provide more semantics than the basic
> database datatypes. Thus I assume that whenever there is a new type of
> field which does not fit in the given categories, it is a good idea to
> define such a new datatype. Correct?
most likely.
> Example: I would like
> TRIM would delete any whitespace from the string (tabs, newlines,
> spaces, ...). SPACELESS comes close as it will convert all the
> whitespace into just 1 space.
Should TRIM delete *all* whitespace, or just leading/trailing
whitespace? Trim functions usually just remove leading/trailing
> I guess the order_by('price') is working. However, it's not
> working how I want it to. When I do the order_by on price
> django think that a price of 59.99 is greater than a price of
> 129.99. I guess it's looking at the first character and since
> a 1 is less than a 5 it puts the 129.99
> Thanks for taking a look. Still feeling my way on what I need to post
> to be most helpful.
I'd say you did correctly, describing the problem and not
flooding the list with 20 diff. config files and code...if the
list needs more info, we usually ask for it :) However, for
future reference,
>> I looked over the docs
>> http://www.djangoproject.com/documentation/0_91/templates/
>>
>> but the closest thing was SPACELESS
>
> - What does a TRIM filter do? Perhaps it change the colour of the trim
> on your website?
I suspect what some languages call Trim is the Python
function/method
> Between caching, profiling, and having a good sense of what your
Profiling...the #1 thing to do.
Without profiling the app under "normal usage" (common actions &
browsing patterns gleaned from the current deployment) scaled to
high loads, you're just twiddling knobs and wasting time.
If
> However, when I save the record in the Django admin, I get this:
>
> [Errno 25] Inappropriate ioctl for device
>
> Exception Location: build/bdist.linux-i686/egg/twitter.py in
> _GetUsername, line 1498
A couple pieces of information would be helpful:
Which OS?
Could you provide the
> Any special reasons debian based installs are better than
> fedora based ones?
I can't say there should be any sort of major difference once
meta-package programs were instituted for dependency tracking.
My understanding is that Yum may do this sort of thing.
I tried Red Hat early in the
> (live publicly viewable sites only)
> 1. What OS are you using to run Django on?
OpenBSD and Debian Linux
> 2. What OS do you think is most popular for running Django on?
Debian and its derivatives (Ubuntu, etc...anything using apt)
> 3. What OS do you think is most suited for running
>> Ok, the query should then be:
>>
>> Offer.objects.filter(Q(terms__term__exact = 'ThemePark') &
>> Q(terms__term__exact = 'London'))
>
> Still returns an empty query set. Checking some of the other posts I
> think this is a failing which is particular to ManyToMany
> relationships
the
> I'd like to make a filter composed by ORing several Q objects, each of
> which acts on a different model field.
> For example I have a model with the fields "name", "title",
> "description" and I want to make a Q object like the following:
> Q_name = (Q(name__istartswith="hello") &
> Well, secondly I have one question: I have a model A that have a field
> "year" that means the year that A was made. I just want to know if
> it's best (for performance) to code as:
>
> class A(models.Model):
> year = models.CharField(maxlength=4)
> [...]
>
> or
> class A(models.Model):
>> These changes are in preparation of some exciting news, but I'll leave
>> y'all in suspense until next week.
>
> You're rewriting Django in Java! Finally, enterprise capability!
I thought it was one of the following:
- adding "2.0" to the official name to make it a "Web 2.0"
> I'm setting up a new server to host my Django projects and they don't
> each use the same version of Django (0.95, 0.96 and svn). Is their a
> way to configure each virtualhost to use their own version of Django ?
I've done something like this whereby I had several of the
development branches
> SELECT t
> FROM (
> SELECT thing.thing_id AS t, COUNT
> (thing.thing_id) AS c
> FROM (
> SELECT thing_id
> FROM myapp_thing_sources
> WHERE
> I am looking for a python based utility that will allow a user to sign
> their name with a mouse and save the resulting image for inclusion in
> a PDF. Has anyone heard of something like this?
Well, you're asking a python question on the Django list.
Unless you're trying to do this in a
> am new one to django
welcome
> am working in php mysql
I'm sorry ;)
> me whats django and how its defer from php ruby on rails...
Django is frequently describe as "Ruby on Rails, but using Python
instead of Ruby". That alone is enough for me to like it ;)
There are some other more
> i find this code translate enter once to "" , and enter twice is
> still "".
> i want keep "", ie. enter once i get a "", enter twice i get a
> ""
> is this possible?
Ah...I misunderstood what you wanted. Yes, the same sort of
thing could work:
r = re.compile('([^\n])\n([^\n])')
text =
> particular table. I've got it working like this in my urls.py:
>
> latest_info_dict = {
> 'queryset': Page.objects.all(),
> 'slug': Page.objects.latest().slug,
> }
At this point, your urls.py has a semi-static dict in it...most
importantly, latest_info_dict['slug'] is set to a
> I've a projects that should share the db models
>
> I know I can create a models.py file in the project's home dir but
> manage.py syncdb doesn't read it from there (and I really want to keep
> it all on Python code without need to run mysql -u app -p)
I've done this in one project by
> but this is the same as enter twice, user must remember to end with
> one or more space.
>
> is there other plugin like markdown which is a truely what they is
> what they get?
Well, it's possible to pre-process the user's input with
something like
import re
add_br_re = re.compile('\n+')
> How can i best program a view that both adds and updates certain
> values in a table. I know that django can tell the difference when you
> want to update and when to insert. I tried using the
> Classname.objects.create(args)...but this doesn't seem to work...it
> just inserts instead of
> Static content is served by http server not django.
> http://www.djangoproject.com/documentation/static_files/
For development purposes, in my urls.py after defining all my
"business" urls, I have
from sys import argv
if 'runserver' in argv:
urlpatterns += patterns('',
> class Property(models.Model):
>
> thing = models.ForeignKey(Thing)
> property_type = models.ForeignKey(PropertyType)
> value = models.CharField(...)
> ...
>
> I want to find, for a given PropertyType, all the Things that are
> lacking any Property of that type.
>
>
> What I currently have to do is to define each view (such as to handle
> "foo" above) as:
>
> @login_required
> def foo(request, cid):
> c = get_object_or_404(C, pk=cid)
> if user_can_access_c(request.user, c):
> # do something that's allowed
> # ...
> else:
>
> I'm developing a couple of ideas and I need other people's
> input. The applications are currently on my development PC at
> home. Are there any sites that offer free Django application
> hosting (not source)?
I don't believe I've come across any such generous soul. Likely,
your best option
> Tim, in your code:
>
>filename = 'foo.tab'
>for i, line in enumerate(open(filename)):
> if i == 0: continue # skip the header row
> (fieldname1, fieldname2, fieldname3 ...
> ) = line.rstrip('\n').split('\t')
> cursor.execute("""
>INSERT INTO app_foo
>
> But at the same time, this is *not* something Django is designed to
> do. On the other hand, it *is* something cron is both designed to do
> and quite good at. Django is not a replacement for the operating
> system ;)
"uh, yeah...I was trying to rewrite Emacs in Django..."
:)
-tim
> I know my question could be a bit silly but... I dont know how to do
> it. Do anybody know how to do arithmetic operations in a templete?
>
> {{elem}}
>
> what I want to do is something like {{ elem }} + 100
There's an "add" filter...
> Have any of you guys imported excel/cvs by using
> Python/Django? I need to import 1000 products for a shopping
> site and I'd like to learn the fastest and easiest way to do
> so.
I do this day in and day out :)
I prefer tab-delimited because it's easy and clean, though
Python's built-in
> I want all of my "views" (HTML pages) to use a common header, footer
> etc.
>
> What is the python/django way of achieving this?
http://www.djangoproject.com/documentation/templates/#template-inheritance
It's somewhat backwards from how other template-languages work
that I've used, but it
Has there been any work on a "RevisionControlledField" type?
Likely, a standard text-field with some controls for selecting
versions or branches thereof, and saving becomes a bit complicated.
I'm looking for ideas/suggestions/caveats for such a field (and
if such a beast already exists,
> I want to define just once how to render any arbitrary lists of
> tickets into HTML, and then use that same operation in both places.
>
> In TurboGears, I would build a custom widget, and then use that inside
> my template. I suspect that the Django community has a similiar tool
> available,
> Are you using a django friendly hosting company?
One other distinction I would make in your data-collection is
"Django-capable" versus "Django-friendly". This issue came out
on the list earlier. Some providers "support" Django which means
"if you can figure out how to make it run, we'll
> Someone wants to create a browser UI for an access db. can't change the db,
> even though A) access can talk to other engines via odbc and B) it will cost
> someone else more.
>
> python does odbc, there is already a MsSql_oledb for django module, so all I
> need to do is make one for
> I've downloaded the tarball several times - each time the archiver
> shows it as corrupt (other tarballs work fine). Using Ubuntu Feisty.
> (and the Feisty backport package is broken as well).
Given the multiple responses that the tarball seems fine (tested
on WinXP, OS X, FreeBSD, Ubuntu
> I have a "poem" model that belongs to "user". The "poem" model an
> "approved" attribute. I want to print a list of users and display only
> their poems that are approved.
>
> What do I specify in the Queryset to make this work?
>
> I want to do something like this:
> u =
> self.assertEquals(list(self.movie.details_genre.all()), "[ Action-Komödie>, ]")
> ...
>
> output:
> AssertionError: [, ] !
> = '[, \xc3\xb6die>]'
First, it looks like you're comparing a list of objects to a string.
I'm not sure if QuerySets override the magic method to determine
if they're
> I'm quite new to django, but I'm rather confident that I have looked
> for it pretty well. Feel free to yell, if I'm asking a stupid
> question.
We'll, you've at least learned somewhere that Django shouldn't be
handling your media...that's at least something :)
> I cannot understand how I
> About the only way to do that is just grab (.*) from the url, and
> parse it in your view, looking up slugs as needed
Collin's suggestion may sound daunting, but it's really quite easy:
your urls.py can have something like
r"^(?P(?:[-\w]+/)*[-\w]+)/?$"
and then in your view:
def
> if you have an app named "tests" and you add it to your INSTALLED_APPS
> (which I guess is necessary) - does django create any tables or any
> content (e.g., additional content-types) outside the test-database?
I would proffer that unless there's a pressing reason to name
your app "tests"
> My problem is that the application requires private folders
> for all the logged in users to store their content, and hence
> my problem. I know that you can password protect folders
> using both apache and litehttpd however their methods don't
> seem suitable. I need to dynamically add
> 1. where to define the testing? in models.py or in tests.py? I´d like
> to seperate the testing from models.py, so how can I write doctests
> in a seperate file (the example in the django documentation only
> explains seperate unit-testing)?
my understanding is that doctests can only be
> NO_COLOR = "---"
> styles = Choice.objects.get(id=h.id).style_set.all()
> if ('color' in request.POST) and (request.POST['color'] <> NO_COLOR):
> styles = styles.filter(color_cat=request['color'])
> for u in styles:
> dict[u] = u
>
>
>
> I did notice that whenever I
> Why do I need to do the following:
>
> if ('price' in request.POST) and (request.POST['price'] <>
> NOT_PICKED):
>
> instead of
>
> if request.POST['price'] <> NOT_PICKED:
In the event that for some reason that field hasn't been sent
along. This could be some other site using you as a web
> Thanks for the reply. Very helpful. In the past I did try the
> statement:
>
> if 'price' in request and request['price'] <> NOT_PICKED:
>
>
>
> However when that line was accessed I would get the following error:
>
> KeyError at /rugs/searchresult/
> '0 not found in either
> If anybody has any suggestions on how to make the code more
> optimized would be appreciated. Here is my view:
First, a style issue: it's considered bad form to shadow the
python built-in "dict" by using a variable with the same name.
Second, my eyes are bleeding from the convolution of
>> How do I enable multiple user account login in one computer?
>> I don't know what is the disadvantage if this works this
>> way, I just need it for development and testing purpose.
>
> If I understood your question right, you don't have to enable
> it. :-) Just create a new user in the
> if request['color'] == "---": # This means no color was
> selected
> mycolor = ColorCategory.objects.all()
> else:
> mycolor = request['color']
> ...
> i = Choice.objects.get(id=h.id).style_set.filter(color_cat=mycolor)
>
>
>
> So, as you can probably
> `emplyoee_contract_id`=None,`employee_assignment_id`=10
>
> as you can see the last update statement has employee_contract_id =
> None ... which I don't know what make it happen?
While it was likely just a transcription error, did you mean
"emplyoee_contract_id" or "employee_contract_id"...I
> r'^order_by_(?P-?(title|attachment|date))/(?P[0-9]+)/',
>
> regex error
While I'm not sure on it, you might try making that a
non-capturing group using "(?:...)":
r'^order_by_(?P-?(?:title|attachment|date))/(?P[0-9]+)/'
which may be less ambiguous to a reverse regexp-parser (which it
> Now I want to get all objects, which have set tag "food" *and* *have
> not* set tag "cake".
>
> This get all objects with tag="food" set (obj1..obj5):
>
>Obj.objects.filter(tags__in=[Tags.objects.filter(name='food')])
>
> This get all objects, which haven't set tag "cake" (obj1..obj3,
> I hope the community here knows the answer to this question: is this
> gorgeous project available at http://www.djangobook.com/en/beta/ not
> dead?
>
> It's very sad to see that it hasn't been updated since January.
he's resting. Remarkable book, the Norwegian Django book. 'e's
stunned.
> I have a form that will contain 3 select input types. The user is
> going to have the ability to narrow down the products by selecting a
> value in these 3 select boxes (Price, Size, Color). However, the user
> also has the ability to not select anything. In this case I would
> want to
> what is the nice way to provide a print function on a dot matrix
> printer for django apps aside from generating a printer friendly page?
My understanding is that there isn't any "nice way...aside from
generating a printer friendly page".
The web browser can render to a printer context.
Browsing the lineup of speakers at OSCON, I noticed a familar
face in the top banner, front & center:
http://conferences.oreillynet.com/pub/w/58/presentations.html
How's it feel to be the poster-child for OSCON? ;)
-tkc
--~--~-~--~~~---~--~~
You received
> There are professional-looking website templates for sale in several
> places (templatemonster, etc).
> Can those be used easily with Django ?
> Do they need to be designed specifically for Django ?
Django's templates are considerably more friendly towards such
uses than many templating
> For instance, if you also had categories of users and wanted to be
> able to list the users in each category, a 'human-friendly' url
> scheme might look like this:
>
> www.mysite.com/users/matt --> go to my area
> www.mysite.com/users/jess --> go to Jess' area
> www.mysite.com/users/mark -->
> Seems to work now with:
> w=240
> pricelisttable_set.extra(where=["""(table_pricelisttable.width - %s)
> >= ( SELECT Min(Abs(pl.width - %s)) FROM table_pricelisttable pl)
> """], params=[w, w])[0]
I would be very surprised if it works now as described with ">="
rather than "=". It's basically
> In pure sql we can do :
> "select min(abs(width-150)) from quote_pricelisttable where name_id =
> 1 and width >= 240-150 and width <=240+150;"
>
> How to make it work properly from django ORM?
Did you try playing with the extra() call I included in my
previous email? It should do what you
>> but those min max constraints are so common? why not include
>> it?
>
> Because "common" is different for any given user and/or site.
> I think *I've* only written a single form with min/max
> validation, FWIW. Designing a framework is hard; you've got to
> search for things that are as close
> I have two different database file, so I can't copy it. I would like
> to extract only the data of the app which I would port to other
> machine.
I'm not sure how you ended up with two database files. However,
I suspect Daniel has the right idea: just copy the .db
file. If there's stuff in
>> events = {} # or SortedDict if order matters
>> + new_lists = 0
>> + appended_lists = 0
>> for event in future_events: # one DB hit here
>> - region = event.club.region
>> + region = str(event.club.region)
>> +if region in events:
>> + appended_lists += 1
>> +
401 - 500 of 660 matches
Mail list logo