Re: Absolute beginner step by step

2016-06-20 Thread Derek
"Django is supposed to be completely backward compatible"

Er, no, its not and they never promised it would be.  You need to check the 
changes made for each release - as they say here:

https://docs.djangoproject.com/en/1.9/releases/

"you will need to check *all* the backwards-incompatible changes..."


On Thursday, 16 June 2016 20:30:57 UTC+2, gary719_list1 wrote:
>
> I missed the use of Django 1.5.4,  but Django is supposed to be completely 
> backward compatible. So using 1.9 shouldn't cause any problems. The switch 
> from python 2.7 to 3.5, on the other hand, can be a mess. 
>
> Gary R.
>
> On 06/15/2016 05:24 PM, M. Kholid wrote:
>
> I tried to downloan the tutorial from the given link /
> media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf 
>
> It stil using django version 1.5.4
>
> On Wed, Jun 15, 2016 at 10:44 PM, Shaylee Hansen < 
> sha...@gcommercesolutions.com > wrote:
>
>> Thanks for the update on the new Tango With Django.   Everyone highly 
>> recommends this tutorial so I'm excited to see its recently been updated :) 
>>
>> On Monday, June 13, 2016 at 12:51:07 PM UTC-6, gary719_list1 wrote: 
>>>
>>> I stand corrected. There is a new Tango With Django tutorial out. It 
>>> uses Python 3.5 and Django 1.9. Try /
>>> media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf
>>>
>>> Gary R
>>>
>>> On 06/11/2016 02:07 PM, Gary Roach wrote:
>>>
>>> If you don't mind working with Python2.7 and Django 1.7 you might try 
>>> "Tango With Django" . It is out of date but still is a good place to start. 
>>> Too bad that the author hasn't updated it. I have had some success with 
>>> running three projects in parallel. Tango along with the official Django 
>>> howto and another with your own project if you have one. I saw a reference 
>>> to "Learning Python The  Hard Way". It's a good choice.
>>>
>>> One nasty thing you may run into if you run parallel programs is the use 
>>> of multiple version of Python and Django. If you use virtualenv and pyvenv 
>>> to set up multiple virtual environments and then point your IDE at the one 
>>> needed for a particular project, you should be ok. You don't even have to 
>>> activate the environments because you are using them for storage of python 
>>> and django versions only.
>>>
>>> Good luck
>>>
>>> Gary R.
>>>
>>>
>>> On 06/10/2016 07:32 PM, Mc. Holid wrote:
>>>
>>> Dear All,
>>>
>>> Could anyone help  to share the point for absolute beginner guide. 
>>>
>>> I have already know a little bit about html, and having strong 
>>> background in vb6.
>>>
>>> Thanks for any kind help.
>>>
>>> Best Regards
>>> Mchoud
>>> -- 
>>> 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/d2fa7fd5-2673-4292-a14e-482e148587bb%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...@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/575C7D80.7060206%40verizon.net
>>> .
>>> For more options, visit 
>>> https://groups.google.com/d/optout.
>>>
>>>
>>>
>> NOTICE: This email and attached file(s) contain Gcommerce Solutions, LLC 
>> confidential information intended for the exclusive use of the 
>> individual(s) to whom addressed. If you are not the intended recipient, 
>> please immediately delete this Email (and attached files) and treat the 
>> information as confidential.
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> 
>> https://groups.google.com/d/topic/django-users/cryoIzZ7p-o/unsubscribe.
>> To unsubscribe from this group and all its topics, 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-us

Re: How is best solution for builing chars in django (in admin too)?

2016-06-20 Thread Jonty Needham
We've used HighCharts with chartjs. It works; it's not ideal, but we use it
very extensively and it's customisable enough to use in a reasonable way.

However, depending on your requirement, it's probably more advisable get
your django view to return the appropriate json for a d3 front end.

HTH.

On Sun, Jun 19, 2016 at 6:23 PM, Seti Volkylany 
wrote:

> I visit https://www.djangopackages.com/grids/g/charts/ and could not
> found production/stable good solution for Django project.
> Who has some expirience builing a real project, please be so kind give me
> advice.
>
> Google Charts do not offer (not offline)
>
> --
> 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/2f1f1c92-eb76-4189-97f5-ff9f80ca4918%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/CANOQRbx14jb4%2BdVFkSgR-r7Fx7dbAbZfZ%2B3RbKBYpzWqCLDo0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


how to design custom forms in django with bootstrap

2016-06-20 Thread Ikram Ulhaq
Hi everyone!
i am new in django and want to design custom form in bootstarp that can use 
to send data to database.i made form successfully but values not inserted 
in database.please help

-- 
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/1f966387-c6c9-4498-8776-8fa8c809f4d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Passing object from one view to another

2016-06-20 Thread Cherni Moemen
Hello everyone,
How can I pass fetched objects in a view to a second in Django ? I don't 
want to use session variable. Is there any other optimized method ? Thanks 
in advance.

-- 
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/c4a7e9e6-d4ae-48dd-8a5f-6432a48f9cc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to design custom forms in django with bootstrap

