Re: [mezzanine-users] Error save page.

2023-05-21 Thread Danny

Hi Alice,

This mailing list is no longer used for discussions, please use the 
Discussions feature on Github at 
https://github.com/stephenmcd/mezzanine/discussions


The issue you raise is a known one, although not fixed/released yet: 
https://github.com/stephenmcd/mezzanine/issues/2054


There is an incompatibility between Mezzanine 6.0.0 and Bleach 6.0.0. A 
workaround (as noted in the issue) is to downgrade Bleach in your 
requirements.txt to `bleach<6`


Best of luck,

Seeya. Danny.



On 22/05/2023 12:05 am, Alice Koh wrote:
Hi I am new to Mezzanine. I install Mezzanine 6.0.0. I am not sure if 
it is due to compatibility with django/python or some other issue but 
I cannot do a simple save page as below. Please assist.


Error.jpg
--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/b4e7216a-09be-4788-8e02-a3d556179df0n%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/b4e7216a-09be-4788-8e02-a3d556179df0n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/57b96b02-3587-0bb5-d70b-977ff2665f71%40gmail.com.


Re: [mezzanine-users] Mandatory authentication for users to access site

2022-11-26 Thread Danny

Some suggestions:

- Check the 'Login required' box on all Pages
- Update your base template to hide any "Sign Up" links
- add ACCOUNTS_APPROVAL_REQUIRED=True to your settings.py
( 
https://mezzanine.readthedocs.io/en/latest/configuration.html#accounts-approval-required 
)
This means that even of someone does sign up without your knowledge, 
you'll have to approve/activate the account manually as admin.
- Add the decorator @login_required to functions in views.py (and use 
these in urls.py as an override of the mezzanine defaults).
 See 
https://docs.djangoproject.com/en/4.1/topics/auth/default/#the-login-required-decorator


This is likely the biggest change, as you'll want to override the 
default Mezzanine blog behaviour so that it uses your URLs/views rather 
than the default ones.


Hope this helps.

Seeya. Danny.


On 24/11/2022 2:15 pm, John Tate wrote:

Hey Mezzanine Community,

I have been using Mezzanine CMS happily for my personal website for 
many years where I post blogs and such, open to the public.


I want to deploy another site on a subdomain where I can post blogs 
much the same but in a private matter, for people invited only. I 
basically intend to start with `pip install mezzanine --user` much 
like my personal site (but as another Linux user account), where most 
details were taken care of for me. I run Mezzanine because it got my 
site running quickly!


I just want to configure it so that a login is required to view any 
pages or blog posts whatsoever. I can't find much on doing this, and 
as far as changing mezzanine goes it is important the solution is the 
simplest one possible.


I also want it so user accounts and passwords to access this site are 
created by myself and myself only. Any registration features need to 
be disabled.


John
--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/3a07d74a-d2ce-4257-8a62-dffc778d58bdn%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/3a07d74a-d2ce-4257-8a62-dffc778d58bdn%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/68a35cea-c2a0-50e4-3fd8-d15ba1ef464a%40gmail.com.


Re: [mezzanine-users] Cartridge v5.0.0-rc.1

2021-10-17 Thread Danny
There's an open pull request from petedermott here which does a lot of the
preliminary work: https://github.com/stephenmcd/cartridge/pull/346

You could potentially look at his fork along with your other changes to get
Cartridge up to date.

(I'm using a highly customised version of Cartridge for my site, but I made
use of Pete's work to update my own repo to get my custom Cartridge working
with Mezzanine 5.0.0-alpha1 and Django 2.2.x)

Hope this helps.

Seeya. Danny.

On Mon, 18 Oct 2021 at 00:10, Joseph Mohan  wrote:

> Is anybody currently working on bringing cartridge inline with mezzanine
> v5.0.0-rc.1
> <https://github.com/stephenmcd/mezzanine/releases/tag/v5.0.0-rc.1>
>
> If not, I'm happy to submit a PR, although having issues following the
> contribution instructions from
> https://github.com/stephenmcd/cartridge#contributing
>
> I'm unable to run:
>
> python setup.py develop
>
> And install the current master branch of mezzanine. I've tried changing
> cartridge/project_template/requirements.txt to
>
> Mezzanine==5.0.0a1 and Mezzanine==.dev0
>
> But I'm not really sure what I'm doing here (out of touch with python
> package management). Do I even need to bother with this step? The changes
> are all pretty simple import changes.
>
> BTW My changes in cartridge are working with the current master branch of
> mezzanine installed by :
>
> pip install git+https://github.com/stephenmcd/mezzanine
>
> Is this also correct?
>
> Not actually contributed to a public project before so forgive me if
> there's follow up questions I apoligise in advance.
>
> Joe
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/f1dda0e3-842f-493f-8155-2c038362c099n%40googlegroups.com
> <https://groups.google.com/d/msgid/mezzanine-users/f1dda0e3-842f-493f-8155-2c038362c099n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CAKyDYnfzB8oZMJy6f59tY42E10uqM0ORt%3DFFiJaHwLDvGB2zjA%40mail.gmail.com.


Re: [mezzanine-users] cartridge list all products

2021-05-28 Thread Danny

On 29/05/2021 1:28 am, Ken Bolton wrote:



On Fri, May 28, 2021 at 4:56 AM ek ekke <mailto:ekk...@gmail.com>> wrote:


I am trying to list all products from cartridge, is that function
all ready in there and how can i call it from a template?
Don't want to write the view if it's all ready in there somewhere.


Check out the `Category` module, which is a subclass of Mezzanine's 
`Page`.


Simplest way is

Product.objects.all()

To get that in a template, you might need to write a template tag, e.g. 
I added something to my Orders Change List template so that I could 
filter orders by a specific product (and export the results to CSV). The 
basics are:


In admin.py (or forms.py):

def get_all_products():
    return [(p.id, p.title) for p in 
Product.objects.all().order_by('title')]


class OrderByProductForm(forms.Form):
    product = forms.ChoiceField(label="Export filtered orders containing",
    choices=[])

    def __init__(self, *args, **kwargs):
    super(OrderByProductForm, self).__init__(*args, **kwargs)
    self.fields["product"].widget = 
forms.Select(choices=get_all_products())


templatetags/myapp_tags.py:

@register.simple_tag
def export_order_by_product_form(request):
    querystring = request.GET.dict()
    return OrderByProductForm(queries=querystring)

And then in templates/admin/order_change_list.html:

{% extends "admin/change_list.html" %}
{% load admin_urls myapp_tags %}

{% block object-tools-items %}


   {% export_order_by_product_form request %}
   

{{ block.super }}
{% endblock %}

Note then i have also defined a view for "order_export" which uses the 
selected Form item to find the right orders and export them to CSV.


Hope this helps.

Seeya. Danny.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/08b321ba-261e-dea9-1866-c4d9dcdd84f1%40gmail.com.


[mezzanine-users] Re: Admin action drop-down 'required' preventing saving updates

2021-02-18 Thread Danny

Hi again everyone,

I think I finally got to the bottom of my problem.

The Select widget  used for this admin dropdown *does* have the 
'required' attribute by default, but there's Mezzanine javascript that 
removes this from this specific location in admin pages:


https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/navigation.js#L6

In my case, the problem was that my website was hitting a Javascript 
error earlier on and thus this line wasn't executing properly or being 
skipped entirely. Part of this was that I had an old set of javascript 
files etc in 'static' on my webserver leftover from using Mezzanine 4.3.


Among other things,  I was missing the new jQuery version used by 
Mezzanine 5.0.0a1 and when I checked the developer console in my browser 
I could see a bunch of JS errors.


I manually ran python manage.py collectstatic, restarted the server, and 
now things appear to be working as expected.


So a word of advice for anyone else hitting similar upgrade issues: 
check the developer console in your browser for javascript errors, and 
make sure you have run collectstatic when you deploy!


Seeya. Danny.

On 18/02/2021 4:30 pm, Danny wrote:


Hi all,

This is possibly a Django-2.2.18 related problem, but I thought I'd 
see if anyone else has experienced this and had a workaround.


I recently updated my website to Mezzanine 5.0.0a1 and Django 2.2.18, 
and after some reasonably thorough local testing, deployed it to the 
live website.


One of my fellow admins discovered something odd, which I've now 
confirmed on both local and deployed sites.


At the top of an Admin change list page, there's the standard action 
drop down (usually containing 'Delete selected '). This is 
useful when you want to select some objects and delete them, but 
otherwise I've not customised it for any of the standard 
Mezzanine/Cartridge models I use.


What's now odd is that if you hit the 'Save' button at the bottom of 
the object list, a generic prompt pops up saying 'Please select an 
item in the list' pointing to this action drop down.


After some research, I discovered the following:

a) this pop up message is generic from HTML5, for a  form 
element that has the 'required' attribute: 
https://www.w3schools.com/TAGS/att_select_required.asp


b) this 'required' attribute is being added to the  element 
when the page is rendered, but only when DEBUG=False. That is, on my 
local development with DEBUG=True, the select element is not required 
(and Save works fine), but if I modify my local settings and set 
DEBUG=False, then required is forced on this element, and I get the 
same pop up as seen on the deployed server.


I've tried digging into the Django code to try and find out what's 
happening to render this field, but it seems to be fairly benign:


grapelli-safe template that renders the action drop down: 
https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/actions.html#L3


django code that is the action form: 
https://github.com/django/django/blob/2.2.18/django/contrib/admin/helpers.py#L20


I'm not sure where the ChoiceField is being forced to required=True 
when DEBUG=False, nor how I can override this.


Any one got any ideas? Have you noticed this on your own deployments 
using Mezzanine 5.0.0a1?


Thanks for any help,

Seeya. Danny.



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/38160e1e-093b-92e1-89c3-070fb1d77c51%40gmail.com.


[mezzanine-users] Admin action drop-down 'required' preventing saving updates

2021-02-17 Thread Danny

Hi all,

This is possibly a Django-2.2.18 related problem, but I thought I'd see 
if anyone else has experienced this and had a workaround.


I recently updated my website to Mezzanine 5.0.0a1 and Django 2.2.18, 
and after some reasonably thorough local testing, deployed it to the 
live website.


One of my fellow admins discovered something odd, which I've now 
confirmed on both local and deployed sites.


At the top of an Admin change list page, there's the standard action 
drop down (usually containing 'Delete selected '). This is 
useful when you want to select some objects and delete them, but 
otherwise I've not customised it for any of the standard 
Mezzanine/Cartridge models I use.


What's now odd is that if you hit the 'Save' button at the bottom of the 
object list, a generic prompt pops up saying 'Please select an item in 
the list' pointing to this action drop down.


After some research, I discovered the following:

a) this pop up message is generic from HTML5, for a  form 
element that has the 'required' attribute: 
https://www.w3schools.com/TAGS/att_select_required.asp


b) this 'required' attribute is being added to the  element when 
the page is rendered, but only when DEBUG=False. That is, on my local 
development with DEBUG=True, the select element is not required (and 
Save works fine), but if I modify my local settings and set DEBUG=False, 
then required is forced on this element, and I get the same pop up as 
seen on the deployed server.


I've tried digging into the Django code to try and find out what's 
happening to render this field, but it seems to be fairly benign:


grapelli-safe template that renders the action drop down: 
https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/actions.html#L3


django code that is the action form: 
https://github.com/django/django/blob/2.2.18/django/contrib/admin/helpers.py#L20


I'm not sure where the ChoiceField is being forced to required=True when 
DEBUG=False, nor how I can override this.


Any one got any ideas? Have you noticed this on your own deployments 
using Mezzanine 5.0.0a1?


Thanks for any help,

Seeya. Danny.

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/a46283a7-99de-02ad-628f-26b80459403b%40gmail.com.


Re: [mezzanine-users] Promotion from test.domain.com to www.domain.com

2020-03-06 Thread Danny

On 7/03/2020 2:14 am, James Morse wrote:

Greetings all,
I set up my first Mezzanine site for my wife to work on as 
test.domain.com with the intent of that being temporary. This was so 
her old static HTML "production" site wasn't affected until she was 
done.  Last night she finally finished the site and asked me to 
"launch it". I pointed her @ record and www.domain.com to the new 
server IP hosting the Mezzanine setup and after fixing the cert, I was 
surprised to see the base template site/theme without any of the 
content she worked on.  After searching similar but not identical 
scenarios, I now see that Mezzanine instantiates itself for each 
subdomain.  Is there some way to point all her subdomains to the 
content she's already worked so hard on?  If not, then is there 
perhaps a way to migrate the test.domain.com site content to the @ or 
www. subdomain "new" site?  I've seen the responses that reference 
using Nginx or similar to redirect all to x.domain.com but in this 
case I, of course, don't want her customers being redirected to 
"test.domain.com", so I need a different solution.

Thanks for your time and any help you can provide!


Have you logged into the admin, and updated the default 'Site' to the 
'www.domain.com'?  Mezzanine associates each page with a 'Site' so you 
can serve multiple subdomains with the same database and django instance 
- and the URL is used for this when not in test mode.


(Basically, go to www.domain.com/admin/sites/site/ and make sure that's 
correct - if not, edit it)


Does that help?

I have done this before to change a test.domain.com to a 
live.domain.com, and it seemed to work ok. The other option you can try 
is to just set it to domain.com.


There might be someone else with more Mezzanine knowledge than me who 
can help, but I think this the best place to start checking, especially 
if the test domain is still working.


Seeya. Danny.

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/f81ff661-c016-4bc7-1ba7-d2fa45bcd742%40gmail.com.


Re: [mezzanine-users] Are fabric deployments popular?

2020-02-18 Thread Danny
Hi,

I do make use of a (modified version) of the included fabfile. However, I'm
using Python 3.6 on my dev and server machines, and use Fabric3 to do the
deployment. It works pretty well.
If this could be the supported version for Python3, that would be great.

Seeya. Danny.

On Wed, 19 Feb 2020 at 12:46, Mike Dewhirst  wrote:

> Ed
>
> I really appreciate your work and love Mezzanine and Fabric.
>
> I would like to see the fabfile kept in Mezzanine and enhanced slightly
> by removing repo specifics to make it repo-agnostic.
>
> I use and support a number of Subversion repos. I have done this for
> more than a decade and although I have occasionally tried, I don't have
> the brainspace or need for Git (or Hg) as well as svn. Occasionally I'm
> forced to use it so I have to resort to googling Git recipes. It isn't
> pleasant and I always need a stiff whisky afterwards.
>
> I once enhanced the fabfile to work with svn and was about to contribute
> it back to the project when a new release came out. That meant I needed
> to redo the work and I never did find the time to do it again. Since
> then I have been muddling along manually and my Mezz work has gradually
> diminished.
>
> I'd be happy to contribute to any svn stuff and test it.
>
> Cheers
>
> Mike
>
> On 19/02/2020 12:16 pm, Eduardo Rivas wrote:
> > Hello everyone,
> >
> > I'm Ed, one of the collaborators helping maintain Mezzanine. As we
> > prepare to release the next version of Mezzanine (supporting Python 3
> > and Django 2.2 only) an issue was recently filed
> > <https://github.com/stephenmcd/mezzanine/issues/1957> wondering about
> > the future of mezzanine's built-in fabfile (which only works with
> > Python 2).
> >
> > This made me wonder: Are Fabric deployments widely used by the
> > community? What are your thoughts on the following options:
> >
> >   * Stop maintaining a fabfile of our own and just point people to
> > general Django deployment docs
> >   * Extract the fabfile as a separate package/project
> >   * Keep the fabfile as part of Mezzanine
> >
> > Looking forward to hearing from the community.
> > --
> > 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
> > <mailto:mezzanine-users+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/mezzanine-users/02b090b5-2d83-485d-aee3-f5997da14844%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/mezzanine-users/02b090b5-2d83-485d-aee3-f5997da14844%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/ab47f973-5e3d-9c91-5eb8-613279cbd147%40dewhirst.com.au
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CAKyDYnc2Se%3DnWYOuotzFrAx-Zf1%3D8m7N%3DcXr8r%2BMCtHgyJoRAg%40mail.gmail.com.


Re: [mezzanine-users] Compatibility with Django 2.2

2019-07-02 Thread Danny

Hi Jeff,

I'm kind of in the same boat - although my site is on Django 1.11 and I 
could probably leave it there, although there's some 2.x features I'd 
like to use.


To be honest, I'd recommend attempting No. 2) (fork and attempt to 
upgrade it yourself) - and yes, if your changes aren't going to break 
too many backwards compatibility things, a pull request when you're done 
may be useful.


Inspired by your post, I made a quick start on this yesterday, with 
mezzanine and cartridge, and after about 5 small fixes (and a bit of 
research), managed to get past the initial "createdb" step of setup. 
I've not pushed my changes back to my forks yet, but it wasn't too much 
effort to get this far. I'll summarise the changes below to get you 
started. There's probably more things to do based on actual operation of 
Mezzanine, but this should be enough to at least generate a new test site.


Hopefully with a number of people working on this we can support Django 
2.2 without also breaking Django 1.11 compatibility... A tricky task, no 
doubt!


Seeya. Danny.


Mezzanine changes:

core/templatetags/mezzanine_tags.py

TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_VAR and TOKEN_TEXT are no longer 
members of django.template.base. Instead, import TokenType and replace 
the references with TokenType.BLOCK, TokenType.COMMENT etc.


project_template/project_name/settings.py

django.contrib.messages must be added to INSTALLED_APPS


Cartridge changes:

shop/models.py

Replace @models.permalink decorator on get_absolute_url() with using 
reverse inside the method, i.e.

    def get_absolute_url(self):
    return reverse("shop_product", args=(self.slug,))

project_template/settings.py

Remove django.contrib.auth.middleware.SessionAuthenticationMiddleware 
from list of middlewares. It's no longer required from Django 1.10 and 
has been removed in Django 2.0 (see 
https://docs.djangoproject.com/en/2.2/releases/2.0/#miscellaneous)


django.contrib.messages must be added to INSTALLED_APPS

shop/views.py

Replace from django.core.urlresolvers import reverse with from 
django.urls import reverse





On 18/06/2019 2:55 am, Jeff wrote:
I have recently created a related issue on github but didn't receive 
any response (https://github.com/stephenmcd/mezzanine/issues/1928). 
Basically Mezzanine compatibility with Django 2 is limited to 2.0 
which is no longer supported. Moreover that compatibility is not fully 
tested.


I need to upgrade a legacy site which is based on Mezzanine 3.4.1 and 
Django 1.8. Ideally we would like to upgrade to Django 2.2 because 
it's an LTS version and we could stay on that until April 2022.


There are a few options but I'm lacking information to make a good 
decision:


 1. wait until Mezzanine officially supports Django 2.2, but I have no
idea when or if that will happen. It seems to me, that at the
current pace it won't happen this year. (It's not a negative
judgement, I'm very grateful for being able to use a free and
mature CMS for many years on so many site!). Do you have any
roadmap or even some approximate schedule?
 2. fork Mezzanine and upgrade things myself but with a prioritisation
based on the need of my site. Hopefully I'd be able to contribute
back to the main repo. However I have no idea how much work would
be involved? Is it a 2 day job or a 2 week job? Do you have any
sense of how much work would is left, which Mezzanine components
need to be worked on for 2.2 compatibility?
 3. automate the migration of the content to another CMS, that would
be more sustainable but would also require quite a lot of
development. This is my least favourite option (because I can't
think of a better Django-CMS for my particular needs) but at least
I can accurately assess the development effort and time-frame.

Thanks in advance for any piece of information that could help me and 
my team better evaluate the situation.


Geoffroy

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/72720423-ef8e-4e0e-982e-b39e555d27d4%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/72720423-ef8e-4e0e-982e-b39e555d27d4%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 "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
To view

[mezzanine-users] Store credit / gift vouchers

2019-04-28 Thread Danny
Hi all,

I was just wondering if anyone had already done something that could add a
store credit or gift voucher feature to Cartridge?

The discount code system doesn't quite seem to work, as it's more about
providing a specific discount ($ or percentage) on a per-item basis, with
potentially a limit on the number of orders it can be used with.

This is different to a gift voucher or store credit which has a set amount
to start with, but whoever uses it then makes a purchase and has the amount
of their cart applied against the credit/voucher, which may go one of a few
ways:

a) cart total is less or equal to remaining credit --> amount to pay
becomes 0, and the credit is reduced by the cart total.
b) cart total is more than remaining credit -> amount to pay is discounted
by credit amount, credit is reduced to 0, and remaining amount should be
paid as part of checkout.

