update
This commit is contained in:
parent
008ada38ae
commit
85793dfba7
@ -106,8 +106,9 @@ def car_list(request):
|
|||||||
page = request.GET.get("page", 1)
|
page = request.GET.get("page", 1)
|
||||||
per_page = 10
|
per_page = 10
|
||||||
|
|
||||||
cars = inventory_models.Car.objects.filter(dealer=dealer).values(
|
cars = inventory_models.Car.objects.all().values(
|
||||||
"vin",
|
"vin",
|
||||||
|
"year",
|
||||||
"id_car_make__name",
|
"id_car_make__name",
|
||||||
"id_car_model__name",
|
"id_car_model__name",
|
||||||
"status"
|
"status"
|
||||||
|
|||||||
@ -753,12 +753,14 @@ def analyze_prompt(prompt: str) -> Dict[str, Any]:
|
|||||||
"""
|
"""
|
||||||
# Detect language
|
# Detect language
|
||||||
language = "ar" if bool(re.search(r'[\u0600-\u06FF]', prompt)) else "en"
|
language = "ar" if bool(re.search(r'[\u0600-\u06FF]', prompt)) else "en"
|
||||||
filtered_apps = ['inventory', 'django_ledger', 'appointments', 'plans']
|
filtered_apps = ['inventory']
|
||||||
try:
|
try:
|
||||||
analyzer = DjangoModelAnalyzer()
|
analyzer = DjangoModelAnalyzer()
|
||||||
model_structure = get_all_model_structures(filtered_apps=filtered_apps)
|
model_structure = get_all_model_structures(filtered_apps=filtered_apps)
|
||||||
|
print(model_structure)
|
||||||
analysis = analyzer.analyze_prompt(prompt, model_structure)
|
analysis = analyzer.analyze_prompt(prompt, model_structure)
|
||||||
|
print(analysis)
|
||||||
|
|
||||||
|
|
||||||
if not analysis or not analysis.app_label or not analysis.model_name:
|
if not analysis or not analysis.app_label or not analysis.model_name:
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user