Re: [mezzanine-users] Odd test database behaviour

2015-01-06 Thread Avery Laird
Solved my own issue, just took some fiddling with the migrations. Seems to 
work now, thanks again for your help

On Tuesday, 6 January 2015 15:12:19 UTC-8, Avery Laird wrote:
>
> Thanks for the tip, adding the dependency fixed the page issue -- but now 
> I'm running into trouble with an extra model field that I injected into the 
> BlogPost model. This time, the column isn't being generated: 
>
> django.db.utils.ProgrammingError: column blog_blogpost.use_dark_background 
> does not exist
>
> I'm not sure how to fix this one, since the migration fails at 0003, and 
> the extra model is migration 00021 -- lower migrations can't depend on 
> higher ones in the same app. Any ideas?
>
> On Tuesday, 6 January 2015 14:20:35 UTC-8, Avery Laird wrote:
>>
>> Good idea... I'll try something like this 
>> 
>>
>> On Tuesday, 6 January 2015 14:17:35 UTC-8, Stephen McDonald wrote:
>>>
>>> Wild guess - you can edit south migrations to define which other 
>>> migrations they depend on. You might need to do that in your own migrations.
>>>
>>> On Wed, Jan 7, 2015 at 9:11 AM, Avery Laird  wrote:
>>>
 Hello,

 I ran into an issue while trying to create a test database:

 django.db.utils.ProgrammingError: relation "pages_page" does not exist

 I have an theme app (called theme) that uses the mezzanine page model, 
 so I assume it must have something to do with that; sure enough, the top 
 of 
 the traceback includes a failed SQL operation involving the table 
 theme_homepage,homepage being a model in my theme app that inherits 
 from mezzanine.pages.models.Page. To see if my hunch is correct, I change 
 the order of my installed apps to have mezzanine.pages before theme. 
 Sure enough, when running python manage.py test the error is now:

 django.db.utils.ProgrammingError: relation "pages_page" already exists

 I know there must be some overlap between apps causing the issue, one 
 which I fixed before by fiddling with south. The problem is, I can't 
 fiddle 
 with a test database, and at any rate I would rather do things the right 
 way then have a fragile database. The models.py from theme is included 
 below:

 from django.db import models
 from django.utils.translation import ugettext_lazy as _


 from mezzanine.core.fields import FileField, RichTextField
 from mezzanine.core.models import RichText, Orderable, Slugged
 from mezzanine.pages.models import Page
 from mezzanine.utils.models import upload_to


 class HomePage(Page, RichText):
 """
 The homepage
 """
 header = models.CharField(max_length=140)
 subheader = models.CharField(max_length=140)
 splash = FileField(verbose_name=_("Splash Image"),
 upload_to=upload_to("theme.HomePage.splash", "splash"),
 format="Image", max_length=255, null=True, blank=True)


 class Meta:
 verbose_name = _("Home Page")
 verbose_name_plural = _("Home Pages")
 
 class Slide(Orderable):
 '''
 Homepage slider images
 '''
 homepage = models.ForeignKey(HomePage, related_name="slides")
 image = FileField(verbose_name=_("Image"),
 upload_to=upload_to("theme.Slide.image", "slider"),
 format="Image", max_length=255, null=True, blank=True)


 class ExtendedBlog(Page, RichText):
 """
 RichText page, but with an optional splash image
 """
 splash = FileField(verbose_name=_("Splash Image"),
 upload_to=upload_to("theme.ExtendedBlog.splash", "splash"),
 format="Image", max_length=255, null=True, blank=True)


 class Meta:
 verbose_name = _("Extended Blog")
 verbose_name_plural = _("Extended Blogs")


 Thanks for any ideas/help!

 Cheers,

 Avery


  -- 
 You received this message because you are subscribed to the Google 
 Groups "Mezzanine Users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to mezzanine-use...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Stephen McDonald
>>> http://jupo.org
>>>  
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Odd test database behaviour