In this way, the credit/voucher can be a 'discount' the same as a discount
is. it's just the way it's applied that is different.

So... has anyone done something like this - or if not, are there things I'm
missing about it?

I'm considering implementing this in my fork of cartridge using a variant
of the discount code model - which I've already modified for my own
purposes - so that a code can be used per item, per order, or as a 'credit'
system. I think this is probably easier than creating an entirely new model
for the store credit idea.

Thanks for any input or insight you folks can give!

Seeya. Danny.

-- 
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] How to resize image on upload ?

2018-11-24 Thread Danny

On 25/11/2018 3:43 am, Nicolas Pinault wrote:



Hi,

Le 14/10/2018 à 02:33, Danny a écrit :

On 13/10/2018 11:41 PM, 3...@drpi.fr wrote:

Hi,

When uploading images in blog post or in media library, I get an 
error saying the file size is too big.
I don't want to modify the file size limit, my images come from a 
DSLR generating big files.
What I'd like, this is to be able to resize uploaded images 
automatically.

I this possible ?


How would this work? In order for the server to do the resizing 
(which I guess is what you want, as that's where Pillow is 
installed), you'd have to upload the full file, and then allow the 
server to resize it - in which case, you're uploading the large file 
anyway, so you'd have to remove the file size limit to allow 
grapelli to upload that size file.


If you want to resize the file locally before uploading - why would 
this be a feature of Mezzanine, which is server-based? Can't you 
just resize the pictures yourself using any photo app on your local 
computer/device, and then do the upload?

There are 3 ways of doing the resize :
1) Server side. I have to authorize bigger files to be uploaded. 
Then, how do I resize the image ?


It looks like this is the best option.
So, how do I resize the image when it is uploaded ? 


Use Pillow to do the resizing (https://pillow.readthedocs.io/en/5.3.x/ 
)  but I'm not sure where in the Mezzanine code to put this - possibly 
as part of a filebrowser or grapelli fork?




--
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] How to resize image on upload ?

2018-10-13 Thread Danny

On 13/10/2018 11:41 PM, 3...@drpi.fr wrote:

Hi,

When uploading images in blog post or in media library, I get an error 
saying the file size is too big.
I don't want to modify the file size limit, my images come from a DSLR 
generating big files.

What I'd like, this is to be able to resize uploaded images automatically.
I this possible ?


How would this work? In order for the server to do the resizing (which I 
guess is what you want, as that's where Pillow is installed), you'd have 
to upload the full file, and then allow the server to resize it - in 
which case, you're uploading the large file anyway, so you'd have to 
remove the file size limit to allow grapelli to upload that size file.


If you want to resize the file locally before uploading - why would this 
be a feature of Mezzanine, which is server-based? Can't you just resize 
the pictures yourself using any photo app on your local computer/device, 
and then do the upload?


Seeya. Danny.

--
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] Do not send a email, what's the problem?

2018-08-03 Thread Danny

On 2/08/2018 3:49 AM, Eugeniu Rotari wrote:

Hi

I probably missed something or do't understand ...
I see an email in the server logs, but does not come to the mail.
How to be? Help PLZ!!!

Have you set up the EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER and 
EMAIL_HOST_PASSWORD settings?


https://docs.djangoproject.com/en/2.0/topics/email/

If you're not running a local SMTP server, you'll need to connect to a 
remote one.
All of my website's emails are sent via a Sendgrid account ( 
https://sendgrid.com ) which is free/good if your website is fairly low 
volume when it comes to sending email.


Hope this helps,

Seeya. Danny.

--
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] Need to have the same page in multiple locations in the page tree, how link them?

2018-02-08 Thread Danny

On 8/02/2018 9:18 PM, Roger van Schie wrote:

Hi Everyone

I have a use case where the client basically wants a rich text field 
page to write about a certain product, but this product falls under 
different categories. Each category is higher up in the branch 
hierarchy, and they want that same page(the rich text field page) to 
be displayed in multiple categories.


My current thinking is to just create a custom page model that has a 
foreign key to the other page and put that in the page tree. Would 
this be the best approach?


An easier way to do it is to have the actual page at one place in the 
hierarchy, and then use a 'Link' page elsewhere to automatically go to 
this page. I've done this before, no troubles.


It will mean that when viewing the page it will always just have the one 
breadcrumb trail, but it will still be available from two places within 
the navigation menus.


Seeya. Dnany.

--
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] Other staff users unable to see old blog posts?

2018-01-05 Thread Danny

Hi all,

I've just discovered that other Staff users can't see any of the blog 
posts I've created (as superuser) over the past year in the admin. They 
have the correct permissions to add/edit/delete blog posts, and can 
definitely do so, but any past entries are not visible to them at all. 
I've even tested this myself with a different account with the same 
permissions as these other staff users.


Is this by design? i.e. that staff users can only see their own created 
blog posts? Or have I got something wrong in my setup?


Thanks,

Seeya. Danny.


--
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] Case insensitive username login

2017-11-05 Thread Danny

On 5/11/2017 1:24 PM, Chris Hawes wrote:


I'm wondering if there is a reason 
|mezzanine.core.auth_backends.MezzanineBackend| doesn't support 
case-insensitive usernames for logging in? 
|mezzanine.accounts.forms.ProfileForm| enforces case-insensitive 
username uniqueness when registering, so it seems like it would be 
natural to allow them for logging in. It feels to me like a bug that 
it doesn't.



I bring this up because I've had users of my site write to me 
bewildered that they can't log in, and then it turns out they had 
capitalization in their username and just assumed that it wouldn't 
matter, as is the case on other sites.



If others do not agree that it is a bug, perhaps adding a setting for 
this would be appropriate. In any case I would be happy to work on a 
PR if there is agreement on a change.




I've certainly had the case where users have contacted me because they'd 
put some capitalisation in their original signup email address and then 
tried to log in using it in all lowercase -- and in the case of email 
addresses, case is DEFINITELY not important - so I don't know why it 
seems to be for the Mezzanine/Django login.


So if usernames are also not case sensitive, we should definitely fix it 
for both.


Seeya. Danny.

--
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] How to setup a contact service?

2017-09-24 Thread Danny
On 25 September 2017 at 07:59, jenia mtl  wrote:

> Hello.
>
> How do I setup a contact service?
>

> Right now I get this error:
>
>POST /contact/ HTTP/1.1" 500 118061
>
>
> Do I need to implement the view myself that will be sending the email? Or
> is there a Django app for this?
>

Hi Jenia,

Do you mean a web form that people can fill in and send information to you?

Just create a Form page in your page hierarchy. If you've set up the
EMAIL_* related setting fields correctly, and your server can send email,
you can easily get the form contents emailed to you.

Mezzanine's default models/views make use of the Django SMTP backend to
send email. You will need to set up the appropriate fields in your settings:
https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend

You can use a local SMTP server, or sign up for one of the online ones that
allow you to post email messages via https, such as https://sendgrid.com

Seeya. Danny.

-- 
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] Where is the login page?

2017-09-24 Thread Danny
Hi Jenia,

Cartridge and Mezzanine use the mezzanine.accounts app for public user
login.

See: http://mezzanine.jupo.org/docs/user-accounts.html

Note that if you create a Profile model that contains address fields that
match what the Cartridge checkout form wants, the checkout process will try
and copy those fields into the checkout form (see
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/checkout.py#L118
)
This is quite a handy feature. The fields in the user profile should be
named "street", "city", "state", "postcode", "country" and "phone".

Accessing the user's profile is the same as it is in mezzanine, through the
/accounts/update/ URL.

Hope this helps,

Seeya. Danny.




On 25 September 2017 at 08:04, jenia mtl  wrote:

> Hello.
>
>
> I can't find the login page in Cartridge.
>
> For example, when the user wants to rate a product, they need to login.
>
> There should be some login functionality I suppose.
>
> Is it this: admin/login/?next=/admin/?
>
> If so, how do I set the button there at the bottom to be "Site" by default
> instead of "Admin".
>
> Should I create my own login page for that?
>
> And finally, how do users register? How do I differentiate users from
> admins?
>
>
> Thanks
>
> --
> 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.
>

-- 
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] Cartridge, how can the user view their purchasing history?

2017-09-24 Thread Danny
On 25 September 2017 at 08:17, jenia mtl  wrote:

> Hello.
>
> How do I create the purchasing history page?
>

I just added this to my urls.py:

url("^account/orders/$", order_history, name="shop_order_history"),
(after including cartridge.shop.urls)

Then the history is at yoursite.com/account/orders/

You can create a Link in the page hierarchy that points to this URL so
people can see their order.

The template is here:
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/templates/shop/order_history.html

So you can override what it contains by creating
yourapp/templates/shop/order_history.html

Customising this per user may depend on you adding specific stuff to the
template that reads fields of the current user's model object and working
things out that way (which you can probably do in a template tag if you
like, read up on Django template tags:
https://docs.djangoproject.com/en/1.11/howto/custom-template-tags/ )

Hope this helps.

Seeya. Danny.




>
> I suppose I'll need to create something along these lines:
>
> http://mezzanine.jupo.org/docs/content-architecture.
> html#creating-custom-content-types?
>
> But how can I make it display something different for each user? How do I
> customize it per user?
>


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

-- 
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] Redirect 301 NON www TO www

2017-09-04 Thread Danny

On 5/09/2017 12:35 AM, Matic Noč wrote:

All the changes I have done so far were in templates od deploy. I think I will 
just put www domain in DOMAINS and in nginx template make another server with 
non www domain which redirects to www domain:)

To do the redirect in nginx, you just need something like this in your 
project/deploy/nginx.conf template:


# redirect all requests on www subdomain to root domain
server {
    listen 80;
    server_name www.example.com;

    add_header Strict-Transport-Security "max-age=63072000; 
includeSubdomains; preload";

    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;

    return 301 $scheme://example.com/$request_uri;
}

Of course, replace example.com with your domain name. (and add the 
necessary SSL lines if you want to redirect https://www.example.com to 
https://example.com)


Underneath this in the config, you can just have another server {} block 
to describe the example.com domain and push requests through to 
Django/Mezzanine.


If you're using fabric to deploy, then changing the template on your 
development machine should be enough, and a fab deploy will transfer 
these changes

across to your production server.

If you want to double check, be sure to log into the production server 
and have a look in /etc/nginx/sites-enabled and make sure that there's a 
conf file there that matches your template.


If it still appears to not be working, make sure that nginx has been 
restarted:

%> sudo service nginx restart

Or just reboot your production server.

Hope this helps,

Seeya. Danny.


--
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] creating a page with a custom, or multiple, rich text fields

2017-03-13 Thread Danny
You can use something like Mezzanine Blocks
https://github.com/renyi/mezzanine-blocks to insert various "blocks" within
a page (nb not a Page, as such).
The blocks can be added to pages by a specific template tag and then you
treat each block as if it were its own Rich Text (or other) page, kind of.
Have a read of the readme file at that link.

There are other similar packages out there too.

Seeya. Danny.

On 14 March 2017 at 09:27,  wrote:

> I've read through the docs but I'm still not clear on how I can create a
> page with multiple rich text fields. I've tried
>
> from django.db import models
> from mezzanine.pages.models import Page, RichText
>
> class Club(Page, RichText):
> club_description = RichText("club description")
> # ...
>
> and then an admin.py with:
>
> from copy import deepcopy
> from django.contrib import admin
> from mezzanine.pages.admin import PageAdmin
> from .models import Club
>
> club_extra_fieldsets = (
> (None, {
> "fields": (
> "club_description",
> "...",
> )
> }),
> )
>
> class ClubAdmin(PageAdmin):
> inlines = ()
> fieldsets = deepcopy(PageAdmin.fieldsets) + club_extra_fieldsets
>
> admin.site.register(Club, ClubAdmin)
>
> But this does not give a rich text field when I hit up the admin and
> create a new "Club" page. Instead it errors out with a message that
> "club_description" is an unknown field. Is there any documentation on how
> to add multiple (or even one) rich text field to a page?
>
> -- Mike "Pomax" Kamermans
>
>
> --
> 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.
>

-- 
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] displayable_link.js is not generated - development server

2017-01-26 Thread Danny

Hi Lucas,

I've also just noticed that the "Link List" feature is no longer working 
as of Mezzanine 4.2.2 (on either the admin side or the front end) and is 
still broken at HEAD.
It appears to be some ordering error with regards to when 
tinymce_setup.js is executed vs when the scripts in admin/base_site.html 
or editable_loader.html are parsed to set up the window.__link_list_url 
variable.


I've opened this issue: https://github.com/stephenmcd/mezzanine/issues/1728

However, Javascript is not my forte, so debugging this is a little 
beyond me. Hopefully someone else can assist.


[BTW, if you're worried about displayable_links.js not being generated 
properly, just visit admin/displayable_links.js directly - and if it 
returns you a lovely structure of links, then that isn't your issue.]


Best of luck,

Seeya. Danny.

On 25/01/2017 7:32 AM, Lucas Corso wrote:


Hello, I have more or less the same problem that Danny presents at:

--> 
https://groups.google.com/forum/#!searchin/mezzanine-users/displayable_links.js|sort:relevance/mezzanine-users/6ZgJtRF9VWk/6cR6p0cnAwAJ



In my case I'm running mezzanine on a development server, at first I 
thought it was some missing package, but then I realized that the 
problem was that displayable_link.js was not being generated when I 
clicked the link button on the panel Tools to publish.





<https://lh3.googleusercontent.com/-xJPQhfn95Fs/WIe-Y2DWnsI/AA0/4oXksV97trY6Iyyp_fawC5-6FKiwwBEnwCLcB/s1600/1.png>

What has worked so far is what clarifies Danny to delete templates / 
admin / base_site.html and if it works



<https://lh3.googleusercontent.com/-A0jOffWzUxU/WIe_kp2xY0I/AA8/cXB-dUmn16McVDb7IeN7FE395gpJ1c76wCLcB/s1600/2.png>

But some styles are lost in the administration site


<https://lh3.googleusercontent.com/-1l3NeW4-YgU/WIe_7Ya-rtI/ABA/3itvXt0JijEbUwg0iR_Rn19CtwzxaYQrQCLcB/s1600/3.png>

Compared to the normal style

<https://lh3.googleusercontent.com/-xt1RI2MmRJ0/WIfAUwSH0UI/ABE/GM1c6auKY5UOLgfVXy-vL82YzABvhN4EACLcB/s1600/4.png>

What could I do to fix it? Thanks for reading...




--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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


--
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] Is there a way to remove comments/ratings from everywhere?

2016-12-11 Thread Danny
Hi Matt,

The way I did it was to comment out/remove the sections of the templates
that dealt with comments in my customised templates.

So comments are still supported within the code base, but an end user can't
see them at all.

Hope this helps.

Seeya. Danny.

On 12 December 2016 at 07:03, Matt  wrote:

> I'm new to Mezzanine (and fairly new to Python). I'm looking to get away
> from Drupal and use something python-based.
>
>
> Is there a way to disable comments/ratings from mezzanine completely? eg.
> in templates and in admin panel? From my research, this is the only thing
> I've found: http://bitofpixels.com/blog/disabling-mezzanine-comments/ – I
> also found another article saying this is not supported (although it was
> from 4 years ago).
>
>
> I'm wondering if that link is my best option at this time (although that
> still leaves me with comment links in admin panel). I'm still learning the
> ropes so I may be missing something obvious. 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] Cartrige custom shipping by country

2016-11-13 Thread Danny

On 14/11/2016 7:48 AM, akos1234 wrote:

Hello Danny,

I am trying to work on the codes you have hear against what I have. I 
wanted to see how the shipping by country is implemented checking out 
your code. I have some errors trying to incorporate it into my project 
not going so well for me

I hope to learn from what you have hear.

If I could sort out the errors and at least see how your codes works, 
I may be able to do something with what I am looking for.




I'd suggest you work through things step-by-step from scratch. Given 
that you want a simple shipping rule model with a set price for each 
country,

you don't need anything as complicated as what I had to do.

First, write your own shipping handler function, and use it instead of 
the standard one.

See http://cartridge.jupo.org/integration.html#billing-shipping
In that function, you should be able to set a shipping price based on 
country. Do this using values within the function to start with.


Next, you can add your 'Shipping Rule' model (in models.py - you can 
probably do this in your own app, rather than modifying cartridge like I 
had to).
The model should probably just contain two fields: The country (or a 
regexp for one) and the shipping cost.
In admin.py you can then register the model so it can be edited in the 
Admin.


Then, modifying your shipping handler function to look up the set of all 
shipping rules and match the order's country to a rule within the 
database, getting the appropriate cost.


I hope this helps.

Seeya. Danny.





Regards

On Friday, 4 November 2016 23:12:44 UTC, Danny S wrote:

On 5/11/2016 4:18 AM, Akhlaq Rao wrote:

Hello Danny,

I am not seeing these options when creating a variation, all I
see the colour and size, do you now how do I enable these variations?

- Product Variations now have weight, and boolean "pickup
available"/"shipping available" options

Thanks,
Akhlaq



In my ProductVariation  model, I've added these as fields. They
are not product options (which is what colour/size are in the
default settings).
When you edit the details on a variation, you can add things like
price, sale price etc; What I've done is add weight, pickup
available and shipping available as other fields there.


https://gist.github.com/molokov/36ab544df43efb224719d300761612a4#file-models-py-L8

<https://gist.github.com/molokov/36ab544df43efb224719d300761612a4#file-models-py-L8>

If all you want to do is add shipping rules based on country, you
don't need these fields - I just have them because we sell some
items that are "virtual"
(e.g. tickets) that have no weight; and we have other items that
can only be picked up (and never shipped).

Seeya. Danny.




On Thu, Nov 3, 2016 7:31 PM, Danny mol...@gmail.com 
wrote:

On 4/11/2016 5:31 AM, akos1234 wrote:

Hello everyone,

I am trying to attempt to create the shipping for my site.

I was looking at this post -


http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category

<http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category>

which I thought was at the right track. I need to set
shipping cost for countries as well as different cost for
quantity.

If more than 5 items bought, the calculation of shipping
would cost more than one item.

However, Melvyn Sopacua

*su*ggested something I did not quiet understand.

here as quoted -

If this is the extent of your shipping rules, you may get
away with this
approach. From experience with other shopping carts, I
highly suggest you
implement a rule-based approach as opposed to a property
approach.
Approach like an email filter:
- You define a state formulated by a set of conditions
- Which result in one or more actions
- And has post-processing flags, like "stop further rule
processing if used"

The implementation is more complex, but the resulting
flexibility is worth it
and much of the code can be reused for different types of
business logic, like
follow-up emails, discounts and available payment methods:
- Send a "please review our product" reminder, if customer
has not reviewed
and has received product x days ago.
- Give 10% cart discount to customers who have spent at
least x ammount last
year and don't apply any other cart discount rules
- Offer "Pay within 30 days" payment method only to
customers of the customer
group "B2B" with credit limit > order ammount
- Don't offer 24 hour delivery if ship

