Re: [mezzanine-users] Check if a local path exists?

2016-12-17 Thread Ryne Everett
Page models *are* database models.

-- 
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] Check if a local path exists?

2016-12-17 Thread Paul
Thank you Stephen. Can you elaborate a bit? How do I do that? 

I'm familiar with database models, but I don't quite understand page 
models. 

I'm still learning the ropes around Django and Mezzanine. I believe what 
you're saying is generic to Django? 

Thanks!

On Saturday, December 17, 2016 at 8:08:22 PM UTC-8, Stephen McDonald wrote:
>
> Try querying the page model itself.
>
> On Sun, Dec 18, 2016 at 8:04 AM, Paul > 
> wrote:
>
>> I'm trying to validate if a page with a url exists. I do something like 
>> this: 
>>
>> (Pdb) resolve('/does-not-exist/') 
>>
>> I get... 
>>
>> ResolverMatch(func=mezzanine.pages.views.page, args=(), kwargs={'slug': 
>> 'does-not-exist'}, url_name=page, app_names=[], namespaces=[]) 
>>
>> This page doesn't exist. When I go here in my browser, I see something 
>> like this: 
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://localhost:8000/does-not-exist/
>> Raised by: mezzanine.pages.views.page
>>
>> You're seeing this error because you have DEBUG = True in your Django 
>> settings file. Change that to False, and Django will display a standard 
>> 404 page.
>>
>> I've tried to research ways to do this within Mezzanine. If I understand 
>> correctly, the catch-all is causing an issue here. Any two cents? Thank you!
>>
>> -- 
>> 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] Check if a local path exists?

2016-12-17 Thread Stephen McDonald
Try querying the page model itself.

On Sun, Dec 18, 2016 at 8:04 AM, Paul  wrote:

> I'm trying to validate if a page with a url exists. I do something like
> this:
>
> (Pdb) resolve('/does-not-exist/')
>
> I get...
>
> ResolverMatch(func=mezzanine.pages.views.page, args=(), kwargs={'slug':
> 'does-not-exist'}, url_name=page, app_names=[], namespaces=[])
>
> This page doesn't exist. When I go here in my browser, I see something
> like this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/does-not-exist/
> Raised by: mezzanine.pages.views.page
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
> I've tried to research ways to do this within Mezzanine. If I understand
> correctly, the catch-all is causing an issue here. Any two cents? Thank you!
>
> --
> 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] Check if a local path exists?

2016-12-17 Thread Paul
I'm trying to validate if a page with a url exists. I do something like 
this: 

(Pdb) resolve('/does-not-exist/') 

I get... 

ResolverMatch(func=mezzanine.pages.views.page, args=(), kwargs={'slug': 
'does-not-exist'}, url_name=page, app_names=[], namespaces=[]) 

This page doesn't exist. When I go here in my browser, I see something like 
this: 

Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/does-not-exist/
Raised by: mezzanine.pages.views.page

You're seeing this error because you have DEBUG = True in your Django 
settings file. Change that to False, and Django will display a standard 404 
page.

I've tried to research ways to do this within Mezzanine. If I understand 
correctly, the catch-all is causing an issue here. Any two cents? Thank you!

-- 
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.