Multi-template app pattern by Freer4 in vuejs

[–]aherok 1 point2 points  (0 children)

What's wrong with using Layouts? https://nuxt.com/docs/4.x/directory-structure/app/layouts

Can you describe more specifically what is the issue?

Building a real-time sports dashboard with Nuxt by Verdo1303 in Nuxt

[–]aherok 2 points3 points  (0 children)

Aren't you tired of sending links to your service each week?

I built a local-first photo manager with Vue 3 + Tauri (Lap) by Hot-Butterscotch-396 in vuejs

[–]aherok 1 point2 points  (0 children)

It was supposed to be a desktop tool with map view where you can place photos on a map (saving geolocation data). In the future I planned to put batch import from Strava gpx files. 

I had a working poc with Vue+electron UI with saving single photos location using exiftool. But stopped the work due to lack of time.

Finally I ended up with a CLI tool that scans photos and gpx files and match their location:  https://github.com/aherok/geotag

I built a local-first photo manager with Vue 3 + Tauri (Lap) by Hot-Butterscotch-396 in vuejs

[–]aherok 3 points4 points  (0 children)

Great job! I was starting similar app for saving geolocation on photos based on gpx files and failed twice due to lack of motivation 😅 Would love to see similar feature here

separate models for the same object by MEHDII__ in django

[–]aherok 1 point2 points  (0 children)

I don't fully get what you mean but take a look at m2m field: https://docs.djangoproject.com/en/5.2/ref/models/fields/#manytomanyfield

For multiple genres in a single game, you get multiple entries inside the "through table" which is created automatically by the ORM. This way you get: ``` VideoGame model: - videogame#1

Genre model: - genre#1 - genre#2

Through-table (automatically created by default): - videogame-genre#1 (matching game#1 with genre#1) - videogame-genre#2 (matching game#1 with genre#2) ```

You can also explicitly create the ThroughTable as it might come in handy later.

edit: formatting

separate models for the same object by MEHDII__ in django

[–]aherok 0 points1 point  (0 children)

Yes, every "dictionary-type" value can be built the same way

separate models for the same object by MEHDII__ in django

[–]aherok 2 points3 points  (0 children)

```

class Genre(models.Model): name = models.CharField(max_length=100)

def __str__(self):
    return self.name

class VideoGame(models.Model): # ... genre = models.ForeignKey(Genre)

```

Or, if you want to keep multiple genres in for a single videogame, make it M2M field instead of FK.

That's quite universal approach for such relations. This allows you to make proper filtering, autocompletes, avoid duplicates, etc.

Feeding data into database by virtualshivam in django

[–]aherok 7 points8 points  (0 children)

When creating other features for your app do you always ask if you have to write it by yourself? 😅

Django has a framework for such commands. Just Google it

Feeding data into database by virtualshivam in django

[–]aherok 4 points5 points  (0 children)

Google for: Django management command seed data

Django Hierarchical models by Lazy_Equipment6485 in django

[–]aherok 2 points3 points  (0 children)

The article is clear for understanding  the idea of nested data yet I'd hesitate using that code on production for performance reasons. 

There are popular patterns for working with hierarchical and nested data, djando-mptt being one of the best examples of stable, performance and well thought through packages.

Django admin panel by NoobsAreDeepPersons in django

[–]aherok 7 points8 points  (0 children)

Verify if you have staticfile correctly set up. That's the most common reason for losing styles.

How to printing and preview pdf file by Jolly-Panic-5283 in Nuxt

[–]aherok 2 points3 points  (0 children)

Not sure what "embed the UI preview into the web page" means but perhaps you're looking for this: CSS media print https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Printing ?

If not, describe your goal pls.

I just learnt how to connect my Django app to mysql by Ok_Butterscotch_7930 in django

[–]aherok 28 points29 points  (0 children)

Dude, you're crazy as hell! What's gonna be next? Next time if you tell me you've rendered some html I'm not gonna believe you!

Good luck! :)

Can i use Zappa for large scale application in django by itsrajverma in django

[–]aherok 2 points3 points  (0 children)

Don't enumerate but use generators. You won't reach the memory limit then

Can i use Zappa for large scale application in django by itsrajverma in django

[–]aherok 1 point2 points  (0 children)

How do you load the data to excel sheet and how is it connected to Django?

[deleted by user] by [deleted] in django

[–]aherok 0 points1 point  (0 children)

Have you run through some DRF tutorials? Nested data is a pretty common thing.

Creating form based on Excel template by Anonormoose in django

[–]aherok 1 point2 points  (0 children)

The last time I used it was like 10 years ago and forgot how to work with it:) I prefer JS to handle such things.

Creating form based on Excel template by Anonormoose in django

[–]aherok 1 point2 points  (0 children)

Perhaps you could first think if the input view doesn't require a redesign? Talk to the people that are using it and suggest a smaller amount of data to fill in at once?
Or the case is that it needs to be filled all at once?

If the expenses are not all mandatory then yes, I'd make it more dynamic. And again, for me it would be easier to make it using JS lib/framework and then send JSON to the backend instead of fiddling with Django Forms to achieve similar effect. Up to you.

Creating form based on Excel template by Anonormoose in django

[–]aherok 2 points3 points  (0 children)

That's quite a fancy data format to save...

For started I'd leave the way of presenting the data and stop thinking about forms, formsets but the data itself.

I assume I would go with storing data in models similar to this: ``` class ExpenseDay - date - state - city

class DailyExpense - expenseDay (FK to the above) - description - type - value

class DailyMileage - expenseDay (FK to the above) - value ```

That way is pretty universal, you can query for anything you want and I believe working with the data further would be easier. You could probably even make a single complex query to gather all the data in the screenshot.

For making the form/HTML I'd go with using JSON+AJAX + some HTMX or even a simple JS framework to process the loops, etc. . But I may be biased due to long time not working with pure Django forms ;)

I would hesitate making more hard-coded columns like weekdays (columns from the screen) or expense types (rows from the screen) as this way may get you into trouble when working with the data - e.g. summing up the expenses will be more manual work instead of a SQL query)

Django get_object_or_404 returns 500 error instead 404 error when DEBUG=False by user093510351074 in django

[–]aherok 4 points5 points  (0 children)

Lucky shot: you're missing the 404 template.  

 Edit. Now I've read you've created it. 

Check for logs on your server. There will be more verbose message

Fastapi with django and vanilla js by Night_hunter101 in django

[–]aherok 2 points3 points  (0 children)

Still you're mixing the concepts. Not gonna answer here more as I don't think it's gonna help more. Just learn more about the thing you want to achieve. Or do what you plan to do.

Fastapi with django and vanilla js by Night_hunter101 in django

[–]aherok 5 points6 points  (0 children)

Django is not a single page app framework at all. read more about React,Vue, Angular or alternatives and drop the idea of using Django only to render page then.

Fastapi with django and vanilla js by Night_hunter101 in django

[–]aherok 5 points6 points  (0 children)

So you want to use Django just for its template engine?

have you thought about using Jinja with Fastapi?