Re: [mezzanine-users] TEMPLATE_ACCESSIBLE_SETTINGS

2016-11-11 Thread Danny

What you've got looks pretty good to me - I have something very similar.

It should be in defaults.py inside an app inside your project. The only 
difference with mine is that the TEMPLATE_ACCESSIBLE_SETTINGS call is at 
the bottom of the list, i.e. after the other settings have been registered.


Hope this helps.

Seeya. Danny.

On 11/11/2016 11:05 PM, JM M wrote:
Hi I'm having trouble showing up the settings for the social media 
here is the code, tried searching but no luck I read the comments 
below of the blog post but still don't work. Anyone want to help? thanks.

from mezzanine.confimport register_setting
from django.utils.translationimport ugettext_lazyas _

register_setting(
 name="TEMPLATE_ACCESSIBLE_SETTINGS", append=True, default=("SOCIAL_LINK_FACEBOOK", 
"SOCIAL_LINK_TWITTER", "SOCIAL_LINK_VIMEO"), )

register_setting(
 name="SOCIAL_LINK_FACEBOOK", label=_("Facebook link"), description=_("If present a Facebook icon 
linking here will be in the " "header."), editable=True, default="https://facebook.com/mezzatheme";, )

register_setting(
 name="SOCIAL_LINK_TWITTER", label=_("Twitter link"), description=_("If present a Twitter icon 
linking here will be in the " "header."), editable=True, default="https://twitter.com/mezzatheme";, )

register_setting(
 name="SOCIAL_LINK_VIMEO", label=_("VIMEO link"), description=_("If present a VIMEO icon linking 
here will be in the " "header."), editable=True, default="https://VIMEO.com/mezzatheme";, )

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
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] Cartrige custom shipping by country

2016-11-04 Thread Danny

On 5/11/2016 4:18 AM, Akhlaq Rao wrote:

Hello Danny,

I am not seeing these options when creating a variation, all I see the 
colour and size, do you now how do I enable these variations?


- Product Variations now have weight, and boolean "pickup 
available"/"shipping available" options


Thanks,
Akhlaq



In my ProductVariation  model, I've added these as fields. They are not 
product options (which is what colour/size are in the default settings).
When you edit the details on a variation, you can add things like price, 
sale price etc; What I've done is add weight, pickup available and 
shipping available as other fields there.


https://gist.github.com/molokov/36ab544df43efb224719d300761612a4#file-models-py-L8

If all you want to do is add shipping rules based on country, you don't 
need these fields - I just have them because we sell some items that are 
"virtual"
(e.g. tickets) that have no weight; and we have other items that can 
only be picked up (and never shipped).


Seeya. Danny.




On Thu, Nov 3, 2016 7:31 PM, Danny molo...@gmail.com 
<mailto:molo...@gmail.com> wrote:


On 4/11/2016 5:31 AM, akos1234 wrote:

Hello everyone,

I am trying to attempt to create the shipping for my site.

I was looking at this post -


http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category

which I thought was at the right track. I need to set shipping
cost for countries as well as different cost for quantity.

If more than 5 items bought, the calculation of shipping would
cost more than one item.

However, Melvyn Sopacua

*su*ggested something I did not quiet understand.

here as quoted -

If this is the extent of your shipping rules, you may get away
with this
approach. From experience with other shopping carts, I highly
suggest you
implement a rule-based approach as opposed to a property approach.
Approach like an email filter:
- You define a state formulated by a set of conditions
- Which result in one or more actions
- And has post-processing flags, like "stop further rule
processing if used"

The implementation is more complex, but the resulting flexibility
is worth it
and much of the code can be reused for different types of
business logic, like
follow-up emails, discounts and available payment methods:
- Send a "please review our product" reminder, if customer has
not reviewed
and has received product x days ago.
- Give 10% cart discount to customers who have spent at least x
ammount last
year and don't apply any other cart discount rules
- Offer "Pay within 30 days" payment method only to customers of
the customer
group "B2B" with credit limit > order ammount
- Don't offer 24 hour delivery if shipper api qualifies customer
address as
'rural'

My 2c.
--
Has anyone done the shipping and is it possible to view the code?



I've got some custom shipping rules in my variation of Cartridge
(along with a number of other changes).
I've tried to summarise all the shipping rule related changes in
this gist:
https://gist.github.com/molokov/36ab544df43efb224719d300761612a4

Essentially:
- Product Variations now have weight, and boolean "pickup
available"/"shipping available" options
- There's a ShippingRule model which allows you to define the
rules within admin.
  The rules define a) a weight range, b) whether you care about
the pickup/shipping options, and c) a country regexp - and a
corresponding price. The order of the rules is important.
- Users are presented with valid shipping options in a drop down
during the payment step of checkout (after entering their shipping
address). If there's no matching rule, an error will be shown.

What I have is probably beyond what you need, and as you can see
I've touched the code in a lot of places (and mind you, this was
over a year ago, so my cartridge fork isn't quite up to date with
the latest master), but hopefully it will point you in the right
direction.

The changes to checkout.py (especially
shippingrule_billship_handler) and models.py/admin.py are probably
the key things you may need.

Hope this helps a little.

Seeya. Danny.

-- 
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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google 
Group

Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-03 Thread Danny

On 4/11/2016 5:31 AM, akos1234 wrote:

Hello everyone,

I am trying to attempt to create the shipping for my site.

I was looking at this post -

http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category

which I thought was at the right track. I need to set shipping cost 
for countries as well as different cost for quantity.


If more than 5 items bought, the calculation of shipping would cost 
more than one item.


However, Melvyn Sopacua

*su*ggested something I did not quiet understand.

here as quoted -

If this is the extent of your shipping rules, you may get away with this
approach. From experience with other shopping carts, I highly suggest you
implement a rule-based approach as opposed to a property approach.
Approach like an email filter:
- You define a state formulated by a set of conditions
- Which result in one or more actions
- And has post-processing flags, like "stop further rule processing if 
used"


The implementation is more complex, but the resulting flexibility is 
worth it
and much of the code can be reused for different types of business 
logic, like

follow-up emails, discounts and available payment methods:
- Send a "please review our product" reminder, if customer has not 
reviewed

and has received product x days ago.
- Give 10% cart discount to customers who have spent at least x 
ammount last

year and don't apply any other cart discount rules
- Offer "Pay within 30 days" payment method only to customers of the 
customer

group "B2B" with credit limit > order ammount
- Don't offer 24 hour delivery if shipper api qualifies customer 
address as

'rural'

My 2c.
--
Has anyone done the shipping and is it possible to view the code?



I've got some custom shipping rules in my variation of Cartridge (along 
with a number of other changes).

I've tried to summarise all the shipping rule related changes in this gist:
https://gist.github.com/molokov/36ab544df43efb224719d300761612a4

Essentially:
- Product Variations now have weight, and boolean "pickup 
available"/"shipping available" options
- There's a ShippingRule model which allows you to define the rules 
within admin.
  The rules define a) a weight range, b) whether you care about the 
pickup/shipping options, and c) a country regexp - and a corresponding 
price. The order of the rules is important.
- Users are presented with valid shipping options in a drop down during 
the payment step of checkout (after entering their shipping address). If 
there's no matching rule, an error will be shown.


What I have is probably beyond what you need, and as you can see I've 
touched the code in a lot of places (and mind you, this was over a year 
ago, so my cartridge fork isn't quite up to date with the latest 
master), but hopefully it will point you in the right direction.


The changes to checkout.py (especially shippingrule_billship_handler) 
and models.py/admin.py are probably the key things you may need.


Hope this helps a little.

Seeya. Danny.

--
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] Cartridge: Skip payment step when cart total is 0

2016-07-25 Thread Danny
It should potentially also apply if a voucher/discount code brings the
total down to 0 - that's a scenario that should be tested.

On 26 July 2016 at 09:55, Stephen McDonald  wrote:

> I added an issue here: https://github.com/stephenmcd/cartridge/issues/303
>
> On Tue, Jul 26, 2016 at 6:31 AM, Stephen McDonald  wrote:
>
>> Sounds like something we should implement in cartridge.
>>
>> On 26 Jul 2016 6:28 AM, "Rémi"  wrote:
>>
>>> Hello,
>>>
>>> I have a site with downloadable products. Some of them are free and are
>>> part of the regular chekout flow (I do some processing once the order is
>>> complete, to record downloads and such). I'm looking for an easy way to
>>> skip the payment step if the cart is equal to zero (only contains free
>>> products). Does anyone ever encounter such scenario?
>>>
>>> Thanks.
>>>
>>>

-- 
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] how to set profile fileld in 'add user' admin page

2016-07-04 Thread Danny

On 4/07/2016 6:53 PM, muin wrote:


Hi,

I have add a sms_myprofile table which store mobile phone number 
following the document 
‘http://mezzanine.jupo.org/docs/user-accounts.html#profiles’ , It 
works fine on front page and modifu user admin page. But I can not add 
the field 'mobile_phone' to 'add user' admin page (the path is 
‘admin/auth/user/add/’). Can anyone help me? Thanks!


There has been some odd behaviour with the profile fields in the admin 
view with the tagged version of Mezzanine (sometimes none, sometimes 
duplicate), which has been fixed on Mezzanine master. See 
https://groups.google.com/forum/#!topic/mezzanine-users/3QmiqfNZjUM and 
https://github.com/stephenmcd/mezzanine/issues/1449 for example.


Could you try the latest grapelli-safe and mezzanine from GitHub master 
and see if it resolves your issue?


Seeya. Danny.

--
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] Customize model field not possible ?

2016-05-10 Thread Danny

On 5/11/2016 12:24 AM, David Unric wrote:
I'd like replace field type for billing/shipping country, at 
cartridge.shop.models.Order model.
Instead of plain CharField I'd like use CountryField from 
django_countries.


Is that possible with Mezzanine and how ?

settings.EXTRA_MODEL_FIELDS does not work, it throws an exception same 
named field already exists. It sounds logical as it serves for 
/extending/ models, not replacing.
I can't also find a setting to specify alternate class for Order model 
so it seems subclassing won't be an option.


Any better idea then a fuzzy conversion to/from CountryField in custom 
form ?


It's not all that difficult. I've done something similar with a custom 
OrderForm class in cartridge-braintree (now maintained by Henri)

https://github.com/henri-hulski/cartridge_braintree/blob/master/cartridge_braintree/forms.py#L77-L83

So basically:
- Create a subclass of OrderForm
- Override the country field widgets
- and in urls.py, use this Order Form as the one used by the shop (pass 
form_class=myapp.forms.MyOrderForm, when calling the shop/checkout views)
   (Old style would be to use SHOP_CHECKOUT_FORM_CLASS but that's not 
recommended for Django 1.8 onwards)



Seeya. Danny.

--
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] IO Error on Upload - Firefox but not Chrome

2016-04-22 Thread Danny

On 23/04/2016 1:42 AM, Rodrigo Gadea wrote:

Resurrecting this... :)

Has anyone found the issue? I'm having the same problem, on a 
production env Firefox uploads throws an IOError while Chrome works 
OK. In dev env, Firefox uploads works fine... :S




I also had this. As people have mentioned, moving to the HTML5 uploader 
worked fine, which is being used by Mezzanine master.


Seeya. Danny.


Any hint? :)

Thanks,
Rodrigo

On Wednesday, October 7, 2015 at 4:32:43 AM UTC-3, iain ross wrote:


I suffered from this problem a while back but unfortunately I never
took notes at the time :-(

I seem to remember the problem didn't occur when I was running the
Django server on localhost but it did happen when I was running it on
another host on my LAN. When I moved to production with Gunicorn and
webserver the problem didn't occur. Though there was a similar issue
for users on slower connections doing large uploads in production. I
avoided that problem by adding --timeout=300 to Gunicorn.

I was, and still am, using a stock Firefox with only HTTP headers and
Firebug add-ons.

-- 


Regards,
Iain.

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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


--
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] What is the best way to edit sections/part of a page?

2016-04-13 Thread Danny

On 14/04/2016 3:08 AM, Sebastian Wain wrote:

Hi,

We plan to migrate our current Mezzanine based site 
(http://www.nektra.com) to a typical modern (multiple) one-page design 
but I can't find an easy way to edit individual website sections on a 
single page except developing our own extensions. I have checked 
mezzanine-blocks and mezzanine-onepage but they don't work with the 
latest Mezzanine version.


Is there any existing alternative to those modules?



I have a fork of mezzanine-blocks which I've updated to work with Django 
1.9 (the changes are few):

https://github.com/molokov/mezzanine-blocks

Seeya. Danny.

--
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] Figuring out how to implement user-defined product sort order in Cartridge

2016-04-07 Thread Danny
On 8 April 2016 at 13:21, Sam W  wrote:

> So I end up doing a lot of weird stuff with Cartridge, but something a bit
> more normal has been plaguing me recently; user-defined sort orders for
> products in Cartridge's categories.
>
> Basically, clients' sales staff want to be able to manually drag and drop
> products in categories to change their initial order when the page loads.
> At the moment, they're doing all sorts of stuff to achieve this, including
> unloading and reloading products so that "recently added" does what they
> want. D:
>
> Obviously this is not a normal feature in Cartridge for a bunch of
> reasons, but I was wondering if anyone else had run into this before, and
> if so how you worked around it.
>
> As I'm already customising cartridge, that's the approach I'll likely end
> up taking. It seems like the ideal way to do it is to make products
> orderable with respect to categories and then find a way to add a
> product-order widget to the category page in the admin that will update the
> category-respective order of products when edited. The latter part is the
> most difficult part of the implementation for me, as adding custom widgets
> to the grappelli is not exactly my strong suite. Does anyone have any
> advice on that subject?
>
>
I've customised cartridge as well, and one of the things I did was add an
'ordering' field to the model (I did at first try subclassing Orderable but
it wasn't successful). Then in the Products Admin, I've allowed the
ordering field to be visible/editable so an admin can numerically change
the order of the products. This isn't per category, it's overall, but it's
enough for me.

In the category template, I've removed the sort dropdown, so the only order
that products appear in is the default (which I've set to be based on
'ordering') and that way the products appear in the order I want them.

It's a simple and crude solution, but it's enough for me.

I think if you want drag-and-drop ordering you may want to *start* by
making the Product class subclass Orderable, but to provide that drag-drop
feature, you'll have to adapt the TabularDynamicInline javascript behaviour
to apply to a top level model (rather than an inline). I could never get
the drag/drop ordering to work on any top-level model, so I just gave up
and decided to use numeric ordering as it was simpler for me.

Seeya. Danny.

-- 
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] how to limit display data on template?

2016-04-06 Thread Danny

On 7/04/2016 10:14 AM, winarto saputro wrote:

hi all
i'm new in django and mezzanine
i have already create custom model "partners".
i use this {% partner in page.homepage.partners.all %} and it work fine.
but i want to display only 5 data.
anyone have idea how to do that?

thanks
sorry for my bad english :)


Well, Googling "django limit loop" brought me these two links, so at 
least one should hopefully help you:


http://stackoverflow.com/questions/992230/django-for-loop-counter-break
 - most upvoted answer suggests using the 'slice' filter in your loop

http://stackoverflow.com/questions/8373964/django-template-for-loop-print-limited-data-using-for-loop
 - uses slice in the second answer, but in the 'step' rather than the 
'end' parameter.


If you're familiar with Python slices for lists, this should be easy 
enough to comprehend, it's just applying it to Django templates.


Hope this helps,

Seeya. Danny.

--
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] Re: Link List / displayable_links not working on deployed admin

2016-03-12 Thread Danny

On 13/03/2016 2:46 PM, Eduardo Rivas wrote:


Are you deploying with git, hg, or rsync? If you have committed 
removals, they should be applied on production if using one of the VCS 
methods.




Turns out I'm using rsync. I'm looking into the --delete option, which 
might do the trick for me. I'm modifying my fabfile to suit, and adding 
a "diff" task which essentially runs rsync with --delete and -n 
(dry-run) to show me the diffs between the local and remote repositories.


In any case, it's a little trick - I can kind of understand why the 
default rsync options don't include --delete (after all, you'd have to 
be careful to not delete stuff on the production server which you may 
need) but I can't believe it tripped me up. I guess seeing a difference 
between my dev and production behaviour should have been a tipoff...


Seeya. Danny.

--
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] Re: Error 500 display_links.js Tinymce NGINX

2016-02-06 Thread Danny

Ahh, now  I see it was already fixed by Stephen the other day:
https://github.com/stephenmcd/mezzanine/pull/1516
https://github.com/stephenmcd/mezzanine/commit/94d57294bcc1e934fdd723546be7ea15bb9dcd1a

Cajoline, you may want to update your Mezzanine to the latest master 
from github, it will solve your issue.


Seeya. Danny.


On 7/02/2016 8:43 AM, Danny wrote:

I'm also seeing this issue, using Django 1.9.1 and Mezzanine 4.1.0

I've got exactly the same traceback. I'll do some investigation.

Seeya. Danny.



On 5/02/2016 10:24 PM, Cajoline wrote:

I solved my problem,
the problem occured with mezzanine 4.1 and django 1.8, for resolve it 
i change the django and mezzanine  version to 4.0.1 and 1.8  for 
Django, it's work


Le vendredi 5 février 2016 11:27:14 UTC+1, Cajoline a écrit :

Hi,

I have a error 500 in NGNIX serveur (not in local), when i click
the link button Tinymce, i paste my traceback:

any idea ? i use Mezzanine 4.1 and Django 1.9

Thank you !

Traceback

|

Traceback(most recent call last):



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
149,inget_response


response =self.process_exception_by_middleware(e,request)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
147,inget_response


response
=wrapped_callback(request,*callback_args,**callback_kwargs)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/views.py",line
192,indisplayable_links_js


forurl,obj
inDisplayable.objects.url_map(for_user=request.user).items():



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/managers.py",line
366,inurl_map


home =self.model(title=_("Home"))



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/base.py",line
408,in__init__


val =field.get_default()



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/fields/related.py",line
906,inget_default


ifisinstance(field_default,self.remote_field.model):


TypeError:isinstance()arg 2must be a type ortuple of types

|




--
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] Re: Error 500 display_links.js Tinymce NGINX

2016-02-06 Thread Danny

I'm also seeing this issue, using Django 1.9.1 and Mezzanine 4.1.0

I've got exactly the same traceback. I'll do some investigation.

Seeya. Danny.



On 5/02/2016 10:24 PM, Cajoline wrote:

I solved my problem,
the problem occured with mezzanine 4.1 and django 1.8, for resolve it 
i change the django and mezzanine  version to 4.0.1 and 1.8  for 
Django, it's work


Le vendredi 5 février 2016 11:27:14 UTC+1, Cajoline a écrit :

Hi,

I have a error 500 in NGNIX serveur (not in local), when i click
the link button Tinymce, i paste my traceback:

any idea ? i use Mezzanine 4.1 and Django 1.9

Thank you !

Traceback

|

Traceback(most recent call last):



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
149,inget_response


response =self.process_exception_by_middleware(e,request)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
147,inget_response


response
=wrapped_callback(request,*callback_args,**callback_kwargs)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/views.py",line
192,indisplayable_links_js


forurl,obj
inDisplayable.objects.url_map(for_user=request.user).items():



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/managers.py",line
366,inurl_map


home =self.model(title=_("Home"))



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/base.py",line
408,in__init__


val =field.get_default()



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/fields/related.py",line
906,inget_default


ifisinstance(field_default,self.remote_field.model):


TypeError:isinstance()arg 2must be a type ortuple of types

|




--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Flash removed from media library

2016-02-02 Thread Danny
On 3 February 2016 at 08:55, Eduardo Rivas  wrote:

> Nice!
>
> Just gave it a try and it seems to be working fine. I really like that the
> file picker dialog shows previews of images now.
>
> I've noticed that selecting with Shift and Control is not working. It
> looks like you have to click the Browse button every time you want to add a
> file. Can we get the keyboard assisted selection back?
>
> That's on Firefox on Ubuntu.
>
>
The file picker dialog is entirely up to your browser/operating system.
Yes, the new upload only supports a single file at a time, but you can add
several before hitting "upload".
I do like that it allows "All Files" in the dialog, and will give you an
error if you pick one that doesn't match a supported extension (in your
Filebrowser settings). You'll also get a prompt if choosing a file with a
name that already exists, asking if you wish to overwrite the existing one.
(If not, you need to rename either the existing file or the new one prior
to uploading).

It would be nice to add further features to this - such as multiple file
select - but I think what @crisbeto did was a very good first step, with
things fairly simple, moving away from Flash to HTML5.

Seeya. Danny.

-- 
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] Anyone got a quickfix/hack for the upload button in filebrowser

2016-02-01 Thread Danny

On 2/02/2016 1:51 AM, Joseph Mohan wrote:
Thanks, Going to dive in, Bit of an amateur so if I come up with 
anything useful i'll put it up in the group for someone better to have 
a look!!


Kristiyan Kastadinov forked filebrowser-safe a little while ago and 
added HTML5 based uploading, removing the Flash stuff.

https://github.com/crisbeto/filebrowser-safe
His pull request hasn't been pulled back into the main repo yet, but 
I've created my own fork combining Kristiyan's and the main one from 
Stephen,

and it's working well for me.

See also https://github.com/stephenmcd/filebrowser-safe/issues/33 and 
https://github.com/stephenmcd/filebrowser-safe/pull/54


YMMV, but you can give it a shot and use this fork/PR instead of the 
main release from PyPI.


Seeya. Danny.



Cheers. Joe

On Mon, Feb 1, 2016 at 3:07 PM, Eduardo Rivas <mailto:jerivasmel...@gmail.com>> wrote:


Nothing that I've personally tried, but it might be a good idea to
look into how the upstream Filebrowser handles the uploads, since
they are now Flash-free.

Current upload template:

https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/templates/filebrowser/upload.html

Issue tracking the transition away from Flash:
https://github.com/sehmaschine/django-filebrowser/issues/22


-- 
You received this message because you are subscribed to a topic in

the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mezzanine-users/nEhzHvnOkyg/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to mezzanine-users+unsubscr...@googlegroups.com
<mailto:mezzanine-users%2bunsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.


--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Blog post pagination broken

2016-01-23 Thread Danny

Hi all,

I updated my site to Mezzanine 4.1.0/Django 1.9 yesterday and mostly it 
went fairly smoothly.


This morning, however, I was getting errors from the blog app, specifically:

~
Internal Server Error: /blog/
Traceback (most recent call last):
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/django/core/handlers/base.py", 
line 140, in get_response
response = middleware_method(request, callback, callback_args, 
callback_kwargs)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py", 
line 95, in process_view

return view_func(request, *view_args, **view_kwargs)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/blog/views.py", 
line 58, in blog_post_list

settings.MAX_PAGING_LINKS)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/utils/views.py", 
line 158, in paginate

page_range = page_range[start:start + max_paging_links]
TypeError: sequence index must be integer, not 'slice'
~~~

I've determined this is happening because I have more than 50 blog posts 
in the database, and we display 5 per page with max_paging_links set to 10.
When there's 50 or fewer blog posts to display, the error doesn't occur  
- this is because the code doesn't enter the "if len(page_range) > 
max_paging_links:" part of the paginate() function. (You can probably 
check this by changing BLOG_POSTS_PER_PAGE or MAX_PAGING_LINKS in the 
admin settings/miscellaneous - both are editable)


In any case, I did some tracking down - page_range should be a Django 
Paginator Page object, which can take a slice as its index parameter
(See e.g. https://code.djangoproject.com/ticket/23140, 
https://code.djangoproject.com/ticket/23190, 
https://code.djangoproject.com/ticket/23088)
However, it appears that when I'm getting this exception, the page_range 
object is of type xrange() - which can't take a slice.


So is there a problem somewhere in mezzanine/utils/views.py that should 
be fixed? Or have I made a mistake myself somewhere else?
I'm using Python 2.7.6, so if it's a Python 2 vs 3 thing, we should 
probably make sure the code works on both.


My workaround for now will be to change MAX_PAGING_LINKS in my site 
settings to something larger.


Thanks for any help,

Seeya. Danny.

--
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] cartridge_braintree released with v.zero and PayPal support

2016-01-21 Thread Danny
Thanks Henri, and thanks also for building on what I hacked together a few
years ago, and agreeing to take it over for the future.

Braintree itself has changed quite a bit since I first wrote this plugin
(they weren't owned by PayPal at that stage, and didn't have the v.zero
stuff or the nonces etc) and because I've moved on to using a different
payments provider (PIN.net.au) I'm not maintaining the Braintree plugin any
more.

Seeya. Danny.

On 22 January 2016 at 10:59, henri  wrote:

> I have just released a first beta of cartridge_braintree.
> It implements the new v.zero API and has optional support for PayPal
> payments.
> It uses client-side card validation and number formatting based on the
> jQuery plugin from payform.
> After it sends the errors to the server to make them django errors.
> Card number and CVV are not sent to the server but processed with
> Javascript and referenced by a token.
>
> When you activate PayPal, you can choose between card or PayPal payments,
> which doesn't redirect to PayPal but a little popup to enter your login.
>
> I tested it with Braintree sandbox and everything works fine. I didn't
> tested it yet in production.
>
> Please do some more testing and give me your feedback.
>
> It's already uploaded to PyPI, you can install it with pip.
>
> More info at https://github.com/henri-hulski/cartridge_braintree.
>
> Regards,
> Henri
>
> --
> 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.
>

-- 
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] BUG: duplicate profile info under admin user panel

2016-01-13 Thread Danny

On 14/01/2016 12:58 PM, Joel Gwynn wrote:

I'm also noticing this problem in admin.  What's the fix?


This is the fix from that pull request:
https://github.com/stephenmcd/mezzanine/commit/f91022d6b5f8baecb06ceb8a9479302af1bdfbfc

It's on Mezzanine master, just not in 4.0.1.




On Thursday, October 29, 2015 at 11:39:02 PM UTC-4, Danny S wrote:

Ok, this is fixed in this pull request:
https://github.com/stephenmcd/mezzanine/pull/1450
<https://github.com/stephenmcd/mezzanine/pull/1450>

One other thing I noticed which this fixed - without this change,
on a new user created in the admin, the profile fields would only
appear once, but never saved the data entered into them. Only when
I entered data via SITE/accounts (not in admin) was the data
saved, and then I saw duplicate profile fields.

After making my changes, I added another new user via the admin,
and their profile data saved in the admin first try :)

Seeya. Danny.

On 30 October 2015 at 11:52, Danny > wrote:


On 30 October 2015 at 09:55, Stephen McDonald > wrote:

I can actually reproduce this using latest grappelli-safe

The patch resolved the issue for the site permission
field, but I get duplicate fields for profile fields.

Not sure what the solution is but I've opened an issue here:

https://github.com/stephenmcd/mezzanine/issues/1449
<https://github.com/stephenmcd/mezzanine/issues/1449>


Hi Stephen,

I can also confirm - I've updated to the latest grapelli-safe
and although Site Permissions is no longer duplicated, the
profile fields are.

I'd be interested in a solution too, if anyone manages to work
it out.

Seeya. Danny.



On Fri, Oct 30, 2015 at 7:33 AM, Ryne Everett
> wrote:

As I said in the other email, this is easy enough
to solve in the template, see

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

<https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7>
 for
how the duplicate SitePermissions was solved.


I don't think that's the link you think it is. That
patch removes the javascript hack (which is what
you're referring to as the "solution") but turned out
to also be the wrong solution and was never merged.

The correct solution to that specific issue turned out
to be
https://github.com/stephenmcd/grappelli-safe/pull/56
<https://github.com/stephenmcd/grappelli-safe/pull/56> and
(assuming the duplicate field is a tabular inline)
upgrading to grappelli-safe master may solve this
issue as well.

On Thu, Oct 29, 2015 at 3:12 PM, Danny
> wrote:

On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:

I still see this in the latest dev build. At the
bottom of
http://127.0.0.1:8000/admin/auth/user/2/
<http://127.0.0.1:8000/admin/auth/user/2/>, I see
my user profile info (i.e. phonenumber and
company) appear twice.


Hi Chi-Cheong,

As I said in the other email, this is easy enough
to solve in the template, see

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

<https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7>
for how the duplicate SitePermissions was solved.

for mine, I just added the following line
immediately after that change in my app's copy of
templates/admin/base_site.html:
$("#id_myprofile-__prefix__-id").parent().remove();

My profile module is named 'myprofile' so you'd
    probably have to use 'userprofile' instead.

Hope this helps,

Seeya. Danny.


See screen capture. This is seen even in the
latest dev branch.

My user profile module is as follows:
AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
cat userprofiles/models.py
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
  

Re: [mezzanine-users] Mezzanine-Onepage Duplicate Fieldsets

2016-01-08 Thread Danny

On 8/01/2016 11:31 PM, George M wrote:

I'm not sure this is the issue, but:


home_fieldsets = deepcopy(HomePageAdmin.fieldsets)
home_fieldsets[0][1]["fields"].insert(1, "in_opd")
HomePageAdmin.fieldsets = home_fieldsets


Here you are deepcopying HomePageAdmin.fieldsets, then changing it.



about_fieldsets = deepcopy(PageAdmin.fieldsets)
about_fieldsets[0][1]["fields"].insert(1, "in_opd")
AboutAdmin.fieldsets = about_fieldsets


Here, and for the rest, you're copying PageAdmin.fieldsets.

Do you think that could be an issue?

The other thing you could try to debug the problem is chuck in some 
prints of the fieldsets values in admin.py when you're changing them, 
just to see what the duplicate entry might be.


Hope this helps

Seeya. Danny.

--
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] Contact form

2015-12-09 Thread Danny

On 9/12/2015 8:43 PM, Alexander Benatti wrote:
Hello, I'm trying to create a contact form with mezzanine, I'd like 
that this form is sent using json and email. How can I do this?


Mezzanine's Page subclass Form can be used to create forms quite easily. 
At the moment, it purely sends the form contents as email
(optionally to the person who filled it in, plus cc's you add in the 
admin). However, it shouldn't be too difficult to add extra behaviour

at the same point.

Here's where the forms are emailed:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/page_processors.py

The page processors are handled by the Page middleware:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/middleware.py

It should be possible for you to copy/inherit from the form page 
processor, and make your own modifications, overriding the one

in Mezzanine.

Hope this helps.

Seeya. Danny.

--
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] Email from forms...

2015-12-04 Thread Danny

On 5/12/2015 3:19 AM, Sarah Hein wrote:
I feel silly, but I swear I've tried to fix this on my own and by 
checking the docs...


Working to deploy Mezzanine with Python 3.4 onto a Digital Ocean VPS. 
Trying to mimic the Fabric deploy the best I can, and have it set up 
with PostgresQL, Supervisord, Nginx, and Gunicorn. Everything seems to 
be working as expected so far.


The only hiccup is that I can't get the form to automatically send me 
emails. I've filled in the various settings via the admin panel, and 
I've added the following to settings.py (following Ross 
Laird'sexcellent guide 
<http://www.rosslaird.com/blog/customizing-mezzanine/>):


|
##
# SEND EMAIL #
##
# enable email via gmail
EMAIL_HOST ='smtp.gmail.com'
EMAIL_PORT =587
EMAIL_HOST_USER ='sarah.is.a.super.common.n...@gmail.com'
EMAIL_HOST_PASSWORD ='passwordsarefun'
EMAIL_USE_TLS =True
DEFAULT_FROM_EMAIL ='sarah.is.a.super.common.n...@gmail.com'
|


Prior to changing all of these settings, I would get an error message 
when I tried to use the form to send an email. Now I get a success 
message following form submission, and I can see the entries under 
"View Entries" from the admin panel. I just never get an email. I 
don't get it. Is Google blocking me? Is there another program I was 
supposed to have installed and integrated? I feel bad clogging up the 
mailing list, as I bet it's something simple I'm missing, but I'm out 
of ideas on how to fix this.


Given that the email is *from* you and *to* you, check your Gmail "All 
Mail" or "Sent Mail" folder, just to ensure it's not being automatically 
filed there, rather than in your inbox.


Seeya. Danny.

--
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] Displaying excerpt content on blog homepage

2015-11-26 Thread Danny

On 27/11/2015 7:52 AM, Eduardo Rivas wrote:
The blog post list template displays blurbs using {{ 
blog_post.description_from_content }}, which will get you the first or 
so elements of the post. The full content is available as {{ 
blog_post.content }}.


Don't forget to add the appropriate filters!

Here's the reference for what Eduardo mentioned - just create your own 
version of this template and change this line.

https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/templates/blog/blog_post_list.html#L112

Seeya. Danny.

--
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] Re: Issues Getting Category

2015-11-26 Thread Danny

On 27/11/2015 4:33 AM, R.J. Jackson wrote:

Hi, thank you it was helpful.

I have a follow up question, lets say I wanted to do a check to see if 
category is == to a string, how can I do that?


Why  not read up on Django template tags?
https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#if

There's several examples there using both == and %ifequal, see which one 
works best for you.


Seeya. Danny.



I have tried using the if tag but it doesn't work.

On Wednesday, November 25, 2015 at 6:09:42 PM UTC-5, Nkansah Rexford 
wrote:


Perhaps the blog_post_list.html file might be of help. In mine, I
find this:
|
{% with blog_post.categories.all as categories %}
  {% if categories %}
...
{% for category in categories %}
{{
category }}{% if not forloop.last %}, {% endif %}
{% endfor %}
  {% endif %}
{% endwith %}
|

That hopefully gives an idea how to fetch a category.

And remember, you wouldn't expect to find a category object or
objects if one isn't already created.

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
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] mezzanine_block

2015-11-23 Thread Danny

On 23/11/2015 8:59 PM, Asrik wrote:

Hello,
Iam new to Mezzanine, was trying to figure out how to make editable 
containers on my home page as i have a single page site.
I got to see 2 options mezzanine-blocks and mezzyblocks. i tried 
mezzanine-blocks https://github.com/renyi/mezzanine-blocks

followed steps as metioned but i get an error saying
'block_tags' is not a valid tag library: Template library block_tags 
not found

Is there something iam missing,how can i add tag in my library.
do we have any version compatibility for using mezzanine-blocks.



I'm using mezzanine blocks straight from my github source, it's working 
fine. Admittedly I made a fork earlier in the year and added Django 1.8 
style migrations to it,

but that's it. I don't have the changed renyi made for 0.9.3 on Sep 10 2015.

I'm going to assume that you've added 'mezzanine_blocks' to your 
INSTALLED_APPS (mine's near the bottom of the list, after all the 
mezzanine apps) and that you've run makemigrations and migrate...


That being said, the presence of the migrations shouldn't affect the 
loading of the template tags...


Seeya. Danny.

--
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] Overriding change_list.html for custom app

2015-11-19 Thread Danny

On 20/11/2015 4:34 AM, Eduardo Rivas wrote:

That is the correct template.

You need to {% extends "admin/change_list.html" %} and override the 
complete object-tools block (assuming you will provide the correct 
markup for the list and the default buttons). Alternatively, you can 
override the object-tools-items block and simply add your own buttons 
as  elements after {{ block.super }}.


https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/change_list.html#L69-L82 




+1

This is exactly what I did the other day to override the template only 
for one particular model. You can specify the templates used for model admin

within the ModelAdmin class you create. Worked like a charm :)
https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#custom-template-options

Seeya. Danny.

--
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 page has child pages

2015-11-11 Thread Danny

On 12/11/2015 5:22 AM, Neum Schmickrath wrote:
I have a layout I'm working on that has a sidebar that displays a 
sub-menu of the child pages of the current page being viewed. On 
category pages I can easily test if there are child categories by 
using {% if child_categories %} and then showing the sidebar. On pages 
is there a similar processor that I'm missing somehow? I don't want to 
display an empty sidebar if there won't be any links there.



The navigation menu from the left hand side of Mezzanine default uses this:

https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templates/pages/menus/tree.html#L20

page.has_children_in_menu

Would this work?

There's also an attribute "has_children" set on the page in the 
page_menu template tag:


https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templatetags/pages_tags.py#L84

I'm sure both of these might point you in the right direction.

Seeya. Danny.

--
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] Re: TinyMCE4 - Problems on deployed site

2015-11-10 Thread Danny

On 11/11/2015 7:02 AM, Cody Pettit wrote:

Hi Danny,

Did you ever figure out what your issue was/is? We are facing a 
similar issue.


We can't select an image from the Media Library to insert into a page 
(or form). It's not even working for us in development with DEBUG = True.


We can, however, select and insert an image into a Gallery Page.

The image/button needed to select and insert an image just isn't there 
when we are trying to insert into a page/form.


Mostly, the issue is accessing parts of the site across the HTTP/HTTPS 
boundary. If you  have HTTPS enabled for the admin side of things,
then accessing the Media Library when editing on the HTTP site doesn't 
work, and if you're editing in the Admin side, you can't get the Link 
List of pages because it's under a HTTP URL.


My overall solution was to make my entire site HTTPS... not elegant, I 
know, but probably better in this security conscious world :)


If you do go down this route, I found this page quite useful in setting 
up my nginx configuration to ensure all avenues are taken care of:

https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

Seeya. Danny.




Appreciate any help!

Thanks,

Cody



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny
Ok, this is fixed in this pull request:
https://github.com/stephenmcd/mezzanine/pull/1450

One other thing I noticed which this fixed - without this change, on a new
user created in the admin, the profile fields would only appear once, but
never saved the data entered into them. Only when I entered data via
SITE/accounts (not in admin) was the data saved, and then I saw duplicate
profile fields.

After making my changes, I added another new user via the admin, and their
profile data saved in the admin first try :)

Seeya. Danny.

On 30 October 2015 at 11:52, Danny  wrote:

>
> On 30 October 2015 at 09:55, Stephen McDonald  wrote:
>
>> I can actually reproduce this using latest grappelli-safe
>>
>> The patch resolved the issue for the site permission field, but I get
>> duplicate fields for profile fields.
>>
>> Not sure what the solution is but I've opened an issue here:
>>
>> https://github.com/stephenmcd/mezzanine/issues/1449
>>
>>
> Hi Stephen,
>
> I can also confirm - I've updated to the latest grapelli-safe and although
> Site Permissions is no longer duplicated, the profile fields are.
>
> I'd be interested in a solution too, if anyone manages to work it out.
>
> Seeya. Danny.
>
>
>
>
>
>> On Fri, Oct 30, 2015 at 7:33 AM, Ryne Everett 
>> wrote:
>>
>>> As I said in the other email, this is easy enough to solve in the
>>>> template, see
>>>>
>>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>>>  for
>>>> how the duplicate SitePermissions was solved.
>>>
>>>
>>> I don't think that's the link you think it is. That patch removes the
>>> javascript hack (which is what you're referring to as the "solution") but
>>> turned out to also be the wrong solution and was never merged.
>>>
>>> The correct solution to that specific issue turned out to be
>>> https://github.com/stephenmcd/grappelli-safe/pull/56 and (assuming the
>>> duplicate field is a tabular inline) upgrading to grappelli-safe master may
>>> solve this issue as well.
>>>
>>> On Thu, Oct 29, 2015 at 3:12 PM, Danny  wrote:
>>>
>>>> On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
>>>>
>>>> I still see this in the latest dev build. At the bottom of
>>>> http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile info
>>>> (i.e. phonenumber and company) appear twice.
>>>>
>>>> Hi Chi-Cheong,
>>>>
>>>> As I said in the other email, this is easy enough to solve in the
>>>> template, see
>>>>
>>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>>> for how the duplicate SitePermissions was solved.
>>>>
>>>> for mine, I just added the following line immediately after that change
>>>> in my app's copy of templates/admin/base_site.html:
>>>> $("#id_myprofile-__prefix__-id").parent().remove();
>>>>
>>>> My profile module is named 'myprofile' so you'd probably have to use
>>>> 'userprofile' instead.
>>>>
>>>> Hope this helps,
>>>>
>>>> Seeya. Danny.
>>>>
>>>> See screen capture. This is seen even in the latest dev branch.
>>>>
>>>> My user profile module is as follows:
>>>> AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
>>>> cat userprofiles/models.py
>>>> from django.db import models
>>>> from django.contrib.auth.models import User
>>>> from django.utils.translation import ugettext as _
>>>> from phonenumber_field.modelfields import PhoneNumberField
>>>> from companies.models import Company
>>>>
>>>> class UserProfile(models.Model):
>>>> user = models.OneToOneField(User, unique=True,
>>>> verbose_name=_('user'), related_name='user_profile')
>>>> phonenumber = PhoneNumberField(null=True, blank=True)
>>>> company = models.ForeignKey(Company, null=True)
>>>>
>>>> def __unicode__(self):
>>>> return u'%s %s (%s), %s' % (self.user.first_name,
>>>> self.user.last_name, self.user.username, self.phonenumber)
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Mezzanine Users" gr

Re: [mezzanine-users] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny
On 30 October 2015 at 09:55, Stephen McDonald  wrote:

> I can actually reproduce this using latest grappelli-safe
>
> The patch resolved the issue for the site permission field, but I get
> duplicate fields for profile fields.
>
> Not sure what the solution is but I've opened an issue here:
>
> https://github.com/stephenmcd/mezzanine/issues/1449
>
>
Hi Stephen,

I can also confirm - I've updated to the latest grapelli-safe and although
Site Permissions is no longer duplicated, the profile fields are.

I'd be interested in a solution too, if anyone manages to work it out.

Seeya. Danny.





> On Fri, Oct 30, 2015 at 7:33 AM, Ryne Everett 
> wrote:
>
>> As I said in the other email, this is easy enough to solve in the
>>> template, see
>>>
>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>>  for
>>> how the duplicate SitePermissions was solved.
>>
>>
>> I don't think that's the link you think it is. That patch removes the
>> javascript hack (which is what you're referring to as the "solution") but
>> turned out to also be the wrong solution and was never merged.
>>
>> The correct solution to that specific issue turned out to be
>> https://github.com/stephenmcd/grappelli-safe/pull/56 and (assuming the
>> duplicate field is a tabular inline) upgrading to grappelli-safe master may
>> solve this issue as well.
>>
>> On Thu, Oct 29, 2015 at 3:12 PM, Danny  wrote:
>>
>>> On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
>>>
>>> I still see this in the latest dev build. At the bottom of
>>> http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile info
>>> (i.e. phonenumber and company) appear twice.
>>>
>>> Hi Chi-Cheong,
>>>
>>> As I said in the other email, this is easy enough to solve in the
>>> template, see
>>>
>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>> for how the duplicate SitePermissions was solved.
>>>
>>> for mine, I just added the following line immediately after that change
>>> in my app's copy of templates/admin/base_site.html:
>>> $("#id_myprofile-__prefix__-id").parent().remove();
>>>
>>> My profile module is named 'myprofile' so you'd probably have to use
>>> 'userprofile' instead.
>>>
>>> Hope this helps,
>>>
>>> Seeya. Danny.
>>>
>>> See screen capture. This is seen even in the latest dev branch.
>>>
>>> My user profile module is as follows:
>>> AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
>>> cat userprofiles/models.py
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>> from django.utils.translation import ugettext as _
>>> from phonenumber_field.modelfields import PhoneNumberField
>>> from companies.models import Company
>>>
>>> class UserProfile(models.Model):
>>> user = models.OneToOneField(User, unique=True,
>>> verbose_name=_('user'), related_name='user_profile')
>>> phonenumber = PhoneNumberField(null=True, blank=True)
>>> company = models.ForeignKey(Company, null=True)
>>>
>>> def __unicode__(self):
>>> return u'%s %s (%s), %s' % (self.user.first_name,
>>> self.user.last_name, self.user.username, self.phonenumber)
>>>
>>>
>>> --
>>> 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.
>>>
>>>
>>>
>>> --
>>> *Danny Sag*
>>> Chairperson
>>> Round World Events SA, Inc
>>> City of Small Gods Terry Pratchett Fan Club -
>>> <http://cityofsmallgods.org.au>http://cityofsmallgods.org.au
>>>
>>> *Nullus Anxietas VI - The Australian Discworld Convention* -
>>> http://ausdwcon.org
>>> "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017
>>>
>>> --
>>> 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
>>

Re: [mezzanine-users] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny
Thanks Ryne, I'll fix my hack as well then :)

On 30 October 2015 at 07:03, Ryne Everett  wrote:

> As I said in the other email, this is easy enough to solve in the
>> template, see
>>
>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>  for
>> how the duplicate SitePermissions was solved.
>
>
> I don't think that's the link you think it is. That patch removes the
> javascript hack (which is what you're referring to as the "solution") but
> turned out to also be the wrong solution and was never merged.
>
> The correct solution to that specific issue turned out to be
> https://github.com/stephenmcd/grappelli-safe/pull/56 and (assuming the
> duplicate field is a tabular inline) upgrading to grappelli-safe master may
> solve this issue as well.
>
> On Thu, Oct 29, 2015 at 3:12 PM, Danny  wrote:
>
>> On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
>>
>> I still see this in the latest dev build. At the bottom of
>> http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile info
>> (i.e. phonenumber and company) appear twice.
>>
>> Hi Chi-Cheong,
>>
>> As I said in the other email, this is easy enough to solve in the
>> template, see
>>
>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>> for how the duplicate SitePermissions was solved.
>>
>> for mine, I just added the following line immediately after that change
>> in my app's copy of templates/admin/base_site.html:
>> $("#id_myprofile-__prefix__-id").parent().remove();
>>
>> My profile module is named 'myprofile' so you'd probably have to use
>> 'userprofile' instead.
>>
>> Hope this helps,
>>
>> Seeya. Danny.
>>
>> See screen capture. This is seen even in the latest dev branch.
>>
>> My user profile module is as follows:
>> AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
>> cat userprofiles/models.py
>> from django.db import models
>> from django.contrib.auth.models import User
>> from django.utils.translation import ugettext as _
>> from phonenumber_field.modelfields import PhoneNumberField
>> from companies.models import Company
>>
>> class UserProfile(models.Model):
>> user = models.OneToOneField(User, unique=True,
>> verbose_name=_('user'), related_name='user_profile')
>> phonenumber = PhoneNumberField(null=True, blank=True)
>> company = models.ForeignKey(Company, null=True)
>>
>> def __unicode__(self):
>> return u'%s %s (%s), %s' % (self.user.first_name,
>> self.user.last_name, self.user.username, self.phonenumber)
>>
>>
>> --
>> 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.
>>
>>
>>
>> --
>> *Danny Sag*
>> Chairperson
>> Round World Events SA, Inc
>> City of Small Gods Terry Pratchett Fan Club -
>> <http://cityofsmallgods.org.au>http://cityofsmallgods.org.au
>>
>> *Nullus Anxietas VI - The Australian Discworld Convention* -
>> http://ausdwcon.org
>> "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017
>>
>> --
>> 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.
>>
>
> --
> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny

On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
I still see this in the latest dev build. At the bottom 
of http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile 
info (i.e. phonenumber and company) appear twice.



Hi Chi-Cheong,

As I said in the other email, this is easy enough to solve in the 
template, see
https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7 
for how the duplicate SitePermissions was solved.


for mine, I just added the following line immediately after that change 
in my app's copy of templates/admin/base_site.html:

$("#id_myprofile-__prefix__-id").parent().remove();

My profile module is named 'myprofile' so you'd probably have to use 
'userprofile' instead.


Hope this helps,

Seeya. Danny.


See screen capture. This is seen even in the latest dev branch.

My user profile module is as follows:
AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
cat userprofiles/models.py
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from phonenumber_field.modelfields import PhoneNumberField
from companies.models import Company

class UserProfile(models.Model):
user = models.OneToOneField(User, unique=True, 
verbose_name=_('user'), related_name='user_profile')

phonenumber = PhoneNumberField(null=True, blank=True)
company = models.ForeignKey(Company, null=True)

def __unicode__(self):
return u'%s %s (%s), %s' % (self.user.first_name, 
self.user.last_name, self.user.username, self.phonenumber)



--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] InterfaceError exception thrown while trying to add new user from admin panel

2015-10-28 Thread Danny

Hi Chi-Cheong,

My site uses AUTH_PROFILE_MODULE (yeah, I know it's deprecated), and 
although I haven't experienced your particular issue, I did notice that
in the Admin pages, editing a User showed the profile fields twice 
(somewhat similar to this issue: 
https://github.com/stephenmcd/mezzanine/issues/1366 )


I ended up solving my issue by copying and modifying the base_site.html 
template similarly to what solved #1366, here:

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

It may be that you may need to do something similar, but I'm really not 
sure.


Hope this helps,

Seeya. Danny.


On 29/10/2015 4:15 PM, Chi-Cheong Weng wrote:

Mezzanine version: 4.0.1

I can consistently reproduce a bug where if AUTH_PROFILE_USER is 
configured, adding a new user from the admin panel will cause 
mezzanine to throw InterfaceError exception. I can sign in a new user 
from the user panel and it works fine. It only throws exception when I 
tried adding a new user from the admin panel.


To reproduce the problem, just download and install the latest 
mezzanine and then add two apps userprofiles and configure 
AUTH_PROFILE_USER=userprofiles.UserProfile


cat userprofiles/models.py

from django.db import models


from django.contrib.auth.models import User

from django.utils.translation import ugettext as _

from phonenumber_field.modelfields import PhoneNumberField


class UserProfile(models.Model):

user = models.OneToOneField(User, unique=True, 
verbose_name=_('user'), related_name='user_profile')


phonenumber = PhoneNumberField(null=True, blank=True)


Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/admin/auth/user/add/

Django Version: 1.8.5
Python Version: 2.7.6
Installed Applications:
(u'mezzanine.boot',
 u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.redirects',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.sitemaps',
 u'mezzanine.conf',
 u'mezzanine.core',
 u'mezzanine.generic',
 u'mezzanine.pages',
 u'mezzanine.blog',
 u'mezzanine.forms',
 u'mezzanine.galleries',
 u'mezzanine.twitter',
 u'mezzanine.accounts',
 u'userprofiles',
 u'filebrowser_safe',
 u'grappelli_safe',
 u'django.contrib.admin',
 u'django.contrib.staticfiles',
 u'django_comments')
Installed Middleware:
(u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'mezzanine.core.request.CurrentRequestMiddleware',
 u'mezzanine.core.middleware.RedirectFallbackMiddleware',
 u'mezzanine.core.middleware.TemplateForDeviceMiddleware',
 u'mezzanine.core.middleware.TemplateForHostMiddleware',
 u'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
 u'mezzanine.core.middleware.SitePermissionMiddleware',
 u'mezzanine.pages.middleware.PageMiddleware')


Traceback:
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  132. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/contrib/admin/options.py" 
in wrapper
  616. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view

  110. response = view_func(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func

  57. response = view_func(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" 
in inner

  233. return view(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper

  34. return bound_func(*args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/views/decorators/debug.py" 
in sensitive_post_parameters_wrapper

  76. return view(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/

Re: [mezzanine-users] Re: registering new settings for templates

2015-10-15 Thread Danny
I suspect Nkansah is referring to this setting:

http://mezzanine.jupo.org/docs/configuration.html#template-accessible-settings

But yes, perhaps TEMPLATE_ACCESSIBLE_SETTINGS should be referenced in the
docs at the point that talks about register_setting()



On 16 October 2015 at 13:03, Ryne Everett  wrote:

> If something is missing please enlighten us. What did you learn?
>
> On Thu, Oct 15, 2015 at 9:28 PM, Nkansah Rexford 
> wrote:
>
>> got it working. Yet another missing piece from the docs.
>>
>> --
>> 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.
>>
>
> --
> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] Changing admin inline to "Orderable"

2015-10-13 Thread Danny

On 14/10/2015 5:26 AM, Neum Schmickrath wrote:
A few years ago I added several inline classes to Cartridge products. 
After upgrading to the latest Mezzanine and Cartridge versions I want 
to be able to use the drag and drop functionality in Orderable to be 
able to set the order of these inlines. Following the example in the 
Forms app I've set it to use the Orderable class and then created the 
database migration to add the _order field to the inline. The arrows 
now show up in the Admin interface and I can drag and drop them just 
like images and other inlines that use Orderable. But when I save the 
product it doesn't do anything. Looking into it further it's apparent 
that's because there are no numbers assigned in the database on the 
_order column. I'm sure this is because these products already exist 
so it's not assigning them order values on save.


I'm wondering what the best way would be to get the initial sort order 
on these inlines? I'm thinking of maybe a custom migration that loops 
through the products and sets the order? Any ideas what the best way 
to approach it would be?




I've added an 'order' field to Product in my fork of Cartridge, but 
never managed to get the drag-and-drop functionality to work, so I ended 
up just making the order field editable on the summary page as an integer.


Sorry I can't help more.

Seeya. Danny.

--
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] IO Error on Upload - Firefox but not Chrome

2015-10-06 Thread Danny
Hi all,

I've got my website set up with Mezzanine 4.0.1 / Django 1.8.4

When I use the admin Media Library to upload files, I get an IO Error on
Firefox, but it works perfectly fine if I use Chrome. So obviously the
problem is my browser, and not the site itself.
Any ideas what could be causing the issue? I'm leaning towards a plugin or
extension, but it's a bugger to track down...

Thanks,

Seeya. Danny.

-- 
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] dj-stripe vs cartridge-stripe

2015-09-17 Thread Danny

On 16/09/2015 4:24 AM, William Dai wrote:

Need some guidance here.

I am thinking to have e-commerce enabled and am wondering whether we 
should go with dj-stripe to get it working with cartridge, or go with 
the built-in cartridge-stripe integration.  which way is the right way 
to go?


I have seen dj-stripe group very active but I have no idea the hidden 
challenges to get payment working fine and secure.


Any comments appreciated.


Hi William,

I haven't used Stripe or cartridge-stripe, but my guess would be that 
cartridge-stripe would be a good place to start. It does look out of 
date, so you may need to fork it and make your own updates.


I've had to create some cartridge integration for payment processors 
from scratch (wrapped around other modules) which wasn't *too* difficult:

https://github.com/molokov/cartridge_braintree  (for Mez 3)
https://github.com/molokov/cartridge-pinpayments (for Mez 4)

However both these payment processors have a nice easy Javascript based 
way to submit Credit Card Info from client to *their* servers without 
the numbers ever passing into plain text on our servers - which makes 
the PCI compliance factors for our servers much simpler. I don't know if 
stripe has such a mechanism.
From that point of view, it was as simple as making sure the HTML/JS 
generated from cartridge's templates & OrderForm matched what was 
expected from the examples on their websites; that and rewriting the 
payment handler (which is easy in Cartridge)


If Stripe has as simple a mechanism, perhaps you can look at my 
cartridge-pinpayments as an example, and wrap dj-stripe in a similar to 
way that I've wrapped django-pinpayments.


Hope this helps,

Seeya. Danny.


--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Re: SECRET_KEY setting must not be empty

2015-09-03 Thread Danny

On 4/09/2015 12:15 PM, James Lewis wrote:
Thankyou everso much, think I've had too many hours at this and my 
brain is working at half pace :-)


I got rid of that error and now I am getting this:

File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 
44, in _setup


self._wrapped = Settings(settings_module)

File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 
113, in __init__


raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")

django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting 
must not be empty.



Do you know what this could be?




It's what it says on the tin: SECRET_KEY must not be empty. Check what 
SECRET_KEY is set to in local_settings.py


If you created your mezzanine project properly, it'd have some 
randomized value. If it's not set, make one up (although I'm sure 
there's a proper way of doing this somewhere...)


Please start a new thread if you have any further issues.

Seeya. Danny.

--
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] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 10:24 AM, James Lewis wrote:
Hi Danny thanks for replying so quickly, I am not sure what the name 
of my form is.  Would I already have an order form within cartridge or 
would I have to build one specifically to work with stripe?




Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet 
you don't know what the name of your form class is?

It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.

As for using Stripe as your payment processor, you'll either have to 
find any existing implementation or write one yourself.


If you're using https://github.com/readevalprint/cartridge-stripe
then you can see that the name of the class is 
"cartridge_stripe.forms.OrderForm" so that would be your reference for 
urls.py,


e.g

from cartridge_stripe.forms import OrderForm

url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
name="shop_checkout", kwargs=dict(form_class=OrderForm)),

Your original email never mentioned what you'd set 
SHOP_CHECKOUT_FORM_CLASS to, so I'd assumed you'd written your own Order 
Form class in your own app

and were doing it that way...

Seeya. Danny.



Many Thanks

James

On Fri, Sep 4, 2015 at 1:23 AM, Danny <mailto:molo...@gmail.com>> wrote:


On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am
getting the following error:



File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in



33.   name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ...
import MyOrderForm" in urls.py?

I'll need some more context.


I am sure it's something silly, but I've checked stackoverflow
and can't find anything?


Many Thanks


James :-)



Seeya. Danny.
-- 
You received this message because you are subscribed to a topic in

the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to mezzanine-users+unsubscr...@googlegroups.com
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.


--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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


--
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] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am getting 
the following error:




File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in 


33. name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ... import 
MyOrderForm" in urls.py?


I'll need some more context.

I am sure it's something silly, but I've checked stackoverflow and 
can't find anything?



Many Thanks


James :-)



Seeya. Danny.

--
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] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-01 Thread Danny

On 2/09/2015 7:19 AM, James Lewis wrote:
I have tried this and it is still not working, I have tried all the 
different urls on this group and I am still getting the same errors. 
 What else do you have to change to stop this error appearing; is 
there not any changes I need to make in forms.py, settings or anything 
else?  Sorry but I am really struggling on this for some reason




Have you removed SHOP_CHECKOUT_FORM_CLASS from your settings.py? The 
urls.py changes *replace* the need for this deprecated setting.


eg. instead of
SHOP_CHECKOUT_FORM_CLASS = "myapp.forms.MyOrderForm"
in settings.py,  you do:

|from myapp.forms import MyOrderForm # ... urlpatterns += patterns('', # 
Use your special OrderForm class url("^shop/checkout/$", 
"cartridge.shop.views.checkout_steps", name="shop_checkout", 
kwargs=dict(form_class=MyOrderForm)), # Cartridge URLs. ("^shop/", 
include("cartridge.shop.urls")), # ... )|


in urls.py

HTH. HAND.

Seeya. Danny.


Thanks

James
On Friday, July 11, 2014 at 6:07:43 PM UTC+1, Tristan Barry wrote:

Good afternoon! I am working on a project where we would like to
use Cartridge for an online store. Out of the box it looks great;
but I'd like to modify the checkout form. Reading through the
documentation it sounded like I could sub-class the OrderForm
class in 'cartridge.shops.forms'. When going through these steps I
saw this message:

"The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please
define your own urlpattern for the checkout_steps view, passing in
your own form_class argument."

But I'm running into problems right off the start. Does this mean
I can just write my own URL pattern for *only* the checkout form?
Something like this?

