Re: Help Requried : FieldError at /admin/movie/movie/add/

2014-12-15 Thread Muhammad Ahmed

>
> Somehow I have managed the problem. 
>

Thanks to those who took their time to read this post.  

-- 
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/6667264c-6e2e-4281-a768-632016294a8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help Requried : FieldError at /admin/movie/movie/add/

2014-12-14 Thread Muhammad Ahmed
Hi Everyone, 

I am having Field Error while trying to have date field in my admin.py. 
There is some problem with Date Filed and I am unable to figure out what 
wrong I am doing. here is my code:

*MODEL.PY*


from django.db import models


import datetime
from django.utils import timezone


class Movie(models.Model):
movie_title = models.CharField(max_length=200)
movie_director = models.CharField(max_length=200)
movie_writer = models.CharField(max_length=200)
movie_musician = models.CharField(max_length=200)
movie_intro = models.TextField()
posted = models.DateField(db_index=True, auto_now_add=True)


def __str__(self):
return self.cd_movie


def is_latest(self):
return self.posted >= timezone.now() - datetime.timedelta(days=1)


is_latest.admin_order_field = 'posted'
is_latest.boolean = True
is_latest.short_description = 'Latest?'











*ADMIN.PY *



from django.contrib import admin
from movie.models import Movie





##movie_title = models.CharField(max_length=200)
##movie_director = models.CharField(max_length=200)
##movie_writer = models.CharField(max_lenth=200)
##movie_musician = models.CharField(max_length=200)
##movie_intro = models.TextField()
##posted = models.DateField(db_index=True, auto_now_add=True)
#


class MovieAdmin(admin.ModelAdmin):
fieldsets = [
('Movie Info',   {'fields': ['movie_title',
'movie_director','movie_musician','movie_writer']}),
('Movie Intro',   {'fields': ['movie_intro']}),
('Date information', {'fields': ['posted']}),
]




list_display = ('movie_title', 'posted', 'is_latest')
list_filter = ['posted']
search_fields = ['movie_title']


admin.site.register(Movie, MovieAdmin)






I am having the following error:

FieldError at /admin/movie/movie/add/

Unknown field(s) (posted) specified for Movie. Check fields/fieldsets/exclude 
attributes of class MovieAdmin.

Request Method:GETRequest 
URL:http://localhost:8000/admin/movie/movie/add/Django 
Version:1.7Exception Type:FieldErrorException Value:

Unknown field(s) (posted) specified for Movie. Check fields/fieldsets/exclude 
attributes of class MovieAdmin.

Exception 
Location:C:\Python34\lib\site-packages\django\contrib\admin\options.py 
in get_form, line 654Python Executable:C:\Python34\python.EXEPython Version:
3.4.1Python Path:

['D:\\dp\\cricket',
 'C:\\Windows\\system32\\python34.zip',
 'C:\\Python34\\DLLs',
 'C:\\Python34\\lib',
 'C:\\Python34',
 'C:\\Python34\\lib\\site-packages']

Server time:

-


Thanks in AdvanceMon, 15 Dec 2014 11:57:49 +0500

-- 
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/fdaee0d3-edb0-43e7-8d92-e3218e7b9da0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which Version of Django

2014-09-30 Thread Muhammad Ahmed
Thank you Tim Chase. 

On Tuesday, 30 September 2014 22:08:57 UTC+5, Tim Chase wrote:
>
>
> I haven't seen any discussion of the deployment platform.  I would 
> also recommend 1.7 for green-field development, but I had to drop 
> down to 1.6 on one recent project because my deployment host only 
> offered python2.6 (well, and 2.4, but THAT was OLD) and Django 1.7 
> uses some 2.7 features. 
>
> -tkc 
>
>
>
>

-- 
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/330c1217-2ff9-48b1-abcb-189451a63588%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which Version of Django

2014-09-30 Thread Muhammad Ahmed
Thank James for the insight about LTS. 

As I am just learning Django and not yet working professionally. Hence I 
wanted to avoid any outdated version. However, I felt Django 1.4 is good. 

I may use Django 1.4 back after having checked 1.7. :)

Thanks again for your time and valuable opinion. 



