Re: Does anyone use Django on bluehost? "Cant find fcgi module" error on line 9 .

2016-04-09 Thread Rob Groves
I am using Django on bluehost.  I suspect that the issue you are seeing is 
that Django1.9 has stopped supporting fcgi.  I found that out when I tried 
to upgrade from 1.8 a while back.  I think you can probably copy over the 
fcgi module from the Django 1.8 release, but I haven't tried that.  I just 
stayed at 1.8, since it is still under support.  I figured I'd deal with it 
later when I have to move to 1.9.

On Thursday, April 7, 2016 at 11:28:53 AM UTC-4, django...@gmail.com wrote:
>
> We are using django on bluehost. Installed python, flup, django, and using 
> a postgres server. Every time I try and run fcgi it gives an error that the 
> module does not exist. Verified with bluehost that it is on our server. Put 
> it in the htaccess file Help anyone
>

-- 
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/eb86f5a0-d5cb-4873-93d7-1b97f860143e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: variable to a template

2016-04-09 Thread Chris Bartos
There are probably 3 ways you can do this:

1) Use a Filter 

 
You should be able to use the "add" filter to concatenate two strings. 

2) Map the elements of your array in your view with the contents of 
settings.STATIC_URL. 

3) You can't nest a context variable inside another tag like you're trying 
to do but you can concatenate two variables together:

{% static 'my_app' %}/{{filename}}

I hope that helps.

On Wednesday, March 2, 2016 at 5:41:37 AM UTC-5, luca72 wrote:
>
> Hello i have write this in a template:
> {% for a in lista %}
>  height="100"  
>  {% endfor %}
> But i get no image
>
> if i add just a  {{a}}  i see that the file name is righ, 
> also if i direct write the file i get it
>  {% for a in lista %}
>  height="100"  
>  {% endfor %}
>
> can you tell me what is wrong
>
> Thanks
>
>

-- 
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/ecc28ce3-bc33-4beb-9063-53335dee7102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with dumpdata/loaddata

2016-04-09 Thread jorrit787
I jus tested it again and it happens even without opening the file in an 
editor first. Would that be a bug then?


On Friday, April 8, 2016 at 10:23:43 AM UTC+2, Ramiro Morales wrote:
>
> It shouldn't. Are you sure you haven't opened and saved the json file with 
> a text editor that might be adding the BOM, e.g. Notepad before running 
> loaddata?
> On Apr 7, 2016 9:17 PM, > wrote:
>
>> Opening the JSON file in Notepad++ certainly gives some insight... It 
>> says it's encoded in USC-2 LE BOM. Converting it to UTF-8 with BOM in 
>> Notepad++ solves the problem.
>>
>> Question though, why does dumpdata create files with an encoding that can 
>> not be used out of the box with loaddata?
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/b3f4fbbf-bcad-4376-8ed1-aa476b8c8a88%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/313e069c-c719-42e6-9292-cf5bf9ab901d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to know which models have changed and need make migrations?

2016-04-09 Thread jorrit787
I've run into the problem of migration files not being added to source 
control with PyCharm because PyCharm doesn't seem to automatically commit 
auto-created files unless you explicitly tell it to in the settings (and 
even then it doesn't always work).

-- 
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/56c2a5e2-af13-44d5-82b6-db769c2c5861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to know which models have changed and need make migrations?

2016-04-09 Thread Tim Graham
Also, your models might reference a setting whose value differs between 
development and production. This probably won't cause any problems but will 
trip up the migrations autodetector into thinking that a migration needs to 
be made.

https://code.djangoproject.com/ticket/24648

On Saturday, April 9, 2016 at 9:52:27 AM UTC-4, jorr...@gmail.com wrote:
>
> I've run into the problem of migration files not being added to source 
> control with PyCharm because PyCharm doesn't seem to automatically commit 
> auto-created files unless you explicitly tell it to in the settings (and 
> even then it doesn't always work).
>

-- 
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/eed606ed-0f95-4c23-8210-035ebc028998%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: inventory in Django

2016-04-09 Thread jorrit787
Have you looked into Django ecommerce packages that are already out there? 
They may fit most of your needs, and you could extend them where they don't.

https://www.djangopackages.com/grids/g/ecommerce/

-- 
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/3703c43c-fab2-490c-bf0d-2c726acfebd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should I use Django's builtin control panel for user facing purposes?

2016-04-09 Thread jorrit787
There's nothing physically stopping you from letting all your site's users 
use the Django Admin, but at least in spirit the Admin is only meant to be 
used by your staff. Even then, consider whether you need the Admin at all 
for your purposes: it sounds like what you're trying to do could easily be 
achieved with a few (generic) views you can build yourself (one for the 
client to update their info and one for your staff to review clients). Also 
consider what the Admin does: it's focused on managing data (like adding 
blog posts to a blog, or recipes to a recipe website). What you're trying 
to do is more procedure-focused (manipulating already-existing data in 
several ways). Custom views may be more suited to that purpose.


On Friday, April 8, 2016 at 5:24:00 PM UTC+2, Andrew Chiw wrote:
>
> I'm making a Django website for a company, where the company's employees 
> will validate clients that sign up.
> I'm thinking that the clients should have a mini control panel where they 
> can change their own information only, while the company's employees have 
> their own control panel where they can manage the clients and set whether 
> or not they can change their information anymore, etc.
> Should I / Can I use the built in Django control panel for this purpose?
> If not, is django-user-accounts what I'm looking for?
>

-- 
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/1cd1cce2-52eb-488c-bb59-874c281c5127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Suggest newsletter to integrate in django project

2016-04-09 Thread jorrit787
There's a good chance you will find something that fits your needs at 
django-packages :)