url("^shop/checkout/$", "myproject.views.checkout_steps", name =
"checkout_steps")
?

Or do I need to remove the cartridge urls pattern:
  url(r"^shop/", include("cartridge.shop.urls")),
and replace it with a modified version of 'cartridge.shop.urls'?
This doesn't seem very DRY?

Can anyone offer any hints on how to get started?  Should the
OrderForm class still be sub-classed to assist with making this
all 'work'? Any help??


--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Re: Basic PostgreSQL installation

2015-08-25 Thread Danny

On 26/08/2015 12:32 AM, Richard Jackson wrote:



3) Within the 'settings.py' file alter the "DATABASES" text to read as 
below:


DATABASES = {

'default': {

'ENGINE': 'django.db.backends.postgresql_psycopg2',

'NAME': 'test_db',

'USER': 'test_user',

'PASSWORD': '',

'HOST': '127.0.0.1',

'PORT': '5432',

}

}



Just to check - is DATABASES being overridden in local_settings.py? 
After all, for Mezzanine, local_settings is usually where you'll define 
the actual database (so you can e.g. use sqlite for dev and postgresql 
for the deployed site via the local_settings template in the deploy 
directory)


Check your project root for 'dev.db' because it's just highly possible 
that the database is being created within sqlite instead of postgresql 
if you haven't updated DATABASES in local_settings.py


Can you see anything obviously incorrect with the above? Is there any 
easy way to actually find what database is being used at present?




python manage.py shell
import settings
settings.DATABASES

Seeya. Danny.

--
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] Re: Advanced tab for image editing missing in Mezzanine 4?

2015-08-17 Thread Danny

On 17/08/2015 3:49 PM, Stephen McDonald wrote:
When we upgraded TinyMCE we decided to forgo the arduous task of 
trying to match the previous configuration feature for feature.


If you want to restore this or anything else that was previously 
there, please submit a PR.


I personally like the simplified options we have with TinyMCE4. Most 
staff users who can edit pages (apart from myself as admin) don't really 
understand a lot of the advanced stuff for website formatting, so having 
a limited set of options as a default is good. Anyone who does have 
sufficiently advanced knowledge can just edit the HTML directly using 
the Source Code button (which is how I do most formatting that is beyond 
the very basic).


Just my opinion, of course.

Seeya. Danny.


On Mon, Aug 17, 2015 at 4:18 PM, Lee H. <mailto:popov.gh...@gmail.com>> wrote:


Well re the "How To" part of my question, it is just a matter of
adding "image_advtab: true," to the tinymce_init.js file copied to
your theme. But I still wonder if this is the intended default for
Mezzanine. Surely most people would prefer the advanced tab on by
default? Also the advanced tab now is still not quite a feature
packed as it was was, so I guess there are some more config
options that need tweaking to add everything else back.

-- 
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
<mailto: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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
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] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Danny

On 29/07/2015 4:53 PM, Bhavani Shankar wrote:
I figured there's a problem in detecting the postgresql database. I 
went to local_settings.py and saw that the user and name of the 
database were set to the project's name. (different from my local 
machine) How can I fix this?


If you're deploying using Fabric and Mezzanine's fabfile, that's 
standard (database name and user are same as project name). You can set 
the database password

in your FABRIC dictionary on your dev machine's local_settings.py.

If you wish to change this, you could edit your project's copy of 
fabfile.py and change the places where it creates the database and its 
user, but you may also
need to ensure the local_settings.py template you use updates DATABASES 
appropriately as well. (in the deploy directory)


Deployment doesn't copy across database contents (and nor should it) 
because generally you want your dev database to be different to production.
If you do want to transfer across the data, read up on the 'dumpdata' 
and 'loaddata' commands (from manage.py/django_admin) and if they fail, 
you can always use Postgresql's own pg_dump / psql commands to copy the 
data across.


Hope this helps.

Seeya. Danny.

--
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] Re: TinyMCE4 - Problems on deployed site

2015-07-24 Thread Danny

On 25/07/2015 1:04 AM, Josh Cartmell wrote:
Hey Danny I'm not too sure what's going on, but is your site actually 
serving from an IP address like 33.33.33.33? Is there some sort of 
mixture of ip and domain[s]?




Hi Josh,

Yes, 33.33.33.33 is the host-accessible IP of my vagrant VM, and it's 
what I've got in ALLOWED_HOSTS (and the nginx.conf file), so I don't 
think it's the IP that's the problem. For vagrant deployment, I'm not 
using a hostname.


Relevant line from my Vagrantfile: config.vm.network "private_network", 
ip: "33.33.33.33"


Seeya. Danny.

On Thu, Jul 23, 2015 at 11:46 PM, Danny <mailto:molo...@gmail.com>> wrote:


Replying to myself again...

I thought I'd try this with a brand new site, using the latest
Mezzanine/Cartridge stuff from master prior to the 4.0.1 release.

BTW... it's still a problem :D

Setup steps:
1. mezzanine-project -a cartridge mez401
2. Edit requirements.txt to be:
git+git://github.com/stephenmcd/grappelli-safe.git
<http://github.com/stephenmcd/grappelli-safe.git>
git+git://github.com/stephenmcd/filebrowser-safe.git
<http://github.com/stephenmcd/filebrowser-safe.git>
git+git://github.com/stephenmcd/mezzanine.git
<http://github.com/stephenmcd/mezzanine.git>
git+git://github.com/stephenmcd/cartridge.git
<http://github.com/stephenmcd/cartridge.git>
3. Edit mez401/settings.py, uncomment the SSLRedirectMiddelware line
4. Edit mez401/local_settings.py, set up FABRIC dictionary to
deploy to my vagrant VM
5. fab all
Hooray, deployment works, and I can visit the site and log in to
admin.
6. Admin->Settings, set Enable SSL to true.

Now, to test the TinyMCE issues:
On Admin side, create a new page, select some text, click the
"Insert/Edit Link" button... nothing happens (no popup)
Upload some pictures to the Media Library

On main site, edit a page using yellow EDIT button, click the
"Insert/Edit Image" button.
Dialog pops up, click browse button (folder/magnifying glass) next
to Source
Next screen pops up saying "Select image to insert" but the rest
of it is blank - I'm not even seeing the Media Library browser here.

Browser debug console has the error message: "Load denied by
X-Frame-Options:
https://33.33.33.33/admin/media-library/browse/?pop=5&type=image
does not permit cross-origin framing. "

Can anyone help please?

Surely this is a standard setup for most websites? (admin, shop
etc under https and the main site not) Can we get this fixed
before the 4.0.1 release?

Thanks,

Seeya. Danny.



On 23 July 2015 at 17:15, Danny mailto:molo...@gmail.com>> wrote:

I'm now convinced that both of my issues are https/SSL related.

The media library image select works under https but not http,
because the Media library browser is under the /admin path
(which is https)
The insert/edit link box relies on displayable_links.js which
is http, so it works through the 'front' side but not under admin.

Has anyone managed to get this working on a site with SSL
enabled for the /admin path?

Seeya. Danny.


On 23/07/2015 1:08 PM, Danny wrote:

Hi all,

I'm hoping someone can either replicate my issue or help me
debug it.

Using Mezzanine master (as of 23/7/15), on my deployed site,
I can't select an image from the Media Library to insert it
into a page when Inserting/Editing an image.
This is editing via the main site's Yellow EDIT buttons, not
on the admin side. (on the Admin side, it works)

i.e. this button:


The javascript error shown in the Firebug console is "Error:
Permission denied to access property "tinymce" on
FB_TinyMCE4.js line 4, col 8

That script is, with line 4 in bold:
var FileBrowserDialogue = {
fileSubmit : function (FileURL) {
parentWin = (!window.frameElement &&
window.dialogArguments) || opener || parent || top;
*tinymce = tinyMCE = parentWin.tinymce;*
self.editor = tinymce.EditorManager.activeEditor;
self.params = self.editor.windowManager.getParams();
parentWin.document.getElementById(self.params.input).value =
FileURL;
self.editor.windowManager.close(parentWin);
}
};

The same actions work perfectly fine when running
development/DEBUG=True.

The other problem that still persists in Mezzanine 4 (and has
been around for a while, even with earlier TinyMCE versions),
is that the Insert/Edit Link dialog does not pop up

[mezzanine-users] Re: TinyMCE4 - Problems on deployed site

2015-07-23 Thread Danny
Replying to myself again...

I thought I'd try this with a brand new site, using the latest
Mezzanine/Cartridge stuff from master prior to the 4.0.1 release.

BTW... it's still a problem :D

Setup steps:
1. mezzanine-project -a cartridge mez401
2. Edit requirements.txt to be:
git+git://github.com/stephenmcd/grappelli-safe.git
git+git://github.com/stephenmcd/filebrowser-safe.git
git+git://github.com/stephenmcd/mezzanine.git
git+git://github.com/stephenmcd/cartridge.git
3. Edit mez401/settings.py, uncomment the SSLRedirectMiddelware line
4. Edit mez401/local_settings.py, set up FABRIC dictionary to deploy to my
vagrant VM
5. fab all
Hooray, deployment works, and I can visit the site and log in to admin.
6. Admin->Settings, set Enable SSL to true.

Now, to test the TinyMCE issues:
On Admin side, create a new page, select some text, click the "Insert/Edit
Link" button... nothing happens (no popup)
Upload some pictures to the Media Library

On main site, edit a page using yellow EDIT button, click the "Insert/Edit
Image" button.
Dialog pops up, click browse button (folder/magnifying glass) next to Source
Next screen pops up saying "Select image to insert" but the rest of it is
blank - I'm not even seeing the Media Library browser here.

Browser debug console has the error message: "Load denied by
X-Frame-Options:
https://33.33.33.33/admin/media-library/browse/?pop=5&type=image does not
permit cross-origin framing. "

Can anyone help please?

Surely this is a standard setup for most websites? (admin, shop etc under
https and the main site not) Can we get this fixed before the 4.0.1 release?

Thanks,

Seeya. Danny.



On 23 July 2015 at 17:15, Danny  wrote:

>  I'm now convinced that both of my issues are https/SSL related.
>
> The media library image select works under https but not http, because the
> Media library browser is under the /admin path (which is https)
> The insert/edit link box relies on displayable_links.js which is http, so
> it works through the 'front' side but not under admin.
>
> Has anyone managed to get this working on a site with SSL enabled for the
> /admin path?
>
> Seeya. Danny.
>
>
> On 23/07/2015 1:08 PM, Danny wrote:
>
> Hi all,
>
> I'm hoping someone can either replicate my issue or help me debug it.
>
> Using Mezzanine master (as of 23/7/15), on my deployed site, I can't
> select an image from the Media Library to insert it into a page when
> Inserting/Editing an image.
> This is editing via the main site's Yellow EDIT buttons, not on the admin
> side. (on the Admin side, it works)
>
> i.e. this button:
>
>
> The javascript error shown in the Firebug console is "Error: Permission
> denied to access property "tinymce" on FB_TinyMCE4.js line 4, col 8
>
> That script is, with line 4 in bold:
> var FileBrowserDialogue = {
> fileSubmit : function (FileURL) {
> parentWin = (!window.frameElement && window.dialogArguments) ||
> opener || parent || top;
> *tinymce = tinyMCE = parentWin.tinymce;*
> self.editor = tinymce.EditorManager.activeEditor;
> self.params = self.editor.windowManager.getParams();
> parentWin.document.getElementById(self.params.input).value =
> FileURL;
> self.editor.windowManager.close(parentWin);
> }
> };
>
> The same actions work perfectly fine when running development/DEBUG=True.
>
> The other problem that still persists in Mezzanine 4 (and has been around
> for a while, even with earlier TinyMCE versions), is that the Insert/Edit
> Link dialog does not pop up if editing a Page on the Admin side - I suspect
> this is because it is behind https/SSL here, and something is going wrong
> there.
>
> The error given in Firebug is "Blocked loading mixed active content
> "http://mydomain.com/displayable_links.js";
> <http://mydomain.com/displayable_links.js>"
> Is there a workaround for loading the Filebrowser/TinyMCE content when
> behind https?
>
> There used to be an issue with the 'asset_proxy' prefix that could be
> solved by substituting the SLL Middleware, but I don't think that's the
> smart thing to do.
>
> These two are possibly the last hurdles I need resolved before upgrading
> my site to Mezzanine 4.
>
> Seeya. Danny.
>
>

-- 
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] Re: TinyMCE4 - Problems on deployed site

2015-07-23 Thread Danny

I'm now convinced that both of my issues are https/SSL related.

The media library image select works under https but not http, because 
the Media library browser is under the /admin path (which is https)
The insert/edit link box relies on displayable_links.js which is http, 
so it works through the 'front' side but not under admin.


Has anyone managed to get this working on a site with SSL enabled for 
the /admin path?


Seeya. Danny.

On 23/07/2015 1:08 PM, Danny wrote:

Hi all,

I'm hoping someone can either replicate my issue or help me debug it.

Using Mezzanine master (as of 23/7/15), on my deployed site, I can't 
select an image from the Media Library to insert it into a page when 
Inserting/Editing an image.
This is editing via the main site's Yellow EDIT buttons, not on the 
admin side. (on the Admin side, it works)


i.e. this button:


The javascript error shown in the Firebug console is "Error: 
Permission denied to access property "tinymce" on FB_TinyMCE4.js line 
4, col 8


That script is, with line 4 in bold:
var FileBrowserDialogue = {
fileSubmit : function (FileURL) {
parentWin = (!window.frameElement && window.dialogArguments) 
|| opener || parent || top;

*tinymce = tinyMCE = parentWin.tinymce;*
self.editor = tinymce.EditorManager.activeEditor;
self.params = self.editor.windowManager.getParams();
parentWin.document.getElementById(self.params.input).value = FileURL;
self.editor.windowManager.close(parentWin);
}
};

The same actions work perfectly fine when running development/DEBUG=True.

The other problem that still persists in Mezzanine 4 (and has been 
around for a while, even with earlier TinyMCE versions), is that the 
Insert/Edit Link dialog does not pop up if editing a Page on the Admin 
side - I suspect this is because it is behind https/SSL here, and 
something is going wrong there.


The error given in Firebug is "Blocked loading mixed active content 
"http://mydomain.com/displayable_links.js"";
Is there a workaround for loading the Filebrowser/TinyMCE content when 
behind https?


There used to be an issue with the 'asset_proxy' prefix that could be 
solved by substituting the SLL Middleware, but I don't think that's 
the smart thing to do.


These two are possibly the last hurdles I need resolved before 
upgrading my site to Mezzanine 4.


Seeya. Danny.

--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - 
http://cityofsmallgods.org.au


*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] TinyMCE4 - Problems on deployed site

2015-07-22 Thread Danny

Hi all,

I'm hoping someone can either replicate my issue or help me debug it.

Using Mezzanine master (as of 23/7/15), on my deployed site, I can't 
select an image from the Media Library to insert it into a page when 
Inserting/Editing an image.
This is editing via the main site's Yellow EDIT buttons, not on the 
admin side. (on the Admin side, it works)


i.e. this button:


The javascript error shown in the Firebug console is "Error: Permission 
denied to access property "tinymce" on FB_TinyMCE4.js line 4, col 8


That script is, with line 4 in bold:
var FileBrowserDialogue = {
fileSubmit : function (FileURL) {
parentWin = (!window.frameElement && window.dialogArguments) || 
opener || parent || top;

*tinymce = tinyMCE = parentWin.tinymce;*
self.editor = tinymce.EditorManager.activeEditor;
self.params = self.editor.windowManager.getParams();
parentWin.document.getElementById(self.params.input).value = FileURL;
self.editor.windowManager.close(parentWin);
}
};

The same actions work perfectly fine when running development/DEBUG=True.

The other problem that still persists in Mezzanine 4 (and has been 
around for a while, even with earlier TinyMCE versions), is that the 
Insert/Edit Link dialog does not pop up if editing a Page on the Admin 
side - I suspect this is because it is behind https/SSL here, and 
something is going wrong there.


The error given in Firebug is "Blocked loading mixed active content 
"http://mydomain.com/displayable_links.js"";
Is there a workaround for loading the Filebrowser/TinyMCE content when 
behind https?


There used to be an issue with the 'asset_proxy' prefix that could be 
solved by substituting the SLL Middleware, but I don't think that's the 
smart thing to do.


These two are possibly the last hurdles I need resolved before upgrading 
my site to Mezzanine 4.


Seeya. Danny.

--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] How to make dynamic content in template?

2015-07-21 Thread Danny
Something like mezzanine-blocks might help you:
https://github.com/renyi/mezzanine-blocks
There are other similar projects out there too, so take a look around and
find one that you like.

Seeya. Danny.

On 22 July 2015 at 13:33, سید محمد رضا طباطبائی <
mohammadreza.tabatab...@gmail.com> wrote:

> hi
> i want create dynamic frame in index.html page and read data from one rich
> text page and manage content page in admin
> how can i do it???
>
> --
> 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.
>

-- 
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] Easy way to grab data from an installed app in the templates

2015-07-15 Thread Danny

On 16/07/2015 7:30 AM, Brandon Keith Biggs wrote:

Hello,
Is there an easy way to create template variables and functions 
without modifying the site urls?

Perhaps in mezzanine_tags or something?
A variable like
{{ mezzanine.my_app.my_variable }}
would be fine.
Is this what page can help with? I want to use these variables in my 
custom theme.

thank you,


I think what you might be looking for is to create your own setting, and 
then use it in a template, right?


http://mezzanine.readthedocs.org/en/latest/configuration.html

Basically:
In your app, create a defaults.py, and use register_setting() to create 
the variable you want.
It can be editable in the admin if you like, or just configurable via 
settings/local_settings.py


Then you'll need to update TEMPLATE_ACCESSIBLE_SETTINGS so that your new 
setting is listed there,

making it accessible within templates.

And then you should be able to just reference {{settings.variable}} in 
any template that has mezzanine_tags loaded.


For example, I have in my app's defaults.py:

register_setting(
name="SOCIAL_FACEBOOK",
description="Link to Facebook Page. Include http prefix.",
editable=True,
default="",
)
register_setting(
name="TEMPLATE_ACCESSIBLE_SETTINGS",
append=True,
default=("SOCIAL_FACEBOOK",),
)

And then in my base.html:

{% load mezzanine_tags ... %}
...
{% if settings.SOCIAL_FACEBOOK %}
Facebook
{% endif %}

So this allows me to add a link to my Facebook page in the admin 
(Settings section) and have that link show up on every page of the site 
via the base.html template.


Seeya. Danny.


--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Mezzanine 4.0 with Cartridge

2015-07-12 Thread Danny
Thanks Stephen.

Wasn't the SHOP_CURRENCY_LOCALE made editable for a reason? Personally I
don't mind either way, but in the 0.9.5. tag it's not editable, but on
master it was, so I'm assuming that was changed for a reason.

Maybe see
https://github.com/stephenmcd/cartridge/commit/79c611bd318ec095073c3b9a729b2bfa7fb4405b#diff-d3220a9516c6f9328cd3c424de02a7ef
for the change?

Mathias, you made this change, want to comment?


Seeya. Danny.

On 13 July 2015 at 15:35, Stephen McDonald  wrote:

> Fixed here:
> https://github.com/stephenmcd/cartridge/commit/c6aa87003d41ee203f5070f6601c81b844047e94
>
> On Mon, Jul 13, 2015 at 2:56 PM, Stephen McDonald  wrote:
>
>> I can confirm this bug - the demo site doesn't hit it as it defines
>> the SHOP_CURRENCY_LOCALE setting in its settings module.
>>
>> On Sat, Jul 11, 2015 at 11:49 AM, Danny  wrote:
>>
>>> Hi all,
>>>
>>> I was wondering if anyone could help me!
>>>
>>> I've tried the new Mezzanine 4.0 release with cartridge master (which
>>> Stephen said should work) and am getting AppRegistryNotReady exception from
>>> shop.models.Priced():
>>>
>>> BACKTRACE:
>>> 
>>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
>>> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
>>> requires. Will fall back to the domains configured as sites.
>>>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
>>> RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
>>> and will be removed in Django 1.9. Its contents have been moved to the
>>> fields, forms, and admin submodules of django.contrib.contenttypes.
>>>   from django.contrib.contenttypes.generic import GenericRelation
>>>
>>> Traceback (most recent call last):
>>>   File "manage.py", line 14, in 
>>> execute_from_command_line(sys.argv)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 338, in execute_from_command_line
>>> utility.execute()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 312, in execute
>>> django.setup()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
>>> line 18, in setup
>>> apps.populate(settings.INSTALLED_APPS)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
>>> line 108, in populate
>>> app_config.import_models(all_models)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
>>> line 198, in import_models
>>> self.models_module = import_module(models_module_name)
>>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>>> import_module
>>> __import__(name)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>>> line 35, in 
>>> class Priced(models.Model):
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>>> line 41, in Priced
>>> unit_price = fields.MoneyField(_("Unit price"))
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
>>> line 46, in __init__
>>> set_locale()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
>>> 103, in set_locale
>>> currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>>> line 236, in __getattr__
>>> editable_cache = self._get_editable(request=self._current_request)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>>> line 152, in _get_editable
>>> editable_settings = self._editable_caches[request] = self._load()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/m

[mezzanine-users] Mezzanine 4.0 with Cartridge

2015-07-10 Thread Danny

Hi all,

I was wondering if anyone could help me!

I've tried the new Mezzanine 4.0 release with cartridge master (which 
Stephen said should work) and am getting AppRegistryNotReady exception 
from shop.models.Priced():


BACKTRACE:

/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51: 
UserWarning: You haven't defined the ALLOWED_HOSTS settings, which 
Django requires. Will fall back to the domains configured as sites.

  warn("You haven't defined the ALLOWED_HOSTS settings, which "
/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6: 
RemovedInDjango19Warning: django.contrib.contenttypes.generic is 
deprecated and will be removed in Django 1.9. Its contents have been 
moved to the fields, forms, and admin submodules of 
django.contrib.contenttypes.

  from django.contrib.contenttypes.generic import GenericRelation

Traceback (most recent call last):
  File "manage.py", line 14, in 
execute_from_command_line(sys.argv)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 338, in execute_from_command_line

utility.execute()
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 312, in execute

django.setup()
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py", 
line 18, in setup

apps.populate(settings.INSTALLED_APPS)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py", 
line 108, in populate

app_config.import_models(all_models)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py", 
line 198, in import_models

self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
import_module

__import__(name)
  File 
"/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py", 
line 35, in 

class Priced(models.Model):
  File 
"/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py", 
line 41, in Priced

unit_price = fields.MoneyField(_("Unit price"))
  File 
"/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py", 
line 46, in __init__

set_locale()
  File 
"/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", 
line 103, in set_locale

currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py", 
line 236, in __getattr__

editable_cache = self._get_editable(request=self._current_request)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py", 
line 152, in _get_editable

editable_settings = self._editable_caches[request] = self._load()
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py", 
line 191, in _load

for setting_obj in Setting.objects.all():
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/manager.py", 
line 228, in all

return self.get_queryset()
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/core/managers.py", 
line 349, in get_queryset

return super(DjangoCSM, self).get_queryset().filter(**lookup)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py", 
line 679, in filter

return self._filter_or_exclude(False, *args, **kwargs)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py", 
line 697, in _filter_or_exclude

clone.query.add_q(Q(*args, **kwargs))
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py", 
line 1309, in add_q

clause, require_inner = self._add_q(where_part, self.used_aliases)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py", 
line 1337, in _add_q

allow_joins=allow_joins, split_subq=split_subq,
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py", 
line 1149, in build_filter

lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py", 
line 1035, in solve_lookup_type
_, field, _, lookup_parts = self.names_to_path(lookup_splitted, 
self.get_meta())
  File 
"/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py", 
l

Re: [mezzanine-users] creating projects with latest build

2015-07-09 Thread Danny
If you look in
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/management/commands/createdb.py
You'll see it should create the default admin user as 'admin' with password
'default'.

Try to log in to the admin side with that.

Although, I would have thought that unless you specified --noinput it would
have prompted you for this sort of information... maybe that's changed.

Seeya. Danny.

On 10 July 2015 at 12:28, Brandon Keith Biggs 
wrote:

>  Hello,
> I just created a project with the latest build and I did not get asked to
> create a super-user. There are also no setting files in my project. I did:
> mezzanine-project project1
> cd project1
> python manage.py createdb
> python manage.py runserver
>
> and my site went up perfectly, but no super-user was set.
> thanks,
>
> --
> Brandon Keith Biggs <http://www.brandonkeithbiggs.com/>
>
> --
> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] Mezzanine 4.0 is released

2015-07-09 Thread Danny
On 10 July 2015 at 10:27, Stephen McDonald  wrote:

>
>
>
> On Fri, Jul 10, 2015 at 9:40 AM, Danny  wrote:
>
>> On 10 July 2015 at 08:34, Stephen McDonald  wrote:
>>
>>> Hi all,
>>>
>>> The new 4.0 release of Mezzanine is finally up on PyPI after 10 months
>>> since the last release - a lot has happened! The project site (
>>> mezzanine.jupo.org) hasn't been upgraded yet, that will happen shortly.
>>>
>>
>>
>> Congratulations to Stephen and all contributors! I look forward to
>> upgrading soon![1]
>>
>> Seeya. Danny.
>> [1] My site relies on Cartridge, so I'm going to wait until that's
>> brought up to date as well, I know it can't be far behind.
>>
>
> You should be good to go using the dev branch of Cartridge - the only work
> left to do with it is bring it up to date when creating new projects, which
> presumably doesn't affect you. I've just deployed latest Mezzanine +
> Cartridge dev branch plus Django 1.8 to the project site and it works.
>
>
Thanks, I'll give it a shot this weekend.

Seeya. Danny.

-- 
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] Mezzanine 4.0 is released

2015-07-09 Thread Danny
On 10 July 2015 at 08:34, Stephen McDonald  wrote:

> Hi all,
>
> The new 4.0 release of Mezzanine is finally up on PyPI after 10 months
> since the last release - a lot has happened! The project site (
> mezzanine.jupo.org) hasn't been upgraded yet, that will happen shortly.
>


Congratulations to Stephen and all contributors! I look forward to
upgrading soon![1]

Seeya. Danny.
[1] My site relies on Cartridge, so I'm going to wait until that's brought
up to date as well, I know it can't be far behind.

-- 
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] Re: Trouble with django version

2015-06-22 Thread Danny

On 20/06/2015 5:11 PM, Mathias Ettinger wrote:
To complete my previous answer you can specify the commit you wish to 
use to pip instead of HEAD/master


Cartridge was still compatible with mezzanine before the merge of PR 
#1265 and will be as soon as we report the changes back to it.


Just use a commit number that is before this merge (for instance the 
one I gave you previously) and you will have compatibility:


pip install -e 
git+https://github.com/stephenmcd/mezzanine.git@#egg=Mezzanine 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fstephenmcd%2Fmezzanine.git%23egg%3DMezzanine-master&sa=D&sntz=1&usg=AFQjCNHCsSEd9DN-Hl0kGx_jPQbE_KD2Eg>
pip install -e 
git+https://github.com/stephenmcd/cartridge.git#egg=Cartridge 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fstephenmcd%2Fmezzanine.git%23egg%3DMezzanine-master&sa=D&sntz=1&usg=AFQjCNHCsSEd9DN-Hl0kGx_jPQbE_KD2Eg>




This is definitely the way to go. I have the following line in my 
requirements.txt and am using it with cartridge[1] without any issues 
against Django 1.8.2


-e 
git+https://github.com/stephenmcd/mezzanine.git@23c1375fc4b8de400a75a4a0d1ec19e941164d76#egg=Mezzanine



Seeya. Danny.
[1] I'm working with my own fork of cartridge, my last merge from 
stephenmcd/master was 7178e4f8825e2e83bd34369beb7f9b646f476439






Le samedi 20 juin 2015 08:42:27 UTC+2, Aman Garg a écrit :

As I mentioned earlier, the problem is that when using the
development version, I am unable to install cartridge for that
version. It seems cartridge is only compatible presently with the
release version.

On Saturday, 20 June 2015 02:38:43 UTC+5:30, Mathias Ettinger wrote:

By the time cartridge gets updated as well, you could try
using a compatible version of mezzanine. Like

https://github.com/stephenmcd/mezzanine/tree/a0df8300ed943fdae89b6f517f8ad54986ac9afd

<https://github.com/stephenmcd/mezzanine/tree/a0df8300ed943fdae89b6f517f8ad54986ac9afd>

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Search URL

2015-06-13 Thread Danny

On 14/06/2015 3:31 AM, automotive...@gmail.com wrote:

Trying to figure out how to change the url for the search results page.

I see
|
Been searching thru docs and can't seem to find what I need to do 
that, can someone point in the right direction?


The URL 'search' is defined here:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/urls.py#L24

which uses the view named search defined here:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/views.py#L106

Which uses a template called search_results.html

I suspect if you look through that function you can probably work out 
how it's changing the URL in your browser,
and if you want to change it, you may need to copy and rename the 
template, and then override the url to pass in your template name instead.


HTH. HAND.

Seeya. Danny.

--
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] postgres content/data syncing between development & production

2015-06-09 Thread Danny

On 9/06/2015 11:47 PM, Ken Bolton wrote:

Hi Vikraw,

Sorry if I added to the confusion.

Mezzanine does not move content for you. The commands I pointed out 
can be interpreted and extrapolated into normal command-line commands 
to do database backup and restore. Moving the backups is an exercise 
left up to the reader.



Hi Vikraw,

If you want to dump the database straight from postgresql on your local 
development server, you can run pg_dump or pg_dumpall there, (and then 
psql on the deployed server), but it's mostly designed to do an entire 
database or *all* databases.


The other alternative would be to use python manage.py dumpdata on your 
dev server and the loaddata equivalent on the deployed server - check 
the help for dumpdata to see how to dump just the tables for one app, or 
even one table itself.


(e.g. you'll want to dump and load shop.products but probably not 
shop.orders)


I found this site quite useful for a few different dumpdata/loaddata 
options:

https://coderwall.com/p/mvsoyg/django-dumpdata-and-loaddata

Seeya. Danny.



hth.

ken

On Tue, Jun 9, 2015 at 10:07 AM, vikraw <mailto:vik...@gmail.com>> wrote:


So, what i understand is that both backup and restore tasks are
run on the Depoyment/remote machine.
when i do - fab deploy
  backup is taken (last.db) before any other tasks.
  restore is never called for task deploy

South "schema" migrations are added to the directories in apps.
these are uploaded to github and applied to remote machine. then a
migrate command is run.

But i am still confused how does the local database changes
(adding new products) are applied to remote database? Is this also
taken care by South (data migration..)..
Because for me whenever i add a new page Or a product it never
appears on the remote machine unless I copy my local database to
remote manually

Not sure what is not working for me.. Is it South migrations or
another issues.
-- 
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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.


--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
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] Re: No such table error

2015-05-31 Thread Danny
Have you run 'python manage.py makemigrations theme' to create the
migrations for your app in the first place?
Do this before running 'python manage.py migrate theme'.

Hope this helps.

On 1 June 2015 at 08:40, Jean de la Croix Ki  wrote:

> I've taken a look in my database and saw that there isn't the table
> inside. Be sure, I've executed syncdb and I've done the migrations as
> recommended with south so I don't understand why the table is not there...
> Thanks for your help.
>
>
> On Sunday, 31 May 2015 21:03:53 UTC, Jean de la Croix Ki wrote:
>>
>> Hi group, I need your help to solve the next error. I don't understand
>> what is happenning... First, here is what looks my modelclass
>> Chambre(models.Model):categorie =
>> models.CharField(max_length=255, help_text="")nombre =
>> models.IntegerField()
>>
>> and second, the error I get:
>>
>> OperationalError at /admin/theme/chambre/
>>
>> no such table: theme_chambre
>>
>> Request Method:GETRequest 
>> URL:http://127.0.0.1:8000/admin/theme/chambre/Django
>> Version:1.6.7Exception Type:OperationalErrorException Value:
>>
>> no such table: theme_chambre
>>
>> Exception 
>> Location:/usr/lib64/python3.3/site-packages/django/db/backends/sqlite3/base.py
>> in execute, line 452Python Executable:/usr/bin/python3Python Version:
>> 3.3.2Python Path:
>>
>> ['/home/jea/Sites/ibahotel',
>>  '/usr/lib/python3.3/site-packages/setuptools-5.7-py3.3.egg',
>>  '/usr/lib/python3.3/site-packages/pip-1.5.6-py3.3.egg',
>>  '/usr/lib64/python33.zip',
>>  '/usr/lib64/python3.3',
>>  '/usr/lib64/python3.3/plat-linux',
>>  '/usr/lib64/python3.3/lib-dynload',
>>  '/usr/lib64/python3.3/site-packages',
>>  '/usr/lib/python3.3/site-packages',
>>  '/home/jea/Sites']
>>
>>
>>
>>  --
> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to add u'domain.com'

2015-05-30 Thread Danny

On 31/05/2015 1:34 PM, vikraw wrote:
I know there exists a similar post/thread before and I have posted 
there also, but I didn't see any solutions to stop getting those 
messages. I am getting around 20-30 such emails in a day





I am getting the errors for my server's IP address
 Invalid HTTP_HOST header: 'x.x.x.x'. You may need to add u'x.x.x.x' 
to ALLOWED_HOSTS.


BUT also for  so many suspicious names like this
- Invalid HTTP_HOST header: '4331780'.You may need to add u'4331780' 
to ALLOWED_HOSTS.
-  Invalid HTTP_HOST header: 'testp1.piwo.pila.pl'.You may need to add 
u'testp1.piwo.pila.pl' to ALLOWED_HOSTS.
-  Invalid HTTP_HOST header: 'www.cloud.ph'.You may need to add 
u'www.cloud.ph' to ALLOWED_HOSTS


All of them say the following

No stack trace available
Request repr() unavailable.


These emails are generally rather unhelpful, especially because of the 
lack of back trace - which means you don't really know which URL was 
used that caused the error (prior to Django 1.6, I would see the 
backtrace and it appeared that it was bots attempting to access, e.g. 
admin.php which don't exist on a Django server).


If you're happy to just ignore them, you can get nginx to do that for 
you so that the requests don't even hit Django/Mezzanine.


I put the following in my nginx configuration file and haven't received 
an email like that since:


# deny illegal host headers

if ($host !~* ^mydomain.com$ ) {

return 444;

}

Of course, you'll need to update this based on the domains you do want 
to allow.

See e.g. http://stackoverflow.com/a/17477436/653093

Seeya. Danny.

--
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] Price Rounding Off Issues

2015-05-24 Thread Danny
s 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
<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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] a page summary with a link to the whole page

2015-05-22 Thread Danny

On 23/05/2015 9:12 AM, Jean de la Croix Ki wrote:

Hi group;
I want to know how is it possible to create page and just put it 
summary and a link to it on my home page. How to achieve this ?




My home page shows some of the summaries of the blog posts on the front 
page - you could probably do this in your template
for other pages as well. The key thing, I think,  is the 
'truncatewords_html' filter that Django provides, it allows you show a 
short snippet from another page/other content.


In my index.html template:

{% block main %}

{% blog_recent_posts 3 as recent_posts %}
{% if recent_posts %}

Latest News
{% for blog_post in recent_posts %}

{{ blog_post.title }}


{% trans "Posted by" %}: {% with blog_post.user as author %} href="{% url "blog_post_list_author" author %}">{{ 
author.get_full_name|default:author.username }} {% endwith %}
{% blocktrans with sometime=blog_post.publish_date|timesince %}{{ 
sometime }} ago{% endblocktrans %}



{{ blog_post.content|safe|truncatewords_html:100 }}

{% trans "read more" %}


{% endfor %}
Read more news

{% endif %}

{% endblock %}

Hope this helps!

Seeya. Danny.

--
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] The Orderable "move" buttons

2015-05-14 Thread Danny
On 15 May 2015 at 09:49, Stephen McDonald  wrote:

>
>
>
> That is a problem - the admin support is only designed for inlines.
>
> I think there was a thread on here just the other day about a third party
> lib for top-level ordering.
>

Think I found it, Eduardo mentioned django-admin-sortable.

https://github.com/iambrandontaylor/django-admin-sortable

I'll have a look how that one works.

Seeya. Danny.

-- 
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] The Orderable "move" buttons

2015-05-14 Thread Danny
On 15 May 2015 at 09:21, Stephen McDonald  wrote:

>
>
> On Fri, May 15, 2015 at 7:45 AM, Danny  wrote:
>
>> Hi all,
>>
>> I'm doing a new development using Mezzanine master and Django 1.8.1, and
>> I've got a model that derives from Orderable,
>> with appropriate admin stuff set up for it too.
>>
>> In Mezzanine 3.1.10, the "_order" field was just an integer, so it was
>> easy to edit, but with the latest mezzanine, it's now been replaced with
>> the wonderful drag-and-drop arrows. Except, for my new model, they don't
>> drag and drop!
>>
>
> These have always been drag/drop - the previous behaviour you've seen was
> a bug. Likely candidate is JavaScript not being hosted correctly. Anyway
> you're now seeing what should have always worked :-)
>

Yeah, I realised that - but the bug earlier made it easy to modify the
order :D


>
>
>>
>> Is there something I'm missing with respect to admin setup, or
>> templates/css/js that I need to add so that the new model has the same
>> drag/drop functionality as e.g. pages or the inlines for form fields?
>>
>
> Take a look at the models and admin classes in mezzanine.forms that makes
> full use of this, particularly the admin class for your inlines:
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/admin.py#L38
>


I think the problem I'm facing is that the Orderable object is a top-level
model, not something that's inlined within another model - so it doesn't
need the "Add another" part that the Tabular/Stacked Inline Admin templates
provide, nor do I need to do the re-ordering within another model.

It's probably more akin to Pages, but without the need for the nested
hierarchy. I've a feeling I may need to create a new template/javascript
that behaves like the inline ordering js, but works on items that are not
inlines. I'll do some more investigation.

Seeya. Danny.


>
>>
>> I did have a look at, e.g.
>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/dynamic_inline.js#L43
>> but am not sure if there's something subtle I'm missing that I need to do
>> to make it work.
>> Is it possible I need to install grapelli_safe from github master as
>> well? (I haven't done that yet, just using what's on PyPi)
>>
>> Thanks,
>>
>> Seeya. Danny.
>>
>> --
>> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] The Orderable "move" buttons

2015-05-14 Thread Danny

Hi all,

I'm doing a new development using Mezzanine master and Django 1.8.1, and 
I've got a model that derives from Orderable,

with appropriate admin stuff set up for it too.

In Mezzanine 3.1.10, the "_order" field was just an integer, so it was 
easy to edit, but with the latest mezzanine, it's now been replaced with 
the wonderful drag-and-drop arrows. Except, for my new model, they don't 
drag and drop!


Is there something I'm missing with respect to admin setup, or 
templates/css/js that I need to add so that the new model has the same 
drag/drop functionality as e.g. pages or the inlines for form fields?


I did have a look at, e.g. 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/dynamic_inline.js#L43 
but am not sure if there's something subtle I'm missing that I need to 
do to make it work.
Is it possible I need to install grapelli_safe from github master as 
well? (I haven't done that yet, just using what's on PyPi)