On Tuesday, 30 September 2014 13:01:08 UTC+5, James Schneider wrote:
>
> Not to throw a wrench in to this conversation, but it should be noted that 
> Django 1.4 is considered the LTS (long term support) version, and 
> is acceptable for production use if you do not need any of the fancy 
> features in 1.7.
>
> If you are looking at a small project and don't mind upgrading between 
> version releases, or you have need for some new feature in the Django 
> core, 1.7 would be the way to go. If you are looking at a large long 
> standing project, I would consider 1.4 for stability and minimal required 
> security updates. I don't believe that the next LTS version has been 
> announced yet, so I suspect 1.4 will be supported for the next year or so 
> at minimum.
>
>
> https://docs.djangoproject.com/en/1.7/internals/release-process/#long-term-support-lts-releases
>
> The version of Python to use probably should follow similar guidelines 
> (2.7 being well established while 3.X is the new version with 
> enhancements). The version available on your servers by default will 
> probably also help drive this decision unless you are comfortable 
> installing the version you want (although both 2.7 and 3.X are generally 
> both easily made available on moderately recent versions of the major OS'). 
> Availability of needed libraries is also a key factor, but the major ones 
> shouldn't be an issue.
>
> -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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64b5c1d2-1446-47bd-a204-44562f278864%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which Version of Django

2014-09-30 Thread Muhammad Ahmed
Thank you Mark! Especially for book link. :) 
 

>
> I agree with other advices to start with Django 1.7. 
> Django is very stable and the new functionalities are always introduced 
> in a very sane way. Also the deprecations are done well, and the 
> documentation is one of the best I have ever seen for a framework. 
>
> If I can go a little further, I say that if you are a Django beginner, 
> you could follow a very good book: 
> Test-Driven Development with Python using Django, Selenium and 
> Javascript. The book's website is http://obeythetestinggoat.com/ 
>
> Happy Django-ing! :-) 
>

-- 
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/5ac4dbb9-6a04-4f86-a562-6096c205102b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which Version of Django

2014-09-30 Thread Muhammad Ahmed
Thank you Andreas! 

I started learning Python 3x and later on I used 2.7, hence the minor 
differences will probably not create problem for me.

Anyways thanks for your guidelines. 



On Tuesday, 30 September 2014 12:35:05 UTC+5, Andréas Kühne wrote:
>
> You should be aware that using python 3 will give you small problems 
> regarding compability with several plugins for django. Python 3 is becoming 
> more adopted, but it is not always easy to find plugins that do what you 
> want in all situations. That being said, we have just rewritten our website 
> in django 1.6 and python 3.4, just to adopt the latest. It is possible, but 
> a bit harder. Also I find that I like the python 3 syntax better than 
> python 2, but that's just me :-)
>
> Regards,
>
> Andréas
>
> 2014-09-30 8:27 GMT+02:00 Lachlan Musicman 
> >:
>
>> As to Python, it depends on what is available to you and you feel
>> comfortable with.
>>
>> Either python 2.7.x or 3.3 (or 3.4, which ever is newest) should be fine.
>>
>> cheers
>> L.
>>
>> On 30 September 2014 16:26, Lachlan Musicman > > wrote:
>> > Muhammad,
>> >
>> > Yes 1.7 is considered stable and is the best place to start.
>> >
>> > Cheers
>> > L.
>> >
>> > On 30 September 2014 16:21, Muhammad Ahmed > > wrote:
>> >> Hi,
>> >>
>> >> I am learning Django by using version 1.4 and I have completed first 4
>> >> introductory lessons.
>> >>
>> >> However, I see that newest Django version is 1.7 and I feel that I am 
>> using
>> >> an outdated version.
>> >>
>> >> Being a newbie, I would like to ask that should I move to version 1.7 
>> and
>> >> which Django version is currently being used in "Professional 
>> Environments".
>> >>
>> >> Please guide which version (of both Python / Django) should I follow?
>> >>
>> >>
>> >> Regards,
>> >>
>> >>
>> >> Muhammad Ahmed
>> >>
>> >> --
>> >> 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 http://groups.google.com/group/django-users.
>> >> To view this discussion on the web visit
>> >> 
>> https://groups.google.com/d/msgid/django-users/4cc3724d-d6d9-45f4-85d8-34df7d6ecc34%40googlegroups.com
>> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> > --
>> > You have to be really clever to come up with a genuinely dangerous
>> > thought. I am disheartened that people can be clever enough to do that
>> > and not clever enough to do the obvious thing and KEEP THEIR IDIOT
>> > MOUTHS SHUT about it, because it is much more important to sound
>> > intelligent when talking to your friends.
>> > This post was STUPID.
>> > 
>> ---
>> > The Most Terrifying Thought Experiment of All Time
>> > 
>> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>>
>>
>>
>> --
>> You have to be really clever to come up with a genuinely dangerous
>> thought. I am disheartened that people can be clever enough to do that
>> and not clever enough to do the obvious thing and KEEP THEIR IDIOT
>> MOUTHS SHUT about it, because it is much more important to sound
>> intelligent when talking to your friends.
>> This post was STUPID.
>>
>> ---
>> The Most Terrifying Thought Experiment of All Time
>>
>> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>>
>> --
>> 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...@googlegrou