2016-06-20 Thread Babatunde Akinyanmi
Hello Ikram,
It's going to be difficult to help you without more information about the
problem. If you give information about what you have tried and what's
failing, you will get more helpful answers.
On Jun 20, 2016 12:56 PM, "Ikram Ulhaq"  wrote:

> Hi everyone!
> i am new in django and want to design custom form in bootstarp that can
> use to send data to database.i made form successfully but values not
> inserted in database.please help
>
> --
> 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/1f966387-c6c9-4498-8776-8fa8c809f4d9%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/CA%2BWjgXOxPqG9yaEKsx-%3Dr%3DNUOcG8EcM_X9NLsGhGCB1-WNSv%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Please help me with CBV template_name behaviour.

2016-06-20 Thread JoeCodeswell
Dear James,

Thanks for your reply. 

   1. I'll investigate using the "Django debug toolbar".
   2. re: "extraneous classes":  I was trying to make a point of how to 
   construct the second-2 classes from the first-2. The second-2 classes (CRUD 
   classes) are a *text copy* of the first-2 with the difference being that 
   the second-2 have their names changed, in the appropriate 2 places & (I 
   THOUGHT) they point to A DIFFERENT Crud Template ('contacts/crudlist.htm'). 
   The Crud Template IS NOT USED FOR RENDERING. INSTEAD the Template mentioned 
   in the first-2 classes is used.
   3. re: "template inheritance structure". Any Django Docs on this subject?

I'll investigate the Debug Toolbar & see what it tells me.


Again, THANKS, BIG TIME, James.


Love and peace,

Joe

On Saturday, June 18, 2016 at 10:52:46 PM UTC-7, James Schneider wrote:
>
> > I EXPECT the Views with CRUD in their names (CRUD Views) to behave THE 
> SAME AS the others EXCEPT items are listed with read, update & delete 
> links, because that is how `contacts/crudlist.htm` displays them.
> >
> > THE PROBLEM IS that the CRUD Views display the items using the Plain 
> Template (contacts/contact_list.html) NOT the CRUD Template 
> ('contacts/crudlist.htm')
> >
>
> The Django debug toolbar can likely illuminate the problem here, or at 
> least provide a direction. You would need to verify the template(s) that 
> have been rendered as part of your view call, and that they're actually 
> doing what you think they're doing.
>
> It's a bit hard to follow your code, as you include extraneous classes 
> that don't appear to be relevant to the problem (no inheritance, no 
> indication they've been triggered, etc.). With that being said, your output 
> from the view appears to be correct and shows a different (and correct) 
> template_name for each view. I might be missing something though, and 
> admittedly I'm responding on my phone.
>
> My assumption at this point would be that the templates are rendered 
> correctly by Django (correctly meaning 'as configured'), and that the issue 
> actually lies within your template inheritance structure (if any). Again, 
> the debug toolbar will walk you through that.
>
> -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/34148840-2e69-4712-9094-f3a7baadb66e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-rest-framework serializer for ContentType object

2016-06-20 Thread Aamu Padi
I am building an activity model, somewhat similar to this package
. It has an actor,
verb and the target.

class Activity(models.Model):
actor_type = models.ForeignKey(ContentType,
related_name='actor_type_activities')
actor_id = models.PositiveIntegerField()
actor = GenericForeignKey('actor_type', 'actor_id')
verb = models.CharField(max_length=10)
target_type = models.ForeignKey(ContentType,
related_name='target_type_activities')
target_id = models.PositiveIntegerField()
target = GenericForeignKey('target_type', 'target_id')
pub_date = models.DateTimeField(default=timezone.now)


Now whenever a new object of whichever models (Tender, Job and News) is
created, a new Activity object is created, with the target being the
objects of any of these three models.

eg. user (actor) published (verb) title (target)

class Tender(models.Model):
title = models.CharField(max_length=256)
description = models.TextField()

class Job(models.Model):
title = models.CharField(max_length=256)
qualification = models.CharField(max_length=256)

class News(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
title = models.CharField(max_length=150)

To get this data I am making an API which will get me the required json
data. I am using django-rest-framework
 for this and very new with it.

class ActorSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'username', 'email')

class ActivitySerializer(serializers.HyperlinkedModelSerializer):
actor = ActorSerializer()
class Meta:
model = Activity
fields = ('url', 'actor', 'verb', 'pub_date')

In the above serializers, I knew that *actor *will be the *User*. And so I
used the User model for the *ActorSerializer class*. But as for the *target*,
it can be any of these three models (News/Job/Tender).

How can I make a serializer (eg. TargetSerialier class) for the ContentType
object so that I can use the target in the ActivitySerializer class field?


Virus-free.
www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
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/CAHSNPWuRvs6mJFwyMfzFXXVxjpF%3D_L6jcWJiH-Dir5pZZ5RX0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to design custom forms in django with bootstrap

2016-06-20 Thread Ikram Ulhaq

sir i want to design a custom form in django that will store data in 
database...i done this with built in django forms but i can't be able to 
design with bootstarp or css. data not inserted if i create my own custom 
form like 




Email address

  




Email address

  



