Hi everybody,
I have 3 models:
built-in User model,
class Project(models.Model):
author = models.ForeignKey(User, verbos_name=_('Author'),
related_name='projects')
title = models.charField(_('Title'), max_length=150)
class Vote(models.Model):
project = models.ForeignKey(Project, verbos
_name
attribute, but if some project has more than 1 vote, it duplicated
this amount of times.
Please help me to ORDER BY M2M FIELD COUNT. Be happy)
Kostia.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group
My project will save our planet! You must help me.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@google
Wow, men, thank you both. I'm trying.
About distinct...
it is slow
as far as I know
ha-ha-ha,
this is the
end of rhyma
Kostia
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@g
projects =
projects.annotate(votes_count=Count('votes')).order_by('votes_count')
is the solution!
Took this from docs.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsub
ctions for each form id. So the only one function for executing get
ajax call considered.
Am I right? I'm trying things to be done, but somethins is wrong. Just
explain me the conception of GET or POST ajax methods in case of
having to execute multiple Ajax calls on a single page.
Kostia
-
The last one task for our super Django startup! And we will save the
world)
Wait, do you know why Django? He was a jazz musician. Really,
developers of Django are great guys!
Jazzy blue from me, Kostia-man.
--
You received this message because you are subscribed to the Google Groups
"D
http://github.com/vaxXxa/projector/network
here is our free beautiful project
ajax is on the project.html page
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe fro
How to open my web site on development server to others?
I use python manage.py runserver 0.0.0.0:8000
But something stops others to visit my site. I use Linux Fedora, maybe
I should shot down SE Linux?
--
You received this message because you are subscribed to the Google Groups
"Django users"
ot;{'response_text': 'error recieved.'}",
mimetype="application/json")
What is going wrong? When I press the Vote button, the form is
submitted, but nothing happens.
Kostia
--
You received this message because you are subscribed to the Google Groups
"Dj
;response': 'error'}",
mimetype="application/json")
EVERYTHINS IS OK. THE VOTE IS BEING SAVED, BUT THE ONSUCCESS
FUNCTION OF AJAX CALL DOES NOT MAKE ANYTHING! So I can't hide the Vote
button or even alert the popup window for simple test.
Please, help. The c
I have found the whole solution!!
The last question I have is how to bind one ajax function for many
similar forms which is in the case of many Vote forms and buttons on a
single page.
Thank you.
Kostia
--
You received this message because you are subscribed to the Google Groups
"D
I have a model Favourite with fields User, Project, Date, what means
that some user put some project as favourite on some date. I take all
favourites filtered by this user and I want to INNER JOIN that info
with Project model. How can I do that?
Something like projects = Favourite.objects.filter(u
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
class Project(models.Model):
author = models.ForeignKey(User, verbose_name=_('Author'),
related_name='projects')
title = models.CharFiel
Still need your help
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options,
Thank you very much Roald,
What is faster:
projects = Project.objects.filter(favourites__user = request.user)
or
select_related('project')
?
Kostia
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
Well, I used
projects = projects.filter(favourites__user = request.user)
And then I tired to order by 'date' field, which is in the Favourite
model like here:
projects = projects.filter(favourites__user =
request.user)#.order_by(filter_field)
And it throws me an error: "Cannot resolve keyword '
I use in settings.py:
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'main',
'templates', 'static').replace('\\', '/')
MEDIA_URL = '/static/'
And then simply in an html file:
Where the full folder path is the ../project_name/main/templates/
static/styles/nav.css
--
You received this
static is a folder, it is not a view
our project code can be found here
http://github.com/vaxXxa/projector
You may look at and compare.
Good luck.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us.
Our startup http://github.com/vaxXxa/projector has to be hosted
somewhere.
I'm looking for someone who can help.
Be happy,
Kostia.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
Currently looking at. So many choices!
I'm a person with not enough money.
What do you think about Canadian https://servqc.net/ one? It is very
cheap from the list.
I live in Ukraine. For me it is better to pick up European or US host?
Kostia
--
You received this message because yo
Thank you guys.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit
ffect it will cause on the society.
An idea just to bring so-called value-business on the top and help
authors to find people to help with their ideas/projects.
The web site is social oriented and we are looking for any hosting
solution.
I will consider any propositions.
Thank you very much.
K
Thanks, I already know about webfraction. Great site.
If anyone can provide cheaper solution, hosted in Europe, please write
me.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
I'm looking for a free Django hosting. Please, write me, if you can
help.
The web site will look like this one http://kostia.pythonic.nl
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegro
I'm looking for private person from some government institution/
university or with his own hosting server. The web site will be
launched for a couple of months. Than I will find payed hosting
provider and now I just want the site to be published.
--
You received this message because you are subs
/projector$ python manage.py runserver
127.0.0.1:9980
Validating models...
modeltranslation: Registered 0 models for translation ().
Unhandled exception in thread started by
Traceback (most recent call last):
File "/home/kostia/ENV/lib/python2.6/site-packages/django/core/
management/comman
After I do:
kos...@baikal$ python manage.py runserver
Error: No module named messages
kos...@baikal$
Django 1.2.1 with python 2.6.5+ devel installed.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
SOLVED!
On Aug 4, 3:48 pm, kostia wrote:
> After I do:
>
> kos...@baikal$ python manage.py runserver
> Error: No module named messages
> kos...@baikal$
>
> Django 1.2.1 with python 2.6.5+ devel installed.
--
You received this message because you are subscribed to the G
I have a contact form on my site.
The code which send the emails after successful validation is below:
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
if request.POST['send_me']:
send_mail
Yes, Linkedin mostly is written on Java.
Did you see its menu and the search to the right? People, Jobs,
Answers, Groups.
I would like to add something similar to this on my site.
I wish to learn about search mechanisms.
Could you please point me at positive direction?
--
You received this me
Do we know some alternatives for using popups in python/django?
Here is the SqueezeBox from Mootools JS library -
http://digitarald.de/project/squeezebox/
I used it in Joomla / php.
I would like to create a great popup form to prevent the user from
redirecting to the new page. It will be awesome
What is wrong?
My view function:
def project(request, project_id):
try:
project_id = int(project_id)
except ValueError:
raise Http404
myProject = get_object_or_404(Project, id = project_id)
events = Event.objects.filter(project = myProject)
return rende
I don't have time to watch your code, but...
Take a look here http://www.tummy.com/Community/Articles/django-pagination/
I set up this cool pagination in 15 minutes without errors!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
use table = ModelName.objects.all().order_by("filter_name")
It is ordered by id field apriori.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, s
Part of my urls.py:
...
url(r'^project/(?P\d+)/event/(?P\d+)$',
views.event, name="event"),
url(r'^project/(?P\d+)/event/edit/(?P\d+)$',
views.edit_event, name="edit_event"),
url(r'^project/(?P\d+)/event/new/$', views.edit_event,
name="new_event"),
...
I see, I need to write this:
{
The question of clarity:
What is the best way to do:
project.pk
or
project.id
?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
d
I have a footer on my site. It has to be filled in with data which
comes from the database. Each view will have to load this common
footer data. How can I organise such a behaviour in my views.py file?
I guess it is a separate function, but I'm django newbie, so please,
keep your pulse.
--
You r
Great, it works and is easy to understand. And that is despite an old
article.
Thank you, man.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, se
I would like to know what search engines are used in web sites like
Facebook, Linkedin, Twitter and so on.
Are they simplistic database queries or sophisticated search solutions?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
It seems the question is answered.
To continue, Tim, do you use haystack? I passed its beginning tutorial
and configured with xapian through haystack-xapian module. Now I'm
discovering the other haystack docs and api. Not everything is clear.
For example I have a user with name Bob. When I type in
Also I will be happy if someone can explain the drill-down (faceting)
or “More Like This” features.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this grou
Yes, somebody can use template tag, somebody content processor and the
most intuitive solution is to use template inheritance, as was
suggested.
Thank you, Tim. Wish you good luck. I loved your musician web site.
--
You received this message because you are subscribed to the Google Groups
"Djan
Hi,
I want to create an Inbox service for users of my django site. Can
anybody point me to the right direction? Any modules or it is better
to do myself?
Kostia
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
What is the purpose of email activation?
Why can't we just use username/password on the site.
The one bad fact - is when somebody uses foreign email address. This
is not a reason to use activation. Show me more facts please.
--
You received this message because you are subscribed to the Google
A. If we have a form of registration only with password and username
fields. Then the user may write some fake email (foreign).
B. We use registration activation link sent into email like it is done
on Facebook, Linkedin, Twitter and so on.
Why B is better than A? Why A is a wrong solution? Any a
And now there is a time for stupid question:
how to translate my English site onto different languages?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this
I used rosetta to translate strings. How can I switch language of my
site and see the result?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, sen
nt/#how-djan...
>
> Also have a read about how you can change the user's language
> preference on the site
> herehttp://docs.djangoproject.com/en/1.1/topics/i18n/internationalization...
>
> On Aug 10, 2:01 pm, kostia wrote:
>
> > I used rosetta to translate strings. How can
Docs and djangobook useless in question of translation. Any other
guide to read is available?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, sen
>From djangobook: "If all you want to do is run Django with your native
language, and a language file is available for your language, all you
need to do is set LANGUAGE_CODE."
This is not true! Unfortunately(
--
You received this message because you are subscribed to the Google Groups
"Django u
My base.html has a header:
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
http://www.w3.org/1999/xhtml"; lang="{{ LANGUAGE_CODE }}"
xml:lang="{{ LANGUAGE_CODE }}">
...
The LANGUAGE_CODE in settings is:
LANGUAGE_CODE = 'ru'
#multilingual
LAN
I did everything. The latest my code is here http://github.com/vaxXxa/projector
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
dj
Of couse I included a {% load i18n %} tag and then used {% trans %}
tags in each file.
Still no solution
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from thi
Disappointed.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit t
I have a web site. It is www.projector.net.ua. Sometimes it is down.
I have the latest code here http://github.com/vaxXxa/projector of it.
I have installed rosetta module to translate the English version of my
site into Russian and Ukrainian. I did this. You may see it in
projector/locale folder.
I
projector]# python manage.py compilemessages
processing file django.po in /home/kostia/Documents/Django/projector/
locale/ru/LC_MESSAGES
/home/kostia/Documents/Django/projector/locale/ru/LC_MESSAGES/
django.po:400: a format specification for argument 'task' doesn't
exist in 'msg
Great, I installed django-messages. They are working fine.
As in docs said I have a content and sidebar blocks. How can I show on
the user profile page a nice Inbox in the sidebar? Docs does not show
any examples.
If you did this before, share the code, please.
Thank you
--
You received this m
58 matches
Mail list logo