Thanks,

Seeya. Danny.

--
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] New app: cartridge_pinpayments

2015-04-02 Thread Danny

Hi all,

I'd like to announce my new app for Mezzanine/Cartridge - 
cartridge_pinpayments, available at


https://github.com/molokov/cartridge-pinpayments

This is a payment processor for cartridge working with PIN payments, an 
Australian payment company at http://pin.net.au


As this is my first real attempt at making a Django app, I'd love for 
some feedback, or for people to test it out and let me know any issues.
I've not actually used it with a "live" PIN account yet, only the test 
one, but it seems to be working reasonably well in my case.


NOTE: I tried just doing the pip install of my app into a new virtual 
env, and it installed Django 1.8 rather than Django 1.6.11 (which 
mezzanine 3.1.10 installs). Any pointers as to what I've stuffed up in 
my setup.py here? I don't have django as a direct dependency, just 
mezzanine, cartridge and django-pinpayments...


Seeya. Danny.


--
Email: molo...@gmail.com

--
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] File Uploader Not Visible (403 Forbidden)

2015-04-02 Thread Danny

Hi Pushkar,

Do you have the Flash plugin installed for your browser?
https://get.adobe.com/flashplayer/

Seeya. Danny.


On 2/04/2015 5:19 PM, Pushkar Paranjpe wrote:

Production Environment: Hostgator, Shared

Trying to add a Featured Image to a Blog post. The SWF uploader UI 
element itself is not visible.


Getting the following error in the browser console:
http://<...domain...>/asset_proxy/?u=http://<...domain...>/static/filebrowser/uploadify/uploadify.swf

  * Was working fine on the development server.
  * I have ran collectstatic and confirmed that the uploadify.swf file
exists at an accessible path on the server.
  * Accessing
http://<...domain...>/static/filebrowser/uploadify/uploadify.swf
itself directly loads the uploader UI fine without any 403 error.
  * Accessing http://<...domain...>/asset_proxy/ alone does not give a
403 either
  * Other static assets like PNG images, CSS and JS are being accessed
without any issues

Screenshot :

<https://lh3.googleusercontent.com/-p1r-QsppUn4/VRzl_6QnitI/CEU/VfEfIh_T158/s1600/Missing%2Buplloadify.swf_403_error.png>

Please suggest a fix.

Cheers!
Pushkar

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

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



--
Email: molo...@gmail.com

--
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] Filetypes for Media Library

2015-03-25 Thread Danny
Thanks Josh, super helpful :D Works like a charm - the name of the 
settings to put in my own settings.py are FILEBROWSER_EXTENSIONS and 
FILEBROWSER_SELECT_FORMATS but that was fairly obvious from the code you 
pointed to.


I find it somewhat curious that, for, e.g. the Media Library upload, the 
file dialog shows a concatenation of all the EXTENSIONS available 
(rather than just say "All Files"), whereas if you choose to upload an 
image for a product, it actually gives "All Files" rather than 
restricting it to images...


Haven't tried the Gallery, but given your pointer to the code, I'd 
assume there it's restricted to Images...


Seeya. Danny.

On 26/03/2015 12:53 AM, Josh Cartmell wrote:

Hi Danny, they are defined here:
https://github.com/stephenmcd/filebrowser-safe/blob/master/filebrowser_safe/settings.py#L43

You can override either EXTENSIONS or SELECT_FORMATS or both in your
projects settings.py file.  The SELECT_FORMS are what filebrowser uses
to determine what are valid extensions for a particular FileField.  For
example, in Mezzanine's galleries,
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/galleries/models.py#L120,
the format of the image FileField is set to Image.

Good luck!

On Wed, Mar 25, 2015 at 2:34 AM, Danny mailto:molo...@gmail.com>> wrote:

Hi all,

Probably a very simple question, but where are the filetypes for the
Media Library defined, and can I override them?

If I go into my Media Library, and choose to Upload a file, the file
browser window I'm presented with has the following options:

*.html; *.py; *.js; *.css; *.jpg; *.jpeg; ... and several more

However, some useful ones are missing (like MS Word's docx) and
even this selected list fails to show up PDFs in my current
directory even though *.pdf is one of the options (I suspect it's
too long for Windows liking).

The other bad thing is that the file type drop down doesn't have the
"All Files (*.*)" option that you may be used to seeing.

I'm sure that there would be a nice easy setting somewhere that controls
this, the question is: where is it?

Thanks,

Seeya. Danny.

--
Email: molo...@gmail.com <mailto:molo...@gmail.com>

--
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+unsubscribe@__googlegroups.com
<mailto:mezzanine-users%2bunsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/__optout
<https://groups.google.com/d/optout>.


--
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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@gmail.com

--
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] Filetypes for Media Library

2015-03-24 Thread Danny

Hi all,

Probably a very simple question, but where are the filetypes for the 
Media Library defined, and can I override them?


If I go into my Media Library, and choose to Upload a file, the file 
browser window I'm presented with has the following options:


*.html; *.py; *.js; *.css; *.jpg; *.jpeg; ... and several more

However, some useful ones are missing (like MS Word's docx) and
even this selected list fails to show up PDFs in my current directory 
even though *.pdf is one of the options (I suspect it's too long for 
Windows liking).


The other bad thing is that the file type drop down doesn't have the 
"All Files (*.*)" option that you may be used to seeing.


I'm sure that there would be a nice easy setting somewhere that controls
this, the question is: where is it?

Thanks,

Seeya. Danny.

--
Email: molo...@gmail.com

--
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] How to hide product unavailable for purchase on the web page?

2015-02-04 Thread Danny

On 5/02/2015 4:27 PM, Wesley wrote:

Hi guys,
   I have a question that,how to hide product with unavailable for
purchase on the page?

I see that, it's showing on the page, but only says no in stock when
click into the detail product page.

So, how to directly make it hidden from product list on the page?

I tried to select "draft" or even make it out-of-date, but get the same
behavior.



Draft is the way to go - only admin users will see it then.

Log out of your account (or view your site in a different browser) and 
you'll notice that the product isn't listed.


Seeya. Danny.


--
Email: molo...@gmail.com

--
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] TabularDynamicInlineAdmin and Orderable

2015-01-23 Thread Danny
Try putting Orderable as the first baseclass, I think that's what's 
worked for me in past.


On 24/01/2015 8:25 AM, Sam Kingston wrote:

Hi guys,

Should TabularDynamicInlineAdmin allow ordering on an inline class whose
model subclasses Orderable?

For instance, *admin.py*:

from mezzanine.core.admin import TabularDynamicInlineAdmin

from .models import Card

class CardInlineAdmin(TabularDynamicInlineAdmin):
 model = Card.pages.through

from mezzanine.pages.admin import PageAdmin
PageAdmin.inlines += (CardInlineAdmin,)

*models.py*:

class Card(Displayable, RichText, Orderable):
 pages = models.ManyToManyField(Page)

 class Meta:
 ...

This yields the correct Tabular inline on the PageAdmin model, but
doesn't let me drag'n'drop to order.

Am I going about this the wrong way?

Thanks

Sam

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




--
Email: molo...@gmail.com

--
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] Re: PyCharm Unable to Install Mezzanine

2014-10-28 Thread Danny

On 29/10/2014 6:53 AM, chuck wrote:

I also ran into an error. Below is the 'dump' from my attempt.  Would know
to know to get around this.

Install packages failed: Error occurred when installing package Mezzanine.






 building 'PIL._imaging' extension


It seems to fall over when building PIL/pillow, as the traceback shows.

The actual ValueError is being thrown from within the distutils there,
when it's looking for the MSVC compiler, trying to find a vcvarsall.bat 
to run.


Do you have Microsoft Visual C++ installed? If not, download the Express
version (I guess 2012 or 2013, whatever's the latest) and install it
and see if you can install pillow first, before trying for Mezzanine.

I've not tried running Mezzanine on Windows before, but it's probably 
possible (it's much easier on Linux, however).


It might be that pillow doesn't build with the latest MSVC++ which might 
mean you need to find an older version (like 2010), which is a bit

trickier to find via Microsoft's website.

Hope this helps.

Seeya. Danny.



 Traceback (most recent call last):
   File "", line 1, in 
   File "C:\Users\cmedcoff\AppData\Local\Temp\pycharm-
packaging2251339524416707976.tmp\pillow\setup.py", line 757, in 
 zip_safe=True,
   File "C:\Python27\Lib\distutils\core.py", line 151, in setup
 dist.run_commands()
   File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
 self.run_command(cmd)
   File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
 cmd_obj.run()
   File "C:\Users\cmedcoff\MezzVE\lib\site-
packages\setuptools\command\install.py", line 53, in run
 return _install.run(self)
   File "C:\Python27\Lib\distutils\command\install.py", line 563, in run
 self.run_command('build')
   File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
 self.distribution.run_command(command)
   File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
 cmd_obj.run()
   File "C:\Python27\Lib\distutils\command\build.py", line 127, in run
 self.run_command(cmd_name)
   File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
 self.distribution.run_command(command)
   File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
 cmd_obj.run()
   File "C:\Python27\Lib\distutils\command\build_ext.py", line 337, in
run
 self.build_extensions()
   File "C:\Users\cmedcoff\AppData\Local\Temp\pycharm-
packaging2251339524416707976.tmp\pillow\setup.py", line 613, in
build_extensions
 build_ext.build_extensions(self)
   File "C:\Python27\Lib\distutils\command\build_ext.py", line 446, in
build_extensions
 self.build_extension(ext)
   File "C:\Python27\Lib\distutils\command\build_ext.py", line 496, in
build_extension
 depends=ext.depends)
   File "C:\Python27\Lib\distutils\msvc9compiler.py", line 473, in
compile
 self.initialize()
   File "C:\Python27\Lib\distutils\msvc9compiler.py", line 383, in
initialize
 vc_env = query_vcvarsall(VERSION, plat_spec)
   File "C:\Python27\Lib\distutils\msvc9compiler.py", line 299, in
query_vcvarsall
 raise ValueError(str(list(result.keys(
 ValueError: [u'path']



--
Email: molo...@gmail.com

--
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] User's choice of shipping method in cartridge

2014-10-23 Thread Danny S
Thanks for this Josh.

I managed to get an implementation working using the ideas you have 
suggested.

Seeya. Danny.

On Thursday, 9 October 2014 01:11:55 UTC+10:30, Josh Cartmell wrote:
>
> Hey Danny, I don't have code available that I could let you look at right 
> now, but I have done something similar.
>
> To do this I made a custom order form for Cartridge using the setting 
> SHOP_CHECKOUT_FORM_CLASS.
>
> Make it inherit from the default OrderForm and then add a field allowing 
> the user to select a shipping method:
>
> from cartridge.shop.forms import OrderForm
>
> class CustomOrderForm(OrderForm):
> shipping_method = forms.ChoiceField(choices=SHIPPING_CHOICES)
>
> The following will assume you have the checkout steps split.
>
>
>1. In your shipping handler calculate the cost of each shipping 
>method, at that point I would store it in the session, since the user 
>hasn't selected a shipping method yet, don't set the shipping.
>2. In the init for your Custom order form check if you are on the 
>payment step and if the session data that is stored by the shipping 
>handler, is present, if so update the choices for shipping method to have 
>their associated costs.
>At this point I would probably delete the data from the session in 
>case the user later goes back in the checkout process and changes their 
>address.
>3. Display the shipping method select on the payment screen.
>4. In the payment handler do the normal payment stuff, but also call 
>the Cartridge set_shipping method
>^ that's not exactly what you are supposed to do, but I don't think 
>there is anything preventing you from calling set_shipping not in the 
>shipping handler.
>
> In my case, I didn't have the checkout steps split and didn't precalculate 
> the shipping costs, I just let the user see the shipping cost on order 
> confirm page but I think the above should work to do what you want.
>
> On Tue, Oct 7, 2014 at 6:19 PM, Danny S > 
> wrote:
>
>> Hi,
>>
>> I was just wondering if anyone has previously implemented an add-on to 
>> cartridge which allows a user to select the shipping method?
>>
>> I know that with a billship_handler I could use a shipping address to 
>> determine the available types of shipping and their costs, but what if 
>> there's a choice of more than one?
>> e.g Pick up (free), basic ($X), express ($Y).
>>
>> Ideally, after the user has completed their address info, they would be 
>> presented with a dropdown to choose their preferred shipping method, and 
>> then that gets added to the cart total
>> before moving to the payment step of checkout.
>>
>> If anyone has done something similar, is it possible for me to take a 
>> look at your code?
>>
>> Thanks,
>>
>> Seeya. Danny.
>>
>> -- 
>> 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.
>>
>
>

-- 
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] User's choice of shipping method in cartridge

2014-10-07 Thread Danny S
Hi,

I was just wondering if anyone has previously implemented an add-on to 
cartridge which allows a user to select the shipping method?

I know that with a billship_handler I could use a shipping address to 
determine the available types of shipping and their costs, but what if 
there's a choice of more than one?
e.g Pick up (free), basic ($X), express ($Y).

Ideally, after the user has completed their address info, they would be 
presented with a dropdown to choose their preferred shipping method, and 
then that gets added to the cart total
before moving to the payment step of checkout.

If anyone has done something similar, is it possible for me to take a look 
at your code?

Thanks,

Seeya. Danny.

-- 
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] Customize product category theme

2014-09-23 Thread Danny

On 23/09/2014 9:01 PM, Ken Bolton wrote:

Hi Wesley,

In general, developers should avoid making changes directly to the
stack, whether it is Cartridge, Mezzanine, Django, or Python. Instead,
changes are made in files that are isolated from the primary stack. This
allows the developer to arbitrarily upgrade parts of the stack without
losing changes tey have made.

Your question is ultimately not at all about Cartridge or Mezzanine, but
Django templates. If you have not already done so, I urge you to
complete the official Django tutorial. The Django documentation is
excellent and should be your primary source for information on Mezzanine
and Cartridge.

best,
ken



I'll echo Ken - what you're asking to do can easily be done by changing 
the HTML/CSS/JS templates, and that can be done without having to change
any of Django/Mezzanine/Cartridge code directly - you can override 
templates locally in your own app, and the Django tutorials will teach 
you how.


Seeya. Danny.



On Tue, Sep 23, 2014 at 6:58 AM, Wesley mailto:nisp...@gmail.com>> wrote:

Hi guys,
I have one question that how to easily customize Cartridge
product category format, with least change to Cartridge code.

Currently I see that the product category is arranged horizontal on
top of each product page, and when click on the category, it enters
to the page with all the sub-categories listed again on top of page,
so, how to change the style?

For example, if I wanna put the categories on the left of page, and
when click on, it just pops up on the right side of cursor
displaying all sub-categories, and only fresh the main frame when
click the leaf category.

I know I could do this by customizing some related templates by
adding css/js, but I don't want to change Cartridge more, is there
any easy way to do this?

Thanks.
Wesley

--
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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.


--
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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@gmail.com

--
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] Mezzanine.generic issues with South

2014-09-14 Thread Danny

On 15/09/2014 6:05 AM, Avery Laird wrote:

Hi,

I'm having an issue with migrating certain apps. The problem seems to be
well known, although I find myself unsure about how to fix it. I get the
following message when trying to migrate:

Your project contains migrations that include one of the fields
 from mezzanine.generic in its Migration.model dict: possibly
 KeywordsField, CommentsField or RatingField. These migratons no
 longer work with the latest versions of Django and South, so you'll
 need to fix them by hand. This is as simple as commenting out or
 deleting the field from the Migration.model dict.
 See http://bit.ly/1hecVsD for an example.

The unsynced apps are:
  - zeni_core
  - cartridge.shop
  - mezzanine.conf
  - mezzanine.core
  - mezzanine.generic
  - mezzanine.blog
  - mezzanine.forms
  - mezzanine.pages
  - mezzanine.galleries
  - mezzanine.twitter
  - mezzanine_events

 From what I understand, I must comment out all references
to KeywordsField, CommentsField or RatingField in the apps
Migration.model dictionary (all apps except for mezzanine ones).
However, after a cursory search through a single apps migration files, I
found multiple instances in just a single migration file, of which there
where about 25 files, and that's just a single app. Am I searching for
the wrong thing? Do I have to go through and make all those changes by
hand, or is there a way to streamline the process? Any help or insight
would be greatly appreciated!


I think this was to do with a Django upgrade.

Go through the files in your migrations folder and comment out the lines 
referencing keywords, comments or ratings. You should hopefully only 
have to do this in your custom app.


(I have a customised fork of cartridge and had to do it there, but you 
might be able to get away with only doing it in your app zeni_core)


Seeya. Danny.



Thanks,

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
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@gmail.com

--
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] "NoneType takes no arguments" when registering settings

2014-07-10 Thread Danny


On 10/07/2014 10:07 PM, Fredrik Blomqvist wrote:

I'm trying to register a couple of settings, but as soon as I try to set
one of them (in the admin interface) I get a "NoneType takes no
arguments" error, until I restart the server (the settings are all empty
after that, aka nothing gets saved).


I'm assuming these are in your defaults.py?

Add default="" to the new settings, that might be the only trick required.

BTW, your TEMPLATE_ACCESSIBLE_SETTINGS call probably doesn't need 
description or editable, as you've got the append=True so it'll

take those properties from the one defined before.

I've pasted some of my code below yours quoted below.

HTH. HAND.

Seeya. Danny.



Here's the code:

from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting


register_setting(
 name="TEMPLATE_ACCESSIBLE_SETTINGS",
 description=_("Sequence of setting names available within
templates."),
 editable=False,
 default=("SOCIAL_LINK_FACEBOOK", "SOCIAL_LINK_INSTAGRAM"),
 append=True,
)
register_setting(
 name="SOCIAL_LINK_FACEBOOK",
 label=_("Facebook link"),
 description=_("If present a Facebook icon linking here will be
in the header."),
 editable=True,
)
register_setting(
 name="SOCIAL_LINK_INSTAGRAM",
 label=_("Instagram link"),
 description=_("If present a Instagram icon linking here will be
in the header."),
 editable=True,
)



And here is the traceback:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.6.5
Python Version: 3.4.0
Installed Applications:
('mezzanine.boot',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.redirects',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.sitemaps',
  'django.contrib.staticfiles',
  'theme',
  'mezzanine.conf',
  'mezzanine.core',
  'mezzanine.generic',
  'mezzanine.blog',
  'mezzanine.forms',
  'mezzanine.pages',
  'mezzanine.galleries',
  'mezzanine.twitter',
  'filebrowser_safe',
  'south',
  'grappelli_safe',
  'django.contrib.admin',
  'django.contrib.comments')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.locale.LocaleMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'mezzanine.core.request.CurrentRequestMiddleware',
  'mezzanine.core.middleware.RedirectFallbackMiddleware',
  'mezzanine.core.middleware.TemplateForDeviceMiddleware',
  'mezzanine.core.middleware.TemplateForHostMiddleware',
  'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
  'mezzanine.core.middleware.SitePermissionMiddleware',
  'mezzanine.pages.middleware.PageMiddleware')

Traceback:
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/django/core/handlers/base.py"
in get_response
   105. response = middleware_method(request,
callback, callback_args, callback_kwargs)
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/pages/middleware.py"
in process_view
   103. response = view_func(request, *view_args,
**view_kwargs)
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/pages/views.py"
in page
   100. return render(request, templates, extra_context or {})
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/utils/views.py"
in render
   163. context_instance = RequestContext(request, dictionary)
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/django/template/context.py"
in __init__
   169. self.update(processor(request))
File

"/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/conf/context_processors.py"
in settings
   45. settings_dict[k] = getattr

  1   2   >