some button




Email address

aa

  


On Monday, June 20, 2016 at 4:56:29 PM UTC+5, Ikram Ulhaq wrote:
>
> Hi everyone!
> i am new in django and want to design custom form in bootstarp that can 
> use to send data to database.i made form successfully but values not 
> inserted in database.please help
>
>

-- 
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/c1c0d45f-94d1-4047-8df5-d7370e27a70b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to design custom forms in django with bootstrap

2016-06-20 Thread Ikram Ulhaq

sir i want to design a custom form in django that will store data in 
database...i done this with built in django forms but i can't be able to 
design with bootstarp or css. data not inserted if i create my own custom 
form like 




Email address

  




Email address

  



some button




Email address

aa

  


On Monday, June 20, 2016 at 4:56:29 PM UTC+5, Ikram Ulhaq wrote:
>
> Hi everyone!
> i am new in django and want to design custom form in bootstarp that can 
> use to send data to database.i made form successfully but values not 
> inserted in database.please help
>
>

-- 
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/0872af0f-c81f-42f9-998f-89a60ec390aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner step by step

2016-06-20 Thread Gary Roach
I stand corrected  again. I think I would try 1.9 anyway. May 
get a little practice in debugging.


Gary R,

 On 06/20/2016 12:42 AM, Derek wrote:

"Django is supposed to be completely backward compatible"

Er, no, its not and they never promised it would be.  You need to 
check the changes made for each release - as they say here:


https://docs.djangoproject.com/en/1.9/releases/

"you will need to check *all* the backwards-incompatible changes..."


On Thursday, 16 June 2016 20:30:57 UTC+2, gary719_list1 wrote:

I missed the use of Django 1.5.4,  but Django is supposed to be
completely backward compatible. So using 1.9 shouldn't cause any
problems. The switch from python 2.7 to 3.5, on the other hand,
can be a mess.

Gary R.

On 06/15/2016 05:24 PM, M. Kholid wrote:

I tried to downloan the tutorial from the given
link 
/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf




It stil using django version 1.5.4

On Wed, Jun 15, 2016 at 10:44 PM, Shaylee Hansen
> wrote:

Thanks for the update on the new Tango With Django.  
Everyone highly recommends this tutorial so I'm excited to

see its recently been updated :)

On Monday, June 13, 2016 at 12:51:07 PM UTC-6, gary719_list1
wrote:

I stand corrected. There is a new Tango With Django
tutorial out. It uses Python 3.5 and Django 1.9. Try

/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf



Gary R

On 06/11/2016 02:07 PM, Gary Roach wrote:

If you don't mind working with Python2.7 and Django 1.7
you might try "Tango With Django" . It is out of date
but still is a good place to start. Too bad that the
author hasn't updated it. I have had some success with
running three projects in parallel. Tango along with the
official Django howto and another with your own project
if you have one. I saw a reference to "Learning Python
The  Hard Way". It's a good choice.

One nasty thing you may run into if you run parallel
programs is the use of multiple version of Python and
Django. If you use virtualenv and pyvenv to set up
multiple virtual environments and then point your IDE at
the one needed for a particular project, you should be
ok. You don't even have to activate the environments
because you are using them for storage of python and
django versions only.

Good luck

Gary R.


On 06/10/2016 07:32 PM, Mc. Holid wrote:

Dear All,

Could anyone help  to share the point for absolute
beginner guide.

I have already know a little bit about html, and having
strong background in vb6.

Thanks for any kind help.

Best Regards
Mchoud
-- 
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/d2fa7fd5-2673-4292-a14e-482e148587bb%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...@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/575C7D80.7060206%40verizon.net

.
For more options, visit
https://groups.google.com/d/optout

choices field language

2016-06-20 Thread Xristos Xristoou
hello i want to use choices in my field but not work if i write in my 
language(greek) only work in the england language.
if i writing choices in my language show me error message in the admin mode 
(this choose is not valid),any idea how to fix that ?i have python 2.7

-- 
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/5bfdb5b9-e286-40e1-aa8b-2a0e68878204%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


subtracting recent data from previous data

2016-06-20 Thread sum abiut
Hi,
I need some help with an app that i am working on. i have a csv file that
one of our user is uploading and populating data in the database every
month.

here is an example of what it looks like a clear picture is attached.

*Revenue* *Amount* *   Month* *  Year*
USD Int on FT Deposit 2035 january 2016
USD Int on Treasury Bills 34523432 january 2016
AUD Int on Bond 43243january 2016
Total Int on Foreign Asset 4324  january 2016
Dealing Profit 4324  january 2016
what i want to accomplish is, every time when the user upload and populate
database. I want to get the recent amount that was just upload  and minus
the previous amount.

for example: when the user upload and populate data from February, i want
to get amounts of February and minus the January amounts. i want do that
for all the rows.

I've already build the done the uploading part, just need some help on the
calculation part.

-- 
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/CAPCf-y7fRNY84H%3DKE_6B4WevNQCirWqzqN4b%2BOTcetQS478bAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


test.xlsx
Description: MS-Excel 2007 spreadsheet