I'm creating a new Plugin using the Builder Plugin and adding a repeater with media finder.The problem is to insert repeater value in the database. Bellow have attached the screenshot of the error.
What is the problem?
Thanks.
The field must be jsonable, so you need to add the following code in your model file.
protected $jsonable = [
'images'
];
Related
I am new to Django and Python programming and I have looking in circles to solve this problem I have. I wrote following codes...whenever the below codes were executed, the inline filter is always default as 'close'. How can I default to 'open' or 'show' instead of default 'close'? Thank you.
class ArInvoiceSimpleInlineForeign(admin.TabularInline):
model = ArInvoice
extra = 2
classes = ('collapse open',)
inline_classes = ('collapse open',)
Am currently learning kivy, and am working on a simple ToDo list app just to build my knowledge about kivy but am stuck i need help please. Here is the full python codes and kv codes file link respectively, https://pastebin.com/92eMd776 (python codes), https://pastebin.com/g5cgUJ94 (kv file). My problem is on line 55 of the python file the "list_button" method in the "InputListWidget" class.
def list_button(self, list_):
print list_
self.remove_widget(self.input_layout_property)#removes the box_layout widget that contains the
list_view = Factory.ListUnEditedMode() #create an instance of the dynamic class ListUnEditedMode from #Factory
list_view.item_strings = list_ #then update the item_strings with the list_ values
self.add_widget(list_view) #To add the list_view widget
Then the kv file.:
<ListUnEditedMode#BoxLayout>:
show_list_property: list_view
ListView:
id: list_view
color: [0, 0, 0, 1]
item_strings: []
When the list button is clicked it clears the "box_layout" that contains the "text_input" field widget, then adds the "ListUneditedMode(Box_layout)" widget that contains the "ListView" widget, i succeeded in doing that, the instance of the kivy dynamic class - "ListUneditedMode" is created from Factory. The main problem is, i want the list values contained in the "list_" argument of the "list_button" method to update the "item_strings" variable.. Please any help will be greatly appreciated. Thanks (please forgive the unorganized way my codes are written, am just a newbie in kivy, python and programming as a whole)
Did you not write all that pretty code yourself? Right now it just seems to me you want to change line 59 to ist_view.item_strings = list_. Otherwise, explain what you want in more detail.
Learning emberjs
I am not sure if this is a stackoverflow question or git issue. So I decided to put it on stackoverflow first.
Here is my Jsbin (Open in firefox ..not in chrome as raw.github file is used)
When I click on "<- All Department" in department template which I reached after creating a new department it does navigate back to departments template
but the #each does not display the newly added department name in list.
It does show the newly added department on refreshing the browser on /departments
UPDATE
It seems that the .set() method is working but for some reason the new object created is returning the name and ID as undefined. Might be a bug with ember-model perhaps.
The best solution for the moment would be to have 2 save methods, one on the edit controller as you currently do and then adding a different save method for creating a new department.
App.NewController = Ember.ObjectController.extend({
save:function(){
var newDep = App.Department.create({name: this.get('name')});
newDep.save();
this.get('target').transitionTo('department', this.get('model'));
}
});
Here is a jsbin with the New controller added - http://jsbin.com/EVUlOyo/1/edit
End Update
It looks like when you are creating the record it is not setting the name value correctly on the object.
I changed the following -
newDepartment = self.get('model');
newDepartment.set('name',this.get('name'));
newDepartment.save();
to -
var newDep = App.Department.create({name: this.get('name')});
newDep.save();
Here is an updated jsbin also http://jsbin.com/EkEXInO/1/edit
Hope that helps and works for you.
I dynamically create campaign from my website using mailsnake in django framework. Want to add the data and images directly into campaign for that i add the html data into the sections like postcard_heading00, postcard_image, std_content00.
Write the code as below:
mailsnake = MailSnake('apikey')
template_option = {'list_id':xxxx, 'subject':'testing', 'from_email':'xxxxx', 'from_name':'Test', 'to_name':'', 'template_id':54457, 'inline_css':True, 'generate_text': True, 'title':'testing' }
template_content = {"html_postcard_heading00":"<h1>Testing</h1>","html_std_content00":"<h1>Testing</h1>","html_postcard_image":"<img src='image_path'>"}
and pass this content to
campaignCreate(type='regular',options = template_option,content=template_content)
method.
Campaigns creates properly, but the content still not added into the campaign.
Can please anybody tell me why this happens?
Problem is because of Repeatable section. Repeatable section having different way to add data.
Change the template content as below.
template_content = {'html_repeat_1:0:postcard_heading00':postcard_heading[0],
'html_repeat_1:0:postcard_image': postcard_img,
'html_repeat_1:0:std_content00': std_content[0]}
I done this way and problem gets solved.
I am working on a custom markup formatter for Django and I wanted to interface it with MarkItUp.
It is successfully being called when I save the field, which is of type MarkupField, but when I try to preview this field from the Admin interface using the default settings, all I get back in the preview box is plaintext.
I am using the MarkItUp version from here: http://bitbucket.org/carljm/django-markitup/src
Here are my settings:
MARKITUP_FILTER = ('util.wookie.formatter.wookie', {})
JQUERY_URL = 'js/lib/jquery.js'
In urls, I have the following line:
(r'^markitup/', include('markitup.urls')),
Any ideas?
Is something serving the assets from both the MARKITUP_MEDIA_URL the JQUERY_URL locations?