Django 1.8 migrations showing "AttributeError"

2015-07-27 Thread vijay kumar
Hi,
   Problem: Empty migration doesn't show user friendly message.

   When i run "python manage.py migrate" with no new migrations to be
applied it show me error message "AttributeError: '_Meta' object has no
attribute 'model_name'" instead of showing user friendly message "no
migration to apply".
   I have using python3.4.1, django 1.8.3

Steps to replicate: First run migrate command to apply all migrations, Next
re-run same command again.

 Below is trackback for reference.
Synchronizing apps without migrations:
  Creating tables...
Running deferred SQL...
  Installing custom SQL...
Running migrations:
  No migrations to apply.

Traceback (most recent call last):
  File "manage.py", line 9, in 
execute_from_command_line(sys.argv)
  File "/lib/python3.4/site-packages/django/core/management/__init__.py",
line 338, in execute_from_command_line
utility.execute()
  File "/lib/python3.4/site-packages/django/core/management/__init__.py",
line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/python3.4/site-packages/django/core/management/base.py", line 393,
in run_from_argv
self.execute(*args, **cmd_options)
  File "/lib/python3.4/site-packages/django/core/management/base.py", line
444, in execute
output = self.handle(*args, **options)
  File
"/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
line 207, in handle
changes = autodetector.changes(graph=executor.loader.graph)
  File
"//lib/python3.4/site-packages/django/db/migrations/autodetector.py", line
43, in changes
changes = self._detect_changes(convert_apps, graph)
  File "/lib/python3.4/site-packages/django/db/migrations/autodetector.py",
line 170, in _detect_changes
old_field.rel.through._meta.model_name,
AttributeError: '_Meta' object has no attribute 'model_name'

Did anyone face similar issue?

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


Re: Django model register for admin section

2009-08-18 Thread vijay kumar
Hi,
   I tried it but ended up with some problem .
   Let me try it once again

with Thanks
Ajay

On Tue, Aug 18, 2009 at 1:59 PM, Alex Gaynor  wrote:

>
> On Tue, Aug 18, 2009 at 3:28 AM, ajay wrote:
> >
> > Hi ,
> >   To register model in admin section we need to Register individual
> > class
> >   Example:
> >  admin.site.register(Poll)
> >  admin.site.register(Choice)
> > admin.site.register(Vote)
> >
> > Is there other way to register all class by single register call  like
> > this
> >admin.site.register(Poll,Choice,Vote)
> >
> > with thanks
> > Ajay
> > >
> >
>
> Yep,
> admin.site.register([Model1, Moel2, Model3])
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your
> right to say it." -- Voltaire
> "The people's good is the highest law." -- Cicero
> "Code can always be simpler than you think, but never as simple as you
> want" -- Me
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django test case execution problem

2009-07-28 Thread vijay kumar

Hello Karen,
 Thanks for the correcting my mistake.

On Jul 28, 6:27 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 9:11 AM, vijay kumar <vnbang2...@gmail.com> wrote:
>
> > Hi,
>
> >   I am running testcase from django when I run them from models.py it
> > run.
>
> >   But when I put the same in test.py in the same directory where
> > models is define it not even getting called.
>
> Name the file tests.py, not test.py.
>
> Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django test case execution problem

2009-07-28 Thread vijay kumar

Hi,

   I am running testcase from django when I run them from models.py it
run.

   But when I put the same in test.py in the same directory where
models is define it not even getting called.

  My structure django application is  mysite

Settings.py

 Urls.py

  Polls

 __int__.py

 models.py

 test.py

 views.py

I used this command to run the test cases   python manage.py test
polls

Can some help me know what am I missing or should need to do
something  so my testcase from test.py start get executed.

I tried to follow this link for the same 
http://docs.djangoproject.com/en/dev/topics/testing/







with thanks

Vijay


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---