Exemplo n.º 1
0
    def removecompany(self):
 
        item = self._getItemByKey(UserCompany)

        for persona in Persona.all().filter("company =", item):
            persona.company = None
            persona.put()

        item.delete()
        
        self.sendJsonOK()
Exemplo n.º 2
0
    def removenickname(self):
 
        item = self._getItemByKey(UserNickname)
        
        for persona in Persona.all().filter("nickname =", item):
            persona.nickname = None
            persona.put()
        
        item.delete()
        
        self.sendJsonOK()
Exemplo n.º 3
0
 def view(self):
     
     if self.getUserProfile():
       
         self.sendContent('templates/Personas.html',
                         activeEntry = "Personas",
                         templateVariables = {
             'userProfile': self.userProfile,
             'companies': self._getCompanies(),
             'nicknames': self._getNicknames(),
             'photos': self._getPhotos(),
             'personas': Persona.all(). \
                               ancestor(self.userProfile). \
                               order("name"),
         })
Exemplo n.º 4
0
    def removephoto(self):

        key = self.getRequiredParameter('key')

        try:
            photo = UserPhoto.get(key)
            
            for persona in Persona.all().filter("picture =", photo):
                persona.picture = None
                persona.put()
              
            photo.image.delete()
            photo.delete()
            
            self.sendJsonOK()

        except datastore_errors.BadKeyError:
            raise AjaxError("Photo not found.")
Exemplo n.º 5
0
def deleteProfile(userProfileKey):

    userProfile = UserProfile.get(userProfileKey)    
    
    for e in CardDAVLogin.all().ancestor(userProfile):
        e.delete()
    for e in IndividualPermit.all().ancestor(userProfile):
        e.delete()
    for e in Persona.all().ancestor(userProfile):
        e.delete()
    for e in Psinque.all().ancestor(userProfile):
        e.delete()
    for e in Contact.all().ancestor(userProfile):
        e.delete()
    for e in Group.all().ancestor(userProfile):
        e.delete()
    for e in UserAddress.all().ancestor(userProfile):
        e.delete()
    for e in UserEmail.all().ancestor(userProfile):
        e.delete()
    for e in UserIM.all().ancestor(userProfile):
        e.delete()
    for e in UserPhoneNumber.all().ancestor(userProfile):
        e.delete()
    for e in UserPhoto.all().ancestor(userProfile):
        e.image.delete()
        e.delete()
    for e in UserNickname.all().ancestor(userProfile):
        e.delete()
    for e in UserCompany.all().ancestor(userProfile):
        e.delete()
    for e in UserWebpage.all().ancestor(userProfile):
        e.delete()
    
    if not userProfile.userSettings is None:
        userProfile.userSettings.delete()
        
    userProfile.delete()
    logging.info("User profile deleted")
Exemplo n.º 6
0
 def _getPersonaByName(self, personaName):
   
   return Persona.all(). \
                   ancestor(self.userProfile). \
                   filter("name =", personaName). \
                   get()
Exemplo n.º 7
0
    def _updateAllVCards(self):

        for persona in Persona.all().ancestor(self.userProfile):
            generateVCard(persona)