Re: Add model item with AJAX pop up

2016-02-08 Thread pa xapy
hi
easiest way is to write separate view which will handle ajax requests (get 
and post) and render html (as a json field) and success status as response.
on frontend you will handle this response to show modal with form and 
submit it until model will successfully saved
once it happens, you can refetch your users list in select field

but I don't know any application which implement all this stack. I think 
you should handle this modal by yourself

On Saturday, February 6, 2016 at 4:12:48 PM UTC+3, guettli wrote:
>
> I use django-select2  for 
> easy ForeignKey picking. Works nice.
>
>
> But how can I add a new item in the ForeignKey table?
>
>
> I would like to have a big [+] button near the select2 field and then a 
> (ajax) modal dialog should open (like in the admin interface).
>
>
> AFAIK django-select2 does not help here. Is there a different library 
> which can help here?
>
>
> I would like to re-use and not to re-invent. Maybe I was blind, but I 
> could not
>
> find a matching comparison grid on djangopackages.com.
>
>
> I would like to avoid a "old-school" browser-window-pop-up :-)
>
>
> Regards,
>
>   Thomas Güttler
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2e4db59a-48b2-4108-a576-3e443df8cd14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: search page

2016-01-28 Thread pa xapy
queryset.filter(title__icontains=query) is not enough? 

On Wednesday, January 27, 2016 at 12:46:21 AM UTC+3, Xristos Xristoou wrote:
>
> hello,
>
>
> i want to an easy way to create search page on my site to searching only 
> the titles.
> who is the better and easy way for to doa that ?
> mayde some tools to install ?
> any idea ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fce9069f-cc6b-4f8d-a0d8-97090107aecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread pa xapy
are you using python 3?
that's actually what i talking about - it's too old
try another one, like 
this https://github.com/jamespacileo/django-pure-pagination - follow 
the instructions and i hope you'll be fine

On Tuesday, January 26, 2016 at 5:09:29 PM UTC+3, Xristos Xristoou wrote:
>
> i follow the simpe steps but i take error invalid syntax 
> (pagination_tags.py, line 225)
>
> Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
> Xristoou έγραψε:
>>
>> i want to using Paginator in my main page for my post list. i see docs 
>> and examples for that but i thing my problem is a specific, because on my 
>> view i have two Querys not one.
>>
>>  
>>
> def index(request):
>> return render_to_response("blog/posts_list.html", {
>> 'categories': Category.objects.all(),
>> 'posts': 
>> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
>> })
>>
>>
>> any idea how to use Paginator on my view ?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f57db3c-68e5-40f2-b35a-22d7e43b8355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread pa xapy
are you familiar with the pip utility?
if not, i highly recommend to read about 
it https://pip.pypa.io/en/stable/quickstart/
if yes, you should know that you can install any application with pip 
install package_name
and how set it up with django - it's better if you read in instructions for 
package you choose

but i'm afraid that this particular app is too old and you can experience 
some troubles with it
anyways, you can try: pip install django-pagination

On Tuesday, January 26, 2016 at 4:44:05 PM UTC+3, Xristos Xristoou wrote:
>
> one more question how to install this ?autopagination ?i dont see anything
>
> Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
> Xristoou έγραψε:
>>
>> i want to using Paginator in my main page for my post list. i see docs 
>> and examples for that but i thing my problem is a specific, because on my 
>> view i have two Querys not one.
>>
>>
>> def index(request):
>> return render_to_response("blog/posts_list.html", {
>> 'categories': Category.objects.all(),
>> 'posts': 
>> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
>> })
>>
>>
>> any idea how to use Paginator on my view ?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a491e58-4f39-4ad0-b502-c1a52579855c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread pa xapy
you can read the usage doc i sent linked, but yes - you don't need to do 
anything with you queryset in view only pass it to template

On Tuesday, January 26, 2016 at 4:39:17 PM UTC+3, Xristos Xristoou wrote:
>
> if i use {autopagination} i dont need quyre on my view ?
>
> Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
> Xristoou έγραψε:
>>
>> i want to using Paginator in my main page for my post list. i see docs 
>> and examples for that but i thing my problem is a specific, because on my 
>> view i have two Querys not one.
>>
>>
>> def index(request):
>> return render_to_response("blog/posts_list.html", {
>> 'categories': Category.objects.all(),
>> 'posts': 
>> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
>> })
>>
>>
>> any idea how to use Paginator on my view ?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82411c31-5085-4b0f-955c-232f36ff7288%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread pa xapy
if you'll decide to use some app for pagination, you can do it in template, 
like 
so https://github.com/ericflo/django-pagination/blob/master/docs/usage.txt 
({% autopaginate posts 10 %})
or you can choose one of 
these https://www.djangopackages.com/grids/g/pagination/
there is no actual need to do it in view
but still, if you want to only paginate posts, I can't see a problem at all

