問題タブ [django-ajax-selects]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
django - Django ajax-selects パッケージが機能していません。私は何が欠けていますか?
form.py を持っている Django ajax-selects パッケージを使用しようとしています:
私のlookup.pyがあります:
テナントの model.py があります。
しかし、私のフォームでは、オートコンプリートもフィールド作成もありません。私は何を逃したのですか?
ajax - djangoアプリのdjangoデータベースのBooleanFieldへの変更時に何かを表示します
私はdjangoアプリのようなユーバーを持っています。顧客は、サービスを提供する人を探していることを知らせることができ、同じ地域でサービス プロバイダーを探している人は、積極的に探している顧客のリストを表示できます。顧客がサービスを探していることを知らせるボタンを押すと、「ありがとうございます。誰かが向かっているときに通知されます」というページにリダイレクトされ、属性active
がに設定されTrue
ます。これにより、顧客を「請求」できる前述のリストにそれらが表示されます。サービス プロバイダーが顧客を要求する場合。顧客のページに「誰かがすぐに来ます」またはその性質の何かを表示したいのですが、顧客のページ (customer_active.html) にそれactive
が設定されていることをどのように知らせることができますか?False
(すなわち、彼らは主張されています) そして、そのイベントの発生時にメッセージを表示しますか? django シグナルまたは ajax/jquery を使用する可能性について読んだことがありますが、正しいルートが何であるか、そのルートでソリューションを実装する方法がわかりません。次のコードがあります。
models.py:
urls.py
customer_active.html (顧客は、サービスを探していることを知らせた後にこれを見ています):
home.html:
ビュー.py:
ajax/jquery を使用して、サービス プロバイダーが顧客を主張しているときに、customer_active.html に「誰かがすぐに到着します」というメッセージを表示するにはどうすればよいですか?
javascript - Filtering Content in Django using ajax
I'm working on a template that renders a list of product. I want the user to filter the content based on the properties of the product.
Those are my models : """ Coutries, regions and cities tables """
""" Categories and their subcategories tables """
""" Product Table """
""" Products Location tables """
""" Products Classification """
In the page i will have 3 inputs for location : - Country, Region and City. I think I should implement a Dependent/Chained Dropdown I want to filter the products by country, region and city.
In another 2 inputs (Checkbox to select multiple choice) the user can select the category and subcategory to filter the products concerned.
How can I implement this ? I think That I will need Ajax and Json rendering. But I wasn't able to find a proper way to do it.
jquery - モデルオブジェクトを渡してページを更新せずにデータベースに保存するには、djangoでajaxを使用する方法は?
私はDjangoで小さなプロジェクトを行っています。ページの1つにお気に入りのボタンを追加して、そのボタンをクリックするとモデルオブジェクトが返され、参照用に別のデータベースに保存される必要があると考えました、しかしそれは起こっていません ここは私の ホーム/bookdetails.htmlです
私のurls.py:
私のmodels.py:
私のviews.py:
bookdetails.html から ajax 呼び出しを介して userbooks モデル オブジェクトを取得し、その参照を FavBooks モデルに格納したいと考えています。どうすればそれを実現できますか?ありがとう!