Re: Which Version of Django

2014-09-29 Thread Muhammad Ahmed

>
> Thank you Lachlan Musicman.


Be Blessed.  

-- 
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/9303b941-677f-40bb-903b-648257d87773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Which Version of Django

2014-09-29 Thread Muhammad Ahmed
Hi, 

I am learning Django by using version 1.4 and I have completed first 4 
introductory 
lessons <https://docs.djangoproject.com/en/1.4/intro/tutorial01/>.

However, I see that newest Django version is 1.7 and I feel that I am using 
an outdated version. 

Being a newbie, I would like to ask that should I move to version 1.7 and 
which Django version is currently being used in "Professional 
Environments". 

Please guide which version (of both Python / Django) should I follow? 


Regards,


Muhammad Ahmed

-- 
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/4cc3724d-d6d9-45f4-85d8-34df7d6ecc34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.5.1 - Mysql - Setting

2014-09-12 Thread Muhammad Ahmed
Thank you very much Collin Anderson. 

On Friday, 12 September 2014 21:25:42 UTC+5, Collin Anderson wrote:
>
> https://pip.readthedocs.org/en/latest/quickstart.html
>

-- 
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/ea8cdd3d-b59f-4066-b905-cbe008af911c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.5.1 - Mysql - Setting

2014-09-12 Thread Muhammad Ahmed
Thank you very much Fred for your detailed answer. 

I have never used pip. I will be pleased if you kindly provide a reference 
/ tutorial link to understand pip. 

Or the direct link to adapter. I am using Win7 x86. 


Thanks indeed for your help. 



On Thursday, 11 September 2014 21:34:25 UTC+5, Fred Stluka wrote:
>
>  Ahmed,
>
> For connecting Django to MySQL, I use MySQL-python, installed 
> via pip as:
> pip install MySQL-python
>
> My settings file contains:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME'  : 'name of our database',
> 'USER'  : 'username to access the database',
> 'PASSWORD'  : 'password to access the database',
> # Required for Windows; Harmless (same as default) for Linux
> 'HOST'  : '127.0.0.1',
> # Required for Windows; Harmless (same as default) for Linux
> 'PORT'  : '3306',
> },
>
>  --Fred 
> --
> Fred Stluka -- mailt...@bristle.com  -- 
> http://bristle.com/~fred/ 
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service! 
> Open Source: Without walls and fences, we need no Windows or Gates. 
> --
>  On 9/11/14 9:34 AM, Muhammad Ahmed wrote:
>  
> Hi,  
>
>  I have been trying to launch my Django Model using a tutorial. but 
> unfortunately the tutorial is about Django 1.1.
>
>  Kindly guide me that what configuration (in setting.py) will be required 
> if I use Python27 / Django 1.5.1 with Mysql. 
>
>  please also guide towards the appropriate "MySql Adoptor" for Django 
> 1.5.1. 
>
>  
>  Thanks in advance :) 
>
>  
>  Ahmed
>  -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/881464cf-d4aa-4934-9915-3830ebafd4e6%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/881464cf-d4aa-4934-9915-3830ebafd4e6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ee4c8d1e-456c-49fb-99ec-f85887c5f70a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.5.1 - Mysql - Setting

2014-09-11 Thread Muhammad Ahmed
Hi, 

I have been trying to launch my Django Model using a tutorial. but 
unfortunately the tutorial is about Django 1.1.

Kindly guide me that what configuration (in setting.py) will be required if 
I use Python27 / Django 1.5.1 with Mysql. 

please also guide towards the appropriate "MySql Adoptor" for Django 1.5.1. 


Thanks in advance :) 


Ahmed

-- 
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/881464cf-d4aa-4934-9915-3830ebafd4e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.