https://www.djangopackages.com/grids/g/newsletter/


On Thursday, April 7, 2016 at 12:55:08 PM UTC+2, Luca Brandi wrote:
>
> Hi,
> followed some tutorials on the web integrating Mailchimp in my django 
> project but not working...
> Any suggestion on a similar service easily to integrate in django? thanks
>

-- 
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/e50ea410-2f0c-4889-bfa6-709d2fa3f1c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Rendering Form Fields That Are Passed To Context Inside Of An Object

2016-04-09 Thread jorrit787
Are you sure you have the name of the fields correct? According to the 
documentation {{ form.fieldname }} should do what you want. It sounds like 
formsets would be more appropriate for what you're trying to achieve though.

And yeah, if you're going to go that specific you might as well render all 
the fields completely manually :)
 

On Saturday, April 9, 2016 at 12:21:24 AM UTC+2, David McWilliams wrote:
>
> tl:dr -- How do I explicitly render the fields in a form that's passed to 
> the context dictionary within an object?
>
> I'm building a page right now that shows a list of documents to the user. 
>  Each document has a type, a status, a list of images associated with it, 
> and finally a document update form with a few fields in it.  Because all of 
> these pieces of data belong together, I created a class to group them for 
> display (this is a simplified version for example only):
>
> class Document:
> def __init__(self, doc_type, doc_status):
> self.doc_type = doc_type
> self.doc_status = doc_status
> self.update_form = DocUpdateForm()
>
> def doc_view(request):
> # ... some other stuff to get the raw data ...
>
> documents = []
>
> for raw_doc in raw_document_data:
> documents.append(Document(raw_doc.doc_type, raw_doc.doc_status))
>
> context['documents'] = documents
>
> return render_to_response('doc_list.html', context)
>
> This all worked fine, because then in my template I was able to do 
> something nice and simple like this:
>
> ...
> Documents
> 
>   Document TypeDocument StatusUpdate
>   {% for doc in documents %}
> 
>   {{ doc.doc_type }}
>   {{ doc.doc_status }}
>   {{ doc.update_form }}
> 
>   {% endfor %}
> 
>
> Piece of cake, right?
>
> Well, now we want to change the page so that some of the form fields are 
> inside of one div, and some inside of another one so that they can be next 
> to one another instead of oriented vertically.  I consulted the Django 
> documentation here: 
> https://docs.djangoproject.com/en/1.9/topics/forms/#rendering-fields-manually 
> and 
> decided to render each of the fields myself.  This resulted in something 
> like:
>
> ...
> Documents
> 
>   Document TypeDocument StatusUpdate
>   {% for doc in documents %}
> 
>   {{ doc.doc_type }}
>   {{ doc.doc_status }}
>   {{ doc.update_form.field_1 }}
> {{ doc.update_form.field_2 }}
> 
> 
>   {% endfor %}
> 
>
>
> Unfortunately, all this does is render the text "doc.update_form.field_1" 
> instead of the form field.  It's the same behavior that I see when I 
> accidentally try to reference a key that doesn't exist in the context 
> dictionary.
>
> I can, of course, just write the form fields HTML by hand . . . but 
> goshdarnit, I'm a developer, and I want to know why the lazy way isn't 
> working.  Do I need to reference the form fields differently than the 
> documentation suggests?  Is it because I'm passing the forms to the context 
> inside of another object?  Should I be learning how to use formsets and/or 
> fieldsets?
>
> This app uses Django 1.8, in case that's important.
>

-- 
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/094f542f-b846-407c-b953-b740c47ef64f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Formset:What's INITIAL_FORMS for?

