def pack(self, data): """Pack the data by joining all the fields with our separator.""" if not data: return "NULL" packed = self.separator.join([str(item) for item in data]) return string_literal(packed)
def pack(self, data): """Pack the data by running cPickle.dumps() on the dictionary.""" if not data: return "NULL" packed = cPickle.dumps(data) return string_literal(packed)
def pack(self, data): """Pack the data by running cPickle.dumps() on the dictionary.""" if not data: return 'NULL' packed = cPickle.dumps(data) return string_literal(packed)
def pack(self, data): """Pack the data for this field to be saved in the database. By default the value is cast to a string. @param data: the data that needs to be packed @type data: varying @return: a packed representation of the passed in data that can be saved to the database @rtype: varying """ if data is None: if self.default is None: return "NULL" return string_literal("") return string_literal(data)
def pack(self, data): """Pack the data by joining all the fields with our separator.""" if not data: return 'NULL' packed = self.separator.join([str(item) for item in data]) return string_literal(packed)
def pack(self, data): """Pack the data by joining all the fields with our separator.""" if not data: return 'NULL' packed = self.separator.join(data) return string_literal(packed)
def pack(self, data): """Pack the data for this field to be saved in the database. By default the value is cast to a string. @param data: the data that needs to be packed @type data: varying @return: a packed representation of the passed in data that can be saved to the database @rtype: varying """ if data is None: if self.default is None: return 'NULL' return string_literal('') return string_literal(data)
def pack(self, obj): """Pack the fieldname of the object we are dealing with.""" packed = obj.__class__.__name__ return string_literal(packed)
def pack(self, data): """Pack the data as serialized json.""" if not data: return "NULL" packed = json.dumps(data) return string_literal(packed)
def pack(self, data): """Pack the data as serialized json.""" if not data: return 'NULL' packed = json.dumps(data) return string_literal(packed)