On Tuesday, January 26, 2016 at 4:27:58 PM UTC+3, Xristos Xristoou wrote:
>
> can you show me one examples with my view ?
>
> Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
> Xristoou έγραψε:
>>
>> i want to using Paginator in my main page for my post list. i see docs 
>> and examples for that but i thing my problem is a specific, because on my 
>> view i have two Querys not one.
>>
>>
>> def index(request):
>> return render_to_response("blog/posts_list.html", {
>> 'categories': Category.objects.all(),
>> 'posts': 
>> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
>> })
>>
>>
>> any idea how to use Paginator on my view ?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d3687ed-64f8-43ce-a20c-43c45e957633%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread pa xapy
you want to paginate both querysets at the same page? 
i believe it's a pretty strange idea and if so, you should think how to 
refactor it
if you want only paginate posts, i'll recommend you to use 
django-pagination app of some sort, it's can be used in template

On Monday, January 25, 2016 at 5:16:31 PM UTC+3, Xristos Xristoou wrote:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my view ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ef8c4c5-4354-4c97-b0a0-9c28f49ab773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to write Model.get_absolute_url()?

2015-12-07 Thread pa xapy
there is two approaches:
you can either create unique names for each url pattern entry like 
url(, name='my_app_unique_view_name')
or use namespace and pass it to reverse like 
reverse('my-app-namespace:my-url-pattern-view-name')

On Sunday, December 6, 2015 at 3:29:29 AM UTC+3, Jon Ribbens wrote:
>
> I'm using Django 1.8. If I'm writing an app, and I want to add 
> get_absolute_url() to a model, the question is: what do I put for the first 
> argument to 'reverse'?
>
> The documentation at 
> https://docs.djangoproject.com/en/1.8/topics/http/urls/#url-namespaces 
> implies that I need to know two things: the instance name, and the app 
> name. The problem is that get_absolute_url() knows neither of these.
>
> Imagine my app has a urlpattern like:
>
> url(r'^view/(\d+)$', views.view, name="view")
>
>
> I could just say reverse("view", self.id) but what if another app has a 
> view called 'view'? What if my app is instanced twice - i.e. as shown in 
> the docs:
>
> url(r'^author-polls/', include('polls.urls', namespace='author-polls', 
> app_name='polls')),
> url(r'^publisher-polls/', include('polls.urls', 
> namespace='publisher-polls', app_name='polls')),
>
>
> ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54f24891-e6ba-41d4-b8fc-b8914729f65a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django - How to combine queries in to one and display it in the template?

2013-11-03 Thread pa xapy

>
> write custom method on User model or custom template tag

first one allow you to do something like:
{% for item in user.get_what_you_need %}
...
{% endfor %}
and second one:
{% get_what_you_need user %} 
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e010cabf-e1e8-4925-908e-80b7cb3c336c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: "Writing First App" Tutorial - no settings

2013-09-23 Thread pa xapy
which version of tutorial you working through?
which version of django did you use?
usually, with latest versions. your settings.py file should be in 
.../myproject/myproject/ folder.

On Monday, September 23, 2013 2:04:07 PM UTC+4, Avril Lang wrote:
>
> So I'm obviously a newbie and working my way through the tutorial. I 
> created a project using startproject but whereas the tutorial is showing 
> that I should see various files in this directory (__init__.py, 
> settings.py  etc) I can only see manage.py. 
>
> I can connect to the server using runserver and it claims to be using 
> mysite.settings but... well I have no access to these. 
>
> Why am I only getting manage.py and how can I fix this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: pattern matching wrong app ???

2013-09-04 Thread pa xapy
you shouldn't use "$" in the include patterns
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Exception Value: No module named url -- on django poll tutorial

2013-08-08 Thread pa xapy
you have a typo in the urls.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't run manage.py runserver (Django 1.5.1)

2013-08-06 Thread pa xapy
try to use linux.
running python on win is suffering

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django graphics

2013-07-10 Thread pa xapy
why you do this with django?
there so many js libraries
i think that for the web purposes its best solution than generate graphics 
with python.
personally, i'm using the http://www.highcharts.com/ - flexible and easy to 
start. great docs.

On Tuesday, July 9, 2013 5:30:45 PM UTC+4, amanjot kaur wrote:
>
> Please suggest me some module/library in django to plot graphs which
> takes input from user.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.