2016-04-09 Thread Tundebabzy
Hello, 
When using formset, what's the use of the management form's INITIAL_FORMS and 
why is it always set as 0.

Does INITIAL_FORMS need to be incremented when new forms are added?

-- 
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/e24d4ca4-f1d0-4fd5-9f1c-26954973663d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Suggest newsletter to integrate in django project

2016-04-09 Thread Luca Brandi
Thanks, seems just few of the list use django 3... Furthermore I like the 
way mailchimp is structured...so need something similar... thanks anyway

Il giorno sabato 9 aprile 2016 16:19:18 UTC+2, jorr...@gmail.com ha scritto:
>
> There's a good chance you will find something that fits your needs at 
> django-packages :)
>
> https://www.djangopackages.com/grids/g/newsletter/
>
>
> On Thursday, April 7, 2016 at 12:55:08 PM UTC+2, Luca Brandi wrote:
>>
>> Hi,
>> followed some tutorials on the web integrating Mailchimp in my django 
>> project but not working...
>> Any suggestion on a similar service easily to integrate in django? thanks
>>
>

-- 
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/e4c56456-b617-42cf-8f14-82c1e77ff21d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simple to say but difficult in django?

2016-04-09 Thread Luca Brandi
Hi,
I need to make something very simple but it seems all exmplesI found on the 
web, do not work, so I am sure this group will find the right solution 
(please consider I am a newbie so please be specific and detailed in your 
reply):
I just need to store a pdf file in my sytic files and have a link on a page 
which opens it. 
Best solution I found is not working...:
view.py:
@login_required
def pricelist (request):
template='pricelist.pdf'
return render (request, template ,{})
  
url.py:
url(r'^pricelist/$', 'aero.views.pricelist', name='pricelist'), 

url link in the page: Download


anyone can help? thanks very much

-- 
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/a0d7a435-1a46-4cee-9d04-0ade09363ae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multidimensional form requirements

2016-04-09 Thread Scot Hacker


On Friday, April 8, 2016 at 11:27:01 AM UTC-7, Tundebabzy wrote:
>
> I don't know if I'm off target but. 
>
> I'm presently work on something like this where I have have to save three 
> models at a go. One model is a stand alone while the other two have a 
> foreign key to the stand alone model which is a many to one relationship. 
> So to implement the many to one where I can save many of the dependent 
> models together with the standalone models, I made use of inline formset 
> and no problems thus far.
>

It's interesting - Django provides non-model forms, model forms, and 
formsets for dealing with multiple instances of the same model, but no way 
to build a single form that deals with multiple model types simultaneously. 
At this point, it's looking pretty much like I'll solve this outside of the 
Django box, by generating JSON representing the collection of data and 
using Angular to add/edit to the set with client-side validation, then 
post-processing the results in a Django view.

./s

-- 
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/75f0a892-db07-43d3-ab0f-4f9799591721%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple to say but difficult in django?

2016-04-09 Thread Vijay Khemlani
Your question seems to be incomplete

considering you are using a login_required decorator then you also want to
limit access to the file

If you put it in your static directory then it will be public if anyone
knows the URL to the file

On Sat, Apr 9, 2016 at 1:56 PM, Luca Brandi  wrote:

> Hi,
> I need to make something very simple but it seems all exmplesI found on
> the web, do not work, so I am sure this group will find the right solution
> (please consider I am a newbie so please be specific and detailed in your
> reply):
> I just need to store a pdf file in my sytic files and have a link on a
> page which opens it.
> Best solution I found is not working...:
> view.py:
> @login_required
> def pricelist (request):
> template='pricelist.pdf'
> return render (request, template ,{})
>
> url.py:
> url(r'^pricelist/$', 'aero.views.pricelist', name='pricelist'),
>
> url link in the page: Download
>
>
> anyone can help? thanks very much
>
> --
> 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/a0d7a435-1a46-4cee-9d04-0ade09363ae7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALn3ei3k9GKDUMDj4zZWW1CL4HXLgtZP%2BaD%2BkrT%2BwFhY95Nttg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Trouble getting posted

2016-04-09 Thread Gary Roach
I have tried to post a couple of things in the last few days with no 
results. My posts are  never returned to me. So this is another test.


Gary R

--
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/57094E0B.6080408%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


google/bing maps using django

2016-04-09 Thread Xristos Xristoou
hello


i want some toturial or examble to easy way ping and show one place in 
google maps/bing maps with lat/log
and can be dynamic because i have more places to show in my web site ?

-- 
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/7722856a-9d6f-4ff0-9039-7b6a4055987a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: google/bing maps using django

2016-04-09 Thread Xristos Xristoou
if i have two fields in my model with coordinates lon = models.FloatField()

   lat = models.FloatField()

how to show this place in google maps in my html template ?




Τη Σάββατο, 9 Απριλίου 2016 - 10:50:08 μ.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello
>
>
> i want some toturial or examble to easy way ping and show one place in 
> google maps/bing maps with lat/log
> and can be dynamic because i have more places to show in my web site ?
>

-- 
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/b835e6ef-c8c1-4762-bb4c-e2a669c363c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trouble getting posted

2016-04-09 Thread jorrit787
Did you subscribe to the topics you posted?

-- 
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/9005e339-1bb1-4483-965d-78a9945aa8f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble getting posted

2016-04-09 Thread Gary Roach

On 04/09/2016 02:37 PM, jorrit...@gmail.com wrote:

Did you subscribe to the topics you posted?

Have been for months. This is a new problem but seems to not be a 
problem with this site. The trouble seems to be unique to the Debian 
User site. Thanks for your reply.


Gary R.

--
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/570980ED.1030304%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble getting posted

2016-04-09 Thread James Schneider
>
> I have tried to post a couple of things in the last few days with no
results. My posts are  never returned to me. So this is another test.
>

Google Groups does not send the post back to the OP, which is annoying,
confusing and non-intuitive, and not configurable AFAIK.

-James

-- 
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/CA%2Be%2BciVB2d8k0xBF7BpS8H7Yho-r5JvZcLOf-EuzQSK-AehgdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Problem with order_by when using paginator

2016-04-09 Thread Rahmat Ramadhan
Hallo there. i have problem with my order_by when using paginator. the data 
are not sort well. data becomes random. 

when i do 
 qs = Messages.objects.filter(
main_msg=get_message).order_by('datetime')

the data are sort well by order_by. 
but when i'm using paginator = Paginator(qs, 7) . 

the data are become random. paginator didnt show my lasts data "order_by". 
but paginator show it random.

here is my complete code.

qs = Messages.objects.filter(
main_msg=get_message).order_by('datetime')

paginator = Paginator(qs, 7)
if request.method == 'GET':
if request.is_ajax():
if request.GET.get('page_number'):
page_number = request.GET.get('page_number')
try:
page_objects = paginator.page(
page_number).object_list
except InvalidPage:
return HttpResponse("")
return 
render_to_response('user_app/ajaxresponse/load_more_messages.html', 
locals(), context_instance=RequestContext(request))

objects = paginator.page(1).object_list
print objects
context = dict(
object_list=objects,
)

any solution for this problem ?

thanks

-- 
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/cb4d6f7f-9e5a-40e2-bffe-fa97559f8fb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: variable inside @media screen

2016-04-09 Thread Peter of the Norse
You also need a max-width or this will always be true.

> On Mar 11, 2016, at 2:21 AM, Rose  wrote:
> 
> @media screen and (min-width:767px){
> 

Peter of the Norse
rahmc...@radio1190.org



-- 
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/37D9E424-CF35-4EFF-89CE-BF653856F704%40Radio1190.org.
For more options, visit https://groups.google.com/d/optout.


Re: google/bing maps using django

2016-04-09 Thread Sergiy Khohlov
Check django-leaflet. Also best way for storing lon lat use geodjango with
postgis
9 квіт. 2016 23:26 "Xristos Xristoou"  пише:

> if i have two fields in my model with coordinates lon = models.FloatField
> ()
>
>lat = models.FloatField()
>
> how to show this place in google maps in my html template ?
>
>
>
>
> Τη Σάββατο, 9 Απριλίου 2016 - 10:50:08 μ.μ. UTC+3, ο χρήστης Xristos
> Xristoou έγραψε:
>>
>> hello
>>
>>
>> i want some toturial or examble to easy way ping and show one place in
>> google maps/bing maps with lat/log
>> and can be dynamic because i have more places to show in my web site ?
>>
> --
> 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/b835e6ef-c8c1-4762-bb4c-e2a669c363c6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADTRxJNP-ys_ERk35g43SFrvd%2Bi0ubyUHkeUm6AkqUjc4sR2Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with order_by when using paginator

2016-04-09 Thread Rahmat Ramadhan
I was fixed it by change order_by('id') to .order_by('-id') then 
adding reversed in {% for i in objects reversed %}

i wonder if there is another solution to fix this problem. 
thanks

-- 
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/7b332f83-344f-4fd6-9540-6c7f8e9f3c96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django on Codenmvy

2016-04-09 Thread bob gailer
I am new to Codenvy. Do you have any experience with Codenvy / Django? I 
could use some help. I will post questions if I hear from an experienced 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5709D034.9060207%40gmail.com.
For more options, visit https://groups.google.com/d/optout.