Re: [mezzanine-users] Foreign Key to Page Object - Controlling the dropdown text in Admin
Hey Graham, could you go into a bit more detail. Where is the dropdown? What do the models look like? On Wed, Feb 4, 2015 at 3:23 AM, Graham Oliver greenbay.gra...@gmail.com wrote: Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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.
[mezzanine-users] Foreign Key to Page Object - Controlling the dropdown text in Admin
Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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] Problem with uploading files that have a question mark in the name
This is most likely an issue with FileBrowser but I'm mentioning it here in the hope that somebody might have had a similar issue or could possibly shed some light on this problem. A user recently had some difficulty with their site when they attempted to upload a file to the Media Library. The file they were attempting to upload had a question mark in the filename (e.g. example?.jpg). The file uploaded somewhat successfully but appeared in the file browser as a directory rather than an image (I assume because the filename was truncated at the '?' - i.e. dropping the extension). This new 'directory' couldn't be deleted. Much more worrying was that all other images/files in the target directory and its child directories were deleted! Gone. Disappeared. I have no idea how this could have happened. I can only assume that it is related to the issue I referred to in the previous paragraph as I was told that that was when the files disappeared. It also doesn't look like user error as the child directories were all still there - only empty. I can't replicate this (the disappearing files - I can replicate the corrupt directory issue by uploading a file with a '?' in the filename) and have very little idea of where to start looking for an explanation. I've raised an issue on the django-filebrowser github page but would like to hear from anyone here who might know something about this problem. The site in question uses Django 1.6.5, Mezzanine 3.1.9, and FileBrowser 0.3.5. -- 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: Alternate Fabfile for deploying to VPS
Just wanted to say that I've been using your mezzanine-webfaction fabfile and it's been incredibly helpful! Thanks. On Sunday, February 1, 2015 at 4:48:43 AM UTC+11, Eduardo Rivas wrote: Hello everybody. For the past few months I've been deploying my Mezzanine sites with a modified Fabfile. I've decided to publish it in case anybody wants to try it. This are the key differences with Mezzanine's default Fabfile (from the project README): - Vanilla gunicorn is used instead of the the deprecated gunicorn_django. - You don't need to host your repos in external sites (GitHub, Bitbucket). The contents are transferred directly from your dev machine to the server. - You can upload files to the server via rsync instead of git (in case your project is not under VCS). - You don't need to know which port Gunicorn is going to use, because the connection from Nginx is to a socket file. - Operations using sudo only require you to type the password once. - Invalid requests (hosts other than ALLOWED_HOSTS) are blocked on Nginx level. - Static files are set to expire after 30 days in browser cache (best practice). - Includes a shell script for bootstrapping a VPS from the second you get it. Please check it out, I hope it's useful. Bug reports and PRs are always welcome. https://github.com/jerivas/mezzanine-vps. Steve, if you're interested in some or all of the features described above, I can setup a PR so they can become part of Mezzanine. -- 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] Foreign Key to Page Object - Controlling the dropdown text in Admin
Hi Josh Here are the 2 models (simplified to focus on issue) class SoulPractitioner(Page, RichText): pass class SoulClass(Displayable): practitioner = models.ForeignKey(SoulPractitioner) When I 'Add soul class' in the admin I get the option to select a foreign key to 'Soul Practitioner' as expected. The text that displays for each SoulPractitioner is what I want to change (I want it to be only the 'Page title' rather than what I get which in this case is 'Grandparent page title' / 'Parent Page title' / 'Page title') Regards Graham On 05/02/15 06:36, Josh Cartmell wrote: Hey Graham, could you go into a bit more detail. Where is the dropdown? What do the models look like? On Wed, Feb 4, 2015 at 3:23 AM, Graham Oliver greenbay.gra...@gmail.com mailto:greenbay.gra...@gmail.com wrote: Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/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. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Foreign Key to Page Object - Controlling the dropdown text in Admin
You need to override the __str__ method on SoulPractictioner. Right now it is being inherited from Page, you can see that here, https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/models.py#L54 On Wed, Feb 4, 2015 at 2:31 PM, Graham greenbay.gra...@gmail.com wrote: Hi Josh Here are the 2 models (simplified to focus on issue) class SoulPractitioner(Page, RichText): pass class SoulClass(Displayable): practitioner = models.ForeignKey(SoulPractitioner) When I 'Add soul class' in the admin I get the option to select a foreign key to 'Soul Practitioner' as expected. The text that displays for each SoulPractitioner is what I want to change (I want it to be only the 'Page title' rather than what I get which in this case is 'Grandparent page title' / 'Parent Page title' / 'Page title') Regards Graham On 05/02/15 06:36, Josh Cartmell wrote: Hey Graham, could you go into a bit more detail. Where is the dropdown? What do the models look like? On Wed, Feb 4, 2015 at 3:23 AM, Graham Oliver greenbay.gra...@gmail.com wrote: Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/unsubscribe. To unsubscribe from this group and all its topics, 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. -- 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] Foreign Key to Page Object - Controlling the dropdown text in Admin
Thanks Josh I think that I am missing something... I have put this code in the SoulClass def __str__(self): print this should appear in the terminal if this method is being called return self.title But nothing appears in the terminal and the behaviour I am trying to change persists. It would seem that this method is being ignored, which suggests to me that the syntax is wrong. G On 05/02/15 09:15, Josh Cartmell wrote: You need to override the __str__ method on SoulPractictioner. Right now it is being inherited from Page, you can see that here, https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/models.py#L54 On Wed, Feb 4, 2015 at 2:31 PM, Graham greenbay.gra...@gmail.com mailto:greenbay.gra...@gmail.com wrote: Hi Josh Here are the 2 models (simplified to focus on issue) class SoulPractitioner(Page, RichText): pass class SoulClass(Displayable): practitioner = models.ForeignKey(SoulPractitioner) When I 'Add soul class' in the admin I get the option to select a foreign key to 'Soul Practitioner' as expected. The text that displays for each SoulPractitioner is what I want to change (I want it to be only the 'Page title' rather than what I get which in this case is 'Grandparent page title' / 'Parent Page title' / 'Page title') Regards Graham On 05/02/15 06:36, Josh Cartmell wrote: Hey Graham, could you go into a bit more detail. Where is the dropdown? What do the models look like? On Wed, Feb 4, 2015 at 3:23 AM, Graham Oliver greenbay.gra...@gmail.com mailto:greenbay.gra...@gmail.com wrote: Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/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. For more options, visit https://groups.google.com/d/optout.
Fwd: Re: [mezzanine-users] Foreign Key to Page Object - Controlling the dropdown text in Admin
Hi Josh I tried something based on this https://docs.djangoproject.com/en/1.6/ref/models/instances/ and it worked! Namely I changed __str__ to __unicode__ Not entirely sure why this worked but happy enough at this stage... Thanks for your help G Forwarded Message Subject: Re: [mezzanine-users] Foreign Key to Page Object - Controlling the dropdown text in Admin Date: Thu, 05 Feb 2015 11:20:07 +1300 From: Graham greenbay.gra...@gmail.com To: mezzanine-users@googlegroups.com Thanks Josh I think that I am missing something... I have put this code in the SoulClass def __str__(self): print this should appear in the terminal if this method is being called return self.title But nothing appears in the terminal and the behaviour I am trying to change persists. It would seem that this method is being ignored, which suggests to me that the syntax is wrong. G On 05/02/15 09:15, Josh Cartmell wrote: You need to override the __str__ method on SoulPractictioner. Right now it is being inherited from Page, you can see that here, https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/models.py#L54 On Wed, Feb 4, 2015 at 2:31 PM, Graham greenbay.gra...@gmail.com mailto:greenbay.gra...@gmail.com wrote: Hi Josh Here are the 2 models (simplified to focus on issue) class SoulPractitioner(Page, RichText): pass class SoulClass(Displayable): practitioner = models.ForeignKey(SoulPractitioner) When I 'Add soul class' in the admin I get the option to select a foreign key to 'Soul Practitioner' as expected. The text that displays for each SoulPractitioner is what I want to change (I want it to be only the 'Page title' rather than what I get which in this case is 'Grandparent page title' / 'Parent Page title' / 'Page title') Regards Graham On 05/02/15 06:36, Josh Cartmell wrote: Hey Graham, could you go into a bit more detail. Where is the dropdown? What do the models look like? On Wed, Feb 4, 2015 at 3:23 AM, Graham Oliver greenbay.gra...@gmail.com mailto:greenbay.gra...@gmail.com wrote: Hi there I have a foreign key to a Page Object. I want to be able to control the text that appears on the drop down in the Admin. I am guessing that I need to override ModelChoiceField like here http://stackoverflow.com/questions/6836740/django-admin-change-foreignkey-display-text However, I am a bit stuck on how to do this with Mezzanine Would anyone be able to help me? TIA Graham -- 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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/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 a topic in the Google Groups Mezzanine Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/xe7MPAnpeUU/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. For more options, visit https://groups.google.com/d/optout.
[mezzanine-users] Re: Alternate Fabfile for deploying to VPS
Hey Tomlin, thanks for your kind words, it's great to see the project being helpful. I've made important progress refactoring Mezzanine's default fabfile, I hope it'll be ready soon. I also have plans to make a screencast explaining the deployment of Mezzanine, as it is one of the common stumbling rocks for new comers. -- 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?
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.
[mezzanine-users] How to hide product unavailable for purchase on the web page?
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. Any suggestion? 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. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Re: Cartrige custom shipping by country and product category
Hi Josh, Thanks for your reply. Got that and I will try later on, Wesley You should be able to do that in the billship handler. You can see the default here, https://bitbucket.org/stephenmcd/cartridge/src/57a56a41baf1b70789567a1d06b79a473e719a22/cartridge/shop/checkout.py?at=default#cl-26 The important part is that it points out that you can access request.cart So in your handler you would want to do something like: for item in request.cart: # if this is the max price so far store it # else continue # set the shipping to the max price On Tue, Feb 3, 2015 at 1:43 AM, Wesley nis...@gmail.com javascript: wrote: Hi , I have one question. Assume you've finished this feature. So, when one order comes, containing multiple products, so, how to set the final shipping value? Filter all items and set to the most expensive one? Thanks. Wesley Hey everyone, After browsing on the forum, I successfully setup a custom billship_hander depending on the country from the order_form SHOP_HANDLER_BILLING_SHIPPING = myapp.checkout.custom_billship_handler def custom_billship_handler(request, order_form): if order_form is not None: if not request.session.get(free_shipping): settings.use_editable() if order_form.cleaned_data[shipping_detail_country] == Canada: set_shipping(request, CanadaPost Regular, 5.00) elif order_form.cleaned_data[shipping_detail_country] == US: set_shipping(request, CanadaPost US Regular, 7.90) else: set_shipping(request, _(Flat rate shipping), settings. SHOP_DEFAULT_SHIPPING_VALUE) But now, is there a way to filter my shipping by location + category, or product type as defined in my child_categories ? I've been trying with the cart and order instance, but it doesn't work: #cart = Cart.objects.from_request(request) #cart_test = request.cart.has_items() #order = Order.objects.from_request(request) Any tips is appreciated! 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-use...@googlegroups.com javascript:. 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.