2015-01-06 Thread Avery Laird
Thanks for the tip, adding the dependency fixed the page issue -- but now 
I'm running into trouble with an extra model field that I injected into the 
BlogPost model. This time, the column isn't being generated: 

django.db.utils.ProgrammingError: column blog_blogpost.use_dark_background 
does not exist

I'm not sure how to fix this one, since the migration fails at 0003, and 
the extra model is migration 00021 -- lower migrations can't depend on 
higher ones in the same app. Any ideas?

On Tuesday, 6 January 2015 14:20:35 UTC-8, Avery Laird wrote:
>
> Good idea... I'll try something like this 
> 
>
> On Tuesday, 6 January 2015 14:17:35 UTC-8, Stephen McDonald wrote:
>>
>> Wild guess - you can edit south migrations to define which other 
>> migrations they depend on. You might need to do that in your own migrations.
>>
>> On Wed, Jan 7, 2015 at 9:11 AM, Avery Laird  wrote:
>>
>>> Hello,
>>>
>>> I ran into an issue while trying to create a test database:
>>>
>>> django.db.utils.ProgrammingError: relation "pages_page" does not exist
>>>
>>> I have an theme app (called theme) that uses the mezzanine page model, 
>>> so I assume it must have something to do with that; sure enough, the top of 
>>> the traceback includes a failed SQL operation involving the table 
>>> theme_homepage,homepage being a model in my theme app that inherits 
>>> from mezzanine.pages.models.Page. To see if my hunch is correct, I change 
>>> the order of my installed apps to have mezzanine.pages before theme. 
>>> Sure enough, when running python manage.py test the error is now:
>>>
>>> django.db.utils.ProgrammingError: relation "pages_page" already exists
>>>
>>> I know there must be some overlap between apps causing the issue, one 
>>> which I fixed before by fiddling with south. The problem is, I can't fiddle 
>>> with a test database, and at any rate I would rather do things the right 
>>> way then have a fragile database. The models.py from theme is included 
>>> below:
>>>
>>> from django.db import models
>>> from django.utils.translation import ugettext_lazy as _
>>>
>>>
>>> from mezzanine.core.fields import FileField, RichTextField
>>> from mezzanine.core.models import RichText, Orderable, Slugged
>>> from mezzanine.pages.models import Page
>>> from mezzanine.utils.models import upload_to
>>>
>>>
>>> class HomePage(Page, RichText):
>>> """
>>> The homepage
>>> """
>>> header = models.CharField(max_length=140)
>>> subheader = models.CharField(max_length=140)
>>> splash = FileField(verbose_name=_("Splash Image"),
>>> upload_to=upload_to("theme.HomePage.splash", "splash"),
>>> format="Image", max_length=255, null=True, blank=True)
>>>
>>>
>>> class Meta:
>>> verbose_name = _("Home Page")
>>> verbose_name_plural = _("Home Pages")
>>> 
>>> class Slide(Orderable):
>>> '''
>>> Homepage slider images
>>> '''
>>> homepage = models.ForeignKey(HomePage, related_name="slides")
>>> image = FileField(verbose_name=_("Image"),
>>> upload_to=upload_to("theme.Slide.image", "slider"),
>>> format="Image", max_length=255, null=True, blank=True)
>>>
>>>
>>> class ExtendedBlog(Page, RichText):
>>> """
>>> RichText page, but with an optional splash image
>>> """
>>> splash = FileField(verbose_name=_("Splash Image"),
>>> upload_to=upload_to("theme.ExtendedBlog.splash", "splash"),
>>> format="Image", max_length=255, null=True, blank=True)
>>>
>>>
>>> class Meta:
>>> verbose_name = _("Extended Blog")
>>> verbose_name_plural = _("Extended Blogs")
>>>
>>>
>>> Thanks for any ideas/help!
>>>
>>> Cheers,
>>>
>>> Avery
>>>
>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Stephen McDonald
>> http://jupo.org
>>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Odd test database behaviour

2015-01-06 Thread Avery Laird
Good idea... I'll try something like this 


On Tuesday, 6 January 2015 14:17:35 UTC-8, Stephen McDonald wrote:
>
> Wild guess - you can edit south migrations to define which other 
> migrations they depend on. You might need to do that in your own migrations.
>
> On Wed, Jan 7, 2015 at 9:11 AM, Avery Laird  > wrote:
>
>> Hello,
>>
>> I ran into an issue while trying to create a test database:
>>
>> django.db.utils.ProgrammingError: relation "pages_page" does not exist
>>
>> I have an theme app (called theme) that uses the mezzanine page model, so 
>> I assume it must have something to do with that; sure enough, the top of 
>> the traceback includes a failed SQL operation involving the table 
>> theme_homepage,homepage being a model in my theme app that inherits from 
>> mezzanine.pages.models.Page. To see if my hunch is correct, I change the 
>> order of my installed apps to have mezzanine.pages before theme. Sure 
>> enough, when running python manage.py test the error is now:
>>
>> django.db.utils.ProgrammingError: relation "pages_page" already exists
>>
>> I know there must be some overlap between apps causing the issue, one 
>> which I fixed before by fiddling with south. The problem is, I can't fiddle 
>> with a test database, and at any rate I would rather do things the right 
>> way then have a fragile database. The models.py from theme is included 
>> below:
>>
>> from django.db import models
>> from django.utils.translation import ugettext_lazy as _
>>
>>
>> from mezzanine.core.fields import FileField, RichTextField
>> from mezzanine.core.models import RichText, Orderable, Slugged
>> from mezzanine.pages.models import Page
>> from mezzanine.utils.models import upload_to
>>
>>
>> class HomePage(Page, RichText):
>> """
>> The homepage
>> """
>> header = models.CharField(max_length=140)
>> subheader = models.CharField(max_length=140)
>> splash = FileField(verbose_name=_("Splash Image"),
>> upload_to=upload_to("theme.HomePage.splash", "splash"),
>> format="Image", max_length=255, null=True, blank=True)
>>
>>
>> class Meta:
>> verbose_name = _("Home Page")
>> verbose_name_plural = _("Home Pages")
>> 
>> class Slide(Orderable):
>> '''
>> Homepage slider images
>> '''
>> homepage = models.ForeignKey(HomePage, related_name="slides")
>> image = FileField(verbose_name=_("Image"),
>> upload_to=upload_to("theme.Slide.image", "slider"),
>> format="Image", max_length=255, null=True, blank=True)
>>
>>
>> class ExtendedBlog(Page, RichText):
>> """
>> RichText page, but with an optional splash image
>> """
>> splash = FileField(verbose_name=_("Splash Image"),
>> upload_to=upload_to("theme.ExtendedBlog.splash", "splash"),
>> format="Image", max_length=255, null=True, blank=True)
>>
>>
>> class Meta:
>> verbose_name = _("Extended Blog")
>> verbose_name_plural = _("Extended Blogs")
>>
>>
>> Thanks for any ideas/help!
>>
>> Cheers,
>>
>> Avery
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Odd test database behaviour

2015-01-06 Thread Stephen McDonald
Wild guess - you can edit south migrations to define which other migrations
they depend on. You might need to do that in your own migrations.

On Wed, Jan 7, 2015 at 9:11 AM, Avery Laird  wrote:

> Hello,
>
> I ran into an issue while trying to create a test database:
>
> django.db.utils.ProgrammingError: relation "pages_page" does not exist
>
> I have an theme app (called theme) that uses the mezzanine page model, so
> I assume it must have something to do with that; sure enough, the top of
> the traceback includes a failed SQL operation involving the table
> theme_homepage,homepage being a model in my theme app that inherits from
> mezzanine.pages.models.Page. To see if my hunch is correct, I change the
> order of my installed apps to have mezzanine.pages before theme. Sure
> enough, when running python manage.py test the error is now:
>
> django.db.utils.ProgrammingError: relation "pages_page" already exists
>
> I know there must be some overlap between apps causing the issue, one
> which I fixed before by fiddling with south. The problem is, I can't fiddle
> with a test database, and at any rate I would rather do things the right
> way then have a fragile database. The models.py from theme is included
> below:
>
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
>
>
> from mezzanine.core.fields import FileField, RichTextField
> from mezzanine.core.models import RichText, Orderable, Slugged
> from mezzanine.pages.models import Page
> from mezzanine.utils.models import upload_to
>
>
> class HomePage(Page, RichText):
> """
> The homepage
> """
> header = models.CharField(max_length=140)
> subheader = models.CharField(max_length=140)
> splash = FileField(verbose_name=_("Splash Image"),
> upload_to=upload_to("theme.HomePage.splash", "splash"),
> format="Image", max_length=255, null=True, blank=True)
>
>
> class Meta:
> verbose_name = _("Home Page")
> verbose_name_plural = _("Home Pages")
>
> class Slide(Orderable):
> '''
> Homepage slider images
> '''
> homepage = models.ForeignKey(HomePage, related_name="slides")
> image = FileField(verbose_name=_("Image"),
> upload_to=upload_to("theme.Slide.image", "slider"),
> format="Image", max_length=255, null=True, blank=True)
>
>
> class ExtendedBlog(Page, RichText):
> """
> RichText page, but with an optional splash image
> """
> splash = FileField(verbose_name=_("Splash Image"),
> upload_to=upload_to("theme.ExtendedBlog.splash", "splash"),
> format="Image", max_length=255, null=True, blank=True)
>
>
> class Meta:
> verbose_name = _("Extended Blog")
> verbose_name_plural = _("Extended Blogs")
>
>
> Thanks for any ideas/help!
>
> Cheers,
>
> Avery
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Odd test database behaviour

2015-01-06 Thread Avery Laird
Hello,

I ran into an issue while trying to create a test database:

django.db.utils.ProgrammingError: relation "pages_page" does not exist

I have an theme app (called theme) that uses the mezzanine page model, so I 
assume it must have something to do with that; sure enough, the top of the 
traceback includes a failed SQL operation involving the table 
theme_homepage,homepage being a model in my theme app that inherits from 
mezzanine.pages.models.Page. To see if my hunch is correct, I change the 
order of my installed apps to have mezzanine.pages before theme. Sure 
enough, when running python manage.py test the error is now:

django.db.utils.ProgrammingError: relation "pages_page" already exists

I know there must be some overlap between apps causing the issue, one which 
I fixed before by fiddling with south. The problem is, I can't fiddle with 
a test database, and at any rate I would rather do things the right way 
then have a fragile database. The models.py from theme is included below:

from django.db import models
from django.utils.translation import ugettext_lazy as _


from mezzanine.core.fields import FileField, RichTextField
from mezzanine.core.models import RichText, Orderable, Slugged
from mezzanine.pages.models import Page
from mezzanine.utils.models import upload_to


class HomePage(Page, RichText):
"""
The homepage
"""
header = models.CharField(max_length=140)
subheader = models.CharField(max_length=140)
splash = FileField(verbose_name=_("Splash Image"),
upload_to=upload_to("theme.HomePage.splash", "splash"),
format="Image", max_length=255, null=True, blank=True)


class Meta:
verbose_name = _("Home Page")
verbose_name_plural = _("Home Pages")

class Slide(Orderable):
'''
Homepage slider images
'''
homepage = models.ForeignKey(HomePage, related_name="slides")
image = FileField(verbose_name=_("Image"),
upload_to=upload_to("theme.Slide.image", "slider"),
format="Image", max_length=255, null=True, blank=True)


class ExtendedBlog(Page, RichText):
"""
RichText page, but with an optional splash image
"""
splash = FileField(verbose_name=_("Splash Image"),
upload_to=upload_to("theme.ExtendedBlog.splash", "splash"),
format="Image", max_length=255, null=True, blank=True)


class Meta:
verbose_name = _("Extended Blog")
verbose_name_plural = _("Extended Blogs")


Thanks for any ideas/help!

Cheers,

Avery


-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.