[mezzanine-users] Re: Automatically generating pages when creating a site
Thank you, Kenneth. Now my question is : is there a way to override the methods in management/command/createdb.py in a django-app ? I wouldn't want to mess with the source code... -- 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: Automatically generating pages when creating a site
Ok, but then wouldn't I need to rewrite the whole command class that is defined in the core, with all the methods that I didn't want to change ? -- 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] Restrain the rich text
Hello I would like to know if there is a simple way to restraint the options of the rich text. I would like to remove the alinement options (center, justify, etc.) I tried to manipulate the settings : RICHTEXT_ALLOWED_ATTRIBUTES and RICHTEXT_ALLOWED_TAGS but it doesn't seem to change anything. -- 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: Restrain the rich text
Great ! Thank you very much ! (and I am sorry if it had already been posted, I didn't find it...I'll take a closer look the next time) -- 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: Automatically generating pages when creating a site
Ok, I think I know what to do, now. Thank you very much for your quick answers ! -- 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] Automatically generating pages when creating a site
Hello When someone first creates a mezzanine site by running the command python manage.py createdb, they are proposed to lauch some pages like Contact or Gallery. I would like to do a similar thing in a django application : define a default page with a slug and a description (and some other things, if necessary), and when someone first migrates their site with my app on it, they can answer yes or no to have my default page added on their site. Is it possible ? And if so, how/where should I define my default page ? -- 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: Mezzanine (4.0) permissions - moderation
Hello again I am coming back to my permission/moderation problem. I finally understood the trick with super, and I am starting to have an idea about how to modify the queryset method. There is another matter, though. I began to create a permission_app to create my moderation permission, in that app I created a directory called management in which I wrote a __init__.py fil containing this : from django.db.models.signals import post_syncdb from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import Permission def add_moderation_permissions(sender, **kwargs): This syncdb hooks takes care of adding a moderation permission too all our content types. # for each of our content types for content_type in ContentType.objects.all(): # build our permission slug codename = moderation_%s % content_type.model # if it doesn't exist.. if not Permission.objects.filter(content_type=content_type, codename =codename): # add it Permission.objects.create(content_type=content_type, codename=codename, name=Can moderation %s % content_type.name) print Added moderation permission for %s % content_type.name # check for all our moderation permissions after a syncdb post_syncdb.connect(add_moderation_permissions) It seems to have correctly added the permission, but only for the django_comments. I get that it's because it is the only ContentType, but the trick is that when I try to adapt the code for Page or BasePage, it doesn't work. I have a (completely normal) error that is raised : ValueError: Cannot query Blog: Must be ContentType instance. (and it says blog only because it is the first model that is tried, but it must be the same for all the models). I looked at the django/contrib/auth/models.py file to understand the type of Permission and Permission.objects, and it seems like everything was written to be contenttypes. I also looked at the Displayable, BasePage and Page types of mezzanine and it doesn't seem to inherit from ContentType in anyway... Besides, I would also want all of the objects I create in apps (I mean objects that inherit directly from models.Model) to recognise that permission. So, how could I cleanly add my moderation permission for all the models that are in the apps I declared in INSTALLED_APPS and that can be editable in the admin interface, and not just content 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.
[mezzanine-users] zip_import FROM pages_page LEFT OUTER JOIN
https://lh3.googleusercontent.com/-AgxjGxsI_E4/Vbi08T65vrI/ANM/IbA-Okg71iI/s1600/Erreur_modeles_geoloc.PNG Hello again I have created a django app with some models and quickly resgistered an admin class. I made migrations and migrated whitout any trouble, but then when I ran the server and went on the web page, I got that : It is allthemore weird since I didn't add my django app to the installed_app settings. I have found something close on the web, but nothing exactly like this with the zip_import FROM pages_page problem... In what I found, it was talked about a problem with the database, but since my migrations went well, I don't see what could cause this... My database is PostGreSQL, if it helps to know My app's name is geoloc, and I am now showing you my models so that you could understand the error better : # coding: utf-8 from django.db import models from mezzanine.pages.models import Page from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from geopy.geocoders import GoogleV3 as GoogleMaps from geopy.geocoders.googlev3 import GeocoderQueryError from django.contrib.sites.models import Site from datetime import timedelta, datetime as dt from mezzanine.utils.sites import current_site_id from mezzanine.conf import settings def _get_current_domain(): return Site.objects.get(id=current_site_id()).domain class Adresse(models.Model): indication_emplacement = models.CharField(max_length=256) adresse_localisable = models.CharField(max_length=128, blank=True) lat = models.DecimalField(max_digits=10, decimal_places=7, blank=True, null=True, verbose_name=Latitude) lon = models.DecimalField(max_digits=10, decimal_places=7, blank=True, null=True, verbose_name=Longitude) def clean(self): super(Adresse, self).clean() if self.lat and not self.lon: raise ValidationError(Longitude required if specifying latitude.) if self.lon and not self.lat: raise ValidationError(Latitude required if specifying longitude.) if not (self.lat and self.lon) and not self.adresse_localisable: self.adresse_localisable = self.indication_emplacement.replace( \n,, ) def __unicode__(self): return self.indication_emplacement class Fiche_service(models.Model): name = models.CharField(max_length=64, verbose_name=Nom, blank=True) phone_verif = RegexValidator(regex=r'^\+?1?\d{9,15}$', message=Le numéro de téléphone doit être entré dans le format: '+9', jusqu'à 15 chiffres autorisés.) phone = models.CharField(max_length=16, validators=[phone_verif], blank= True, verbose_name=N° de téléphone, help_text=Le numéro de téléphone doit être entré dans le format: '+9', jusqu'à 15 chiffres autorisés.) # validators should be a list adresse = models.OneToOneField(Adresse, primary_key=True) def clean(self): from django.core.exceptions import ValidationError if self.name == '': raise ValidationError('Please enter a name for the service') def __unicode__(self): return self.name class Geoloc_map(Page): services = models.ManyToManyField(Fiche_service) def __unicode__(self): return super(Geoloc_map, self).title class Meta: verbose_name = TEST_NEW_META_NAME And the content of my admin.py file : from django.contrib import admin from mezzanine.pages.admin import PageAdmin from .models import Geoloc_map admin.site.register(Geoloc_map, PageAdmin) -- 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: zip_import FROM pages_page LEFT OUTER JOIN
I have just done it and it displays the same error page. I have managed to skirt the problem by creating another mezzanine-project, creating another django-app with a new name inside the new project and copying the exact same models.py and admin.py files. I don't understand why this works, but it does... So if you think my problem was due to some hidden bug, I can keep my project and answer your questions to help resolve it, and if not, my problem has magically been resolved. -- 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: zip_import FROM pages_page LEFT OUTER JOIN
The project name was : mystere And the app name was : geoloc I didn't think those name could cause any trouble... When I said naming problem I meant something about inside the app named geoloc, having a model called Geoloc_map. -- 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: zip_import FROM pages_page LEFT OUTER JOIN
OK, but then how do you explain the fact that it worked on my second project ? Whereas I had really run the commands python manage.py makemigration and then python manage.py migrate and both of them had terminated normally. I did nothing more on my second project Le mercredi 29 juillet 2015 16:14:39 UTC+2, Stephen McDonald a écrit : The original error stated that the database table for the Geoloc_map model didn't exist in the database, see the relation geoloc_geoloc_map does not exist part, that's the error message. The part you focused on searching for was the SQL query that caused the error, and had nothing to do with it particularly. You say that the migrations were created and run for the new app, and I'm sure you believe that to be - but unfortunately the error says otherwise. Let's try not to talk about these things as magical - we do ourselves a disservice by creating that perception, when the reality is we simply haven't invested enough to time in studying the code and documentation which will eventually reveal how simple and boring these things really are. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[mezzanine-users] ID Cards library
Hello I am trying to make a website where I could register some services (shops, restaurants, etc.). I would like to be able to place those services on one or several maps, as well as to dedicate one or several pages to some of those services. And for both of them (maps pages) I would use the same information (phone number, name of the service, adress, link to their site, etc.). Therefore, I would like to create a model Service_ID with several fields. Service_IDs should be creatable, editable, and deletable from the admin interface. And I would also like to be able to store them (from the admin interface) in a library, like the media library, from where I could select a service and import its data to some pages. To sum up, what I imagine is an ID_Library in the admin interface. One should be able to click on ID Library, and then : - see all the services that have already been registered - be able to create one thanks to a form - be able to edit one thanks to the same form - be able to delete one Is it possible ? If so, could you give me some directions on how to do it ? Deborah -- 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: ID Cards library
Actually, I have already gone through the tutorial twice. Given your response, I fear that I may not have been very clear in my previous message : I used the generic terms service and ID just as an example, to try to be clearer, and I used the term library because it is exactly what I want. Maybe that it is not completely the same since I don't want to upload 'ID cards' from my computer, but I would want to store them and access them the same way as the Media Library. And I would also want my semi-library to appear in the same menu as the media library. And I especially don't want to register the services as pages. I know how to make the model I want, how to define the fields that I want the admin to be able to edit in the models.py file of my django app. But the thing that I don't know how to do (if it is even possible) is to create a library like the one that is described. -- 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: ID Cards library
Maybe, if not a library, I could have a similar way to store the IDs, and when editing a map for example, all the services that are stored could be presented like boxes which one should check if the service sould appear on the map. Anyway, what I am sure that I want is an access in the admin menu with an easy way to create, edit, and delete entries. -- 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: ID Cards library
Thank you very much, Eduardo, I'll try that. -- 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] Admin title
Hello I am trying to change the title of the admin interface of mezzanine. I have already changed the site title in the settings, but although it changed the title of the site, the old title, mezzanine, still appears in the top left hand corner of the admin interface. I looked at the source code of the admin page and I think that the title is what is in the div whose class is admin-title, but I didn't find such a div in the templates. Then, I found this old conversation : http://permalink.gmane.org/gmane.comp.cms.mezzanine.user/51. But I couldn't find the templates it refers to, and I tried to write GRAPPELLI_ADMIN_TITLE = my title in settings.py and local_settings.py, but it didn't do anything so I guess that the files that it talks about have been removed in some update. So, do you know how to change the admin site title in the current version 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.
[mezzanine-users] Re: Admin title
Exactly what I wanted. Thank you very much Deborah -- 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: Mezzanine (4.0) permissions - moderation
Thanks again for your answer, Josh. But I still have trouble understanding the get_queryset method... The thing that bothers me in the code is this : def get_queryset(self, request): [...] qs = super(OwnableAdmin, self).get_queryset(request) [...] return [...] (If you want to see it inside the code, those are the lines 215 and 229 of OwnableAdmin https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/admin.py ). It looks like a vicious circle and I don't understand how this works... Maybe it is not one because of the super(OwnableAdmin, self) that is right before, but I couldn't find the definition of super in this context and therefore couldn't figure out what is means. I just started Python 2-3 weeks ago for django, I still haven't seen all the concept. Could you explain it to me ? Also, I understand that request.user is the user that is currently logged in, but what is the difference between user__id and request.user.id ? (both there : https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/admin.py#L232 ) -- 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: Mezzanine (4.0) permissions - moderation
Thank you both for your answers. I think I wasn't very clear on one point : I don't want all staff users to be moderators, but only some of them, some other users should only be allowed to change and delete their own content. Therefore, Josh, I can't use your suggestion. And Eduardo, I didn't fully understand what a queryset is (eventhough I read this paragraph https://docs.djangoproject.com/en/1.8/ref/models/querysets/#django.db.models.query.QuerySet), but I think that your method would have the same problem : I would just replace the current permissions. I really need there to be an additionnal permission for every model. So, given that, do you have an idea ? -- 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] Mezzanine (4.0) permissions - moderation
Hello I am trying to add new permission possibilities : I would like for some users (which I will call moderators) to be able to edit and delete the posts of other users, but I don't want the moderators to be superusers. I have not yet found a way to do that. Is it possible ? Or would I have to write some code ? If I had to write some code, my first idea is for every model (blog, gallery, etc.) add a fourth permission : can moderate, which would mean that as long as the user with the permission is a staff member, when they log in the admin interface they can see (and of course edit) the model written by every user, and not just themselves. I have yet to figure out whether I want moderators to be able to edit content published by superusers...I don't think I want them to. Anyway, is it a simple way of doing that ? Could I write a simple app ? Or would I have to modify the mezzanine core ? Deborah -- 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.0 : staff users
Actually, I work on Linux virtual machines and I have just completely re-installed mezzanine, postgresql, etc. from scratch on a new machine and there it works. I have still no idea of what I did wrong before, though... Anyway, sorry for the disturbance. And thanks a lot for your help (and for all the time that you have spent on mezzanine development) Regards, Deborah Le jeudi 16 juillet 2015 10:13:10 UTC+2, Déborah Leder a écrit : https://lh3.googleusercontent.com/-nYpnBnsCMQk/VadmpNCUzeI/AMM/kDe5GYQSIPI/s1600/Capture_mezzanine_site_permission.PNG https://lh3.googleusercontent.com/-qJVBM6ThNjY/VadmslcnlwI/AMU/hnxAn5w8jxw/s1600/Capture_mezzanine.PNG https://lh3.googleusercontent.com/-nYpnBnsCMQk/VadmpNCUzeI/AMM/kDe5GYQSIPI/s1600/Capture_mezzanine_site_permission.PNG Thank you for your quick response. However I had already chose the site permissions yesterday...it was filled automatically but I checked today and it was the right address. I am showing you my screen shots, you can see that the local address in the permission is the same as the one I use to try to connect to the admin site with my staff member. Both screen shots were made today (although nothing has changed for me since yesterday). I could have done something wrong, but I am pretty sure that I just did the same things that I had done a few days ago on mezzanine 3... Le jeudi 16 juillet 2015 06:10:28 UTC+2, Stephen McDonald a écrit : You need to choose at least 1 site that the user has permission to access the admin in - it's under Site Permissions at the end of the user add/edit form. Works for me. On Thu, Jul 16, 2015 at 12:54 AM, Déborah Leder debd...@gmail.com wrote: https://lh3.googleusercontent.com/-TfOnEYdyMIs/VaaA1zdIEEI/AL4/xrvPacV4XOw/s1600/Capture_mezzanine.PNG Hello I have recently updated to mezzanine 4 and I have encountered an issue. When I create a user who is active and is a staff member, the user can't log in to the admin interface. I have an error message (cf. image) When I create another superuser, the other superuser can log in the admin site. I had started to work on mezzanine 3.1.10 two weeks ago and I managed to create a Staff member user who could log in the admin site. Has something changed in the permission ? Or is it a bug ? And if so, when do you think it could/would be solved ? (I am actually working and using mezzanine for a client for whom I must have finished the site in a month, so if it is going to take more than a week to fix, which I could completely understand, I need to know to go back to the older version) Deborah. -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Mezzanine 4.0.0 : staff users
https://lh3.googleusercontent.com/-nYpnBnsCMQk/VadmpNCUzeI/AMM/kDe5GYQSIPI/s1600/Capture_mezzanine_site_permission.PNG https://lh3.googleusercontent.com/-qJVBM6ThNjY/VadmslcnlwI/AMU/hnxAn5w8jxw/s1600/Capture_mezzanine.PNG https://lh3.googleusercontent.com/-nYpnBnsCMQk/VadmpNCUzeI/AMM/kDe5GYQSIPI/s1600/Capture_mezzanine_site_permission.PNG Thank you for your quick response. However I had already chose the site permissions yesterday...it was filled automatically but I checked today and it was the right address. I am showing you my screen shots, you can see that the local address in the permission is the same as the one I use to try to connect to the admin site with my staff member. Both screen shots were made today (although nothing has changed for me since yesterday). I could have done something wrong, but I am pretty sure that I just did the same things that I had done a few days ago on mezzanine 3... Le jeudi 16 juillet 2015 06:10:28 UTC+2, Stephen McDonald a écrit : You need to choose at least 1 site that the user has permission to access the admin in - it's under Site Permissions at the end of the user add/edit form. Works for me. On Thu, Jul 16, 2015 at 12:54 AM, Déborah Leder debd...@gmail.com javascript: wrote: https://lh3.googleusercontent.com/-TfOnEYdyMIs/VaaA1zdIEEI/AL4/xrvPacV4XOw/s1600/Capture_mezzanine.PNG Hello I have recently updated to mezzanine 4 and I have encountered an issue. When I create a user who is active and is a staff member, the user can't log in to the admin interface. I have an error message (cf. image) When I create another superuser, the other superuser can log in the admin site. I had started to work on mezzanine 3.1.10 two weeks ago and I managed to create a Staff member user who could log in the admin site. Has something changed in the permission ? Or is it a bug ? And if so, when do you think it could/would be solved ? (I am actually working and using mezzanine for a client for whom I must have finished the site in a month, so if it is going to take more than a week to fix, which I could completely understand, I need to know to go back to the older version) Deborah. -- 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. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[mezzanine-users] Mezzanine 4.0.0 : staff users
https://lh3.googleusercontent.com/-TfOnEYdyMIs/VaaA1zdIEEI/AL4/xrvPacV4XOw/s1600/Capture_mezzanine.PNG Hello I have recently updated to mezzanine 4 and I have encountered an issue. When I create a user who is active and is a staff member, the user can't log in to the admin interface. I have an error message (cf. image) When I create another superuser, the other superuser can log in the admin site. I had started to work on mezzanine 3.1.10 two weeks ago and I managed to create a Staff member user who could log in the admin site. Has something changed in the permission ? Or is it a bug ? And if so, when do you think it could/would be solved ? (I am actually working and using mezzanine for a client for whom I must have finished the site in a month, so if it is going to take more than a week to fix, which I could completely understand, I need to know to go back to the older version) Deborah. -- 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.