File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ def mount(self, **kwargs):
52
52
posts = posts .filter (param )
53
53
return {
54
54
'posts' : list (posts .values ("id" , "title" , "content" )),
55
- 'search' : self .search # TODO: before mount we must put the new value of the search for updates_query_string works and work on the url
56
55
}
57
56
58
57
Original file line number Diff line number Diff line change @@ -48,11 +48,13 @@ def fill(
48
48
def get_context (self ):
49
49
kwargs = self .__kwargs
50
50
mount_result = {}
51
+ # call mount if exists
52
+ if hasattr (self , "mount" ) and callable (self .mount ): # Livewire Compatility
53
+ mount_result = self .mount (** kwargs )
54
+
51
55
params = get_vars (self )
52
56
for property in params :
53
57
mount_result [property ] = getattr (self , property )
54
- if hasattr (self , "mount" ) and callable (self .mount ): # Livewire Compatility
55
- mount_result = self .mount (** kwargs )
56
58
return mount_result
57
59
58
60
def get_response (self ): # TODO: chnge to use render method on component view
@@ -76,11 +78,12 @@ def get_response(self): # TODO: chnge to use render method on component view
76
78
return json_response
77
79
78
80
def update_context (self , data_context ):
81
+ for key , value in data_context .items ():
82
+ setattr (self , key , value )
83
+
79
84
context = self .get_context ()
80
85
if data_context :
81
86
context .update (data_context )
82
- for key , value in context .items ():
83
- setattr (self , key , value )
84
87
return context
85
88
86
89
def parser_payload (self , request ):
You can’t perform that action at this time